mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-16 05:49:51 +02:00
Updated the near-lossless level mapping.
Updated the near-lossless level mapping and make it correlated to lossy quality i.e 100 => minimum loss (in-fact no-loss) and the visual-quality loss increases with decrease in near-lossless level (quality) till value 0. The new mapping implies following (PSNR) loss-metric: -near_lossless 100: No-loss (bit-stream same as -lossless). -near_lossless 80: Very very high PSNR (around 54dB). -near_lossless 60: Very high PSNR (around 48dB). -near_lossless 40: High PSNR (around 42dB). -near_lossless 20: Moderate PSNR (around 36dB). -near_lossless 0: Low PSNR (around 30dB). Change-Id: I930de4b18950faf2868c97d42e9e49ba0b642960
This commit is contained in:
@ -125,9 +125,14 @@ static void NearLossless(int xsize, int ysize, uint32_t* argb,
|
||||
}
|
||||
|
||||
static int QualityToLimitBits(int quality) {
|
||||
// quality mapping 0..12 -> 5
|
||||
// 13..100 -> 4..1
|
||||
return MAX_LIMIT_BITS - (quality + 12) / 25;
|
||||
// quality mapping:
|
||||
// 0..19 -> 5
|
||||
// 0..39 -> 4
|
||||
// 0..59 -> 3
|
||||
// 0..79 -> 2
|
||||
// 0..99 -> 1
|
||||
// 100 -> 0
|
||||
return MAX_LIMIT_BITS - quality / 20;
|
||||
}
|
||||
|
||||
int VP8ApplyNearLossless(int xsize, int ysize, uint32_t* argb, int quality) {
|
||||
|
Reference in New Issue
Block a user