mirror of
https://github.com/webmproject/libwebp.git
synced 2025-01-27 15:12:54 +01:00
tune quantization biases toward higher precision
* raise U/V quantization bias to more neutral values * also raise the non-zero AC bias for Y1/Y2 matrices (we need all the precision we can for U/V leves, which are often empty) This will increase quality in the higher range (q >= 90) mostly. Files size is exacted to raise a little (5-7%). and SSIM accordingly of course. Change-Id: I8a9ffdb6d8fb6dadb959e3fd392e66dc5aaed64e
This commit is contained in:
parent
1e898619cb
commit
a014e9c9cd
@ -169,20 +169,8 @@ static const uint16_t kCoeffThresh[16] = {
|
||||
30, 30, 30, 30
|
||||
};
|
||||
|
||||
// TODO(skal): tune more. Coeff thresholding?
|
||||
static const uint8_t kBiasMatrices[3][16] = { // [3] = [luma-ac,luma-dc,chroma]
|
||||
{ 96, 96, 96, 96,
|
||||
96, 96, 96, 96,
|
||||
96, 96, 96, 96,
|
||||
96, 96, 96, 96 },
|
||||
{ 96, 96, 96, 96,
|
||||
96, 96, 96, 96,
|
||||
96, 96, 96, 96,
|
||||
96, 96, 96, 96 },
|
||||
{ 96, 96, 96, 96,
|
||||
96, 96, 96, 96,
|
||||
96, 96, 96, 96,
|
||||
96, 96, 96, 96 }
|
||||
static const uint8_t kBiasMatrices[3][2] = { // [luma-ac,luma-dc,chroma][dc,ac]
|
||||
{ 96, 110 }, { 96, 112 }, { 112, 120 }
|
||||
};
|
||||
|
||||
// Sharpening by (slightly) raising the hi-frequency coeffs.
|
||||
@ -205,7 +193,8 @@ static int ExpandMatrix(VP8Matrix* const m, int type) {
|
||||
m->q_[i] = m->q_[1];
|
||||
}
|
||||
for (i = 0; i < 16; ++i) {
|
||||
const int bias = kBiasMatrices[type][i];
|
||||
const int is_ac_coeff = (i > 0);
|
||||
const int bias = kBiasMatrices[type][is_ac_coeff];
|
||||
m->iq_[i] = (1 << QFIX) / m->q_[i];
|
||||
m->bias_[i] = BIAS(bias);
|
||||
// TODO(skal): tune kCoeffThresh[]
|
||||
|
Loading…
x
Reference in New Issue
Block a user