diff options
author | Yaowu Xu <yaowu@google.com> | 2012-02-14 07:40:26 -0800 |
---|---|---|
committer | Yaowu Xu <yaowu@google.com> | 2012-02-16 07:03:55 -0800 |
commit | 454c7abc1ae56134019f2a26fac6db9bcb1627d4 (patch) | |
tree | 205e4671a434cf6cb2a4790238c84598b99dfbca /vp8/decoder/dequantize.c | |
parent | 0930dde2496e911d24c930751b08c71ae722bd89 (diff) | |
download | libvpx-454c7abc1ae56134019f2a26fac6db9bcb1627d4.tar libvpx-454c7abc1ae56134019f2a26fac6db9bcb1627d4.tar.gz libvpx-454c7abc1ae56134019f2a26fac6db9bcb1627d4.tar.bz2 libvpx-454c7abc1ae56134019f2a26fac6db9bcb1627d4.zip |
moved scaling from dequantization to inverse transform for T8x8
Previously, the scaling related to extended quantize range happens in
dequantization stage, which implies the coefficients form forward
transform are in different scale(4x) from dequantization coefficients
This worked fine when there was not distortion computation done based
on 8x8 transform, but it completely wracked the distortion estimation
based on transform coefficients and dequantized transform coefficients
introduced in commit f64725a00 for macroblocks using 8x8 transform.
This commit fixed the issue by moving the scaling into the stage of
inverse 8x8 transform.
TODO: Test&Verify the transform/quantization pipeline accuracy.
Change-Id: Iff77b36a965c2a6b247e59b9c59df93eba5d60e2
Diffstat (limited to 'vp8/decoder/dequantize.c')
-rw-r--r-- | vp8/decoder/dequantize.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/vp8/decoder/dequantize.c b/vp8/decoder/dequantize.c index 83bf8a76c..c48f5c23f 100644 --- a/vp8/decoder/dequantize.c +++ b/vp8/decoder/dequantize.c @@ -131,7 +131,7 @@ void vp8_dequantize_b_2x2_c(BLOCKD *d) for (i = 0; i < 16; i++) { - DQ[i] = (short)((Q[i] * DQC[i]+2)>>2); + DQ[i] = (short)((Q[i] * DQC[i])); } #ifdef DEC_DEBUG if (dec_debug) { @@ -164,12 +164,12 @@ void vp8_dequant_idct_add_8x8_c(short *input, short *dq, unsigned char *pred, } #endif - input[0]= (input[0] * dq[0]+2)>>2; + input[0]= input[0] * dq[0]; // recover quantizer for 4 4x4 blocks for (i = 1; i < 64; i++) { - input[i]=(input[i] * dq[1]+2)>>2; + input[i]=input[i] * dq[1]; } #ifdef DEC_DEBUG if (dec_debug) { @@ -262,7 +262,7 @@ void vp8_dequant_dc_idct_add_8x8_c(short *input, short *dq, unsigned char *pred, #endif for (i = 1; i < 64; i++) { - input[i]=(input[i] * dq[1]+2)>>2; + input[i]=input[i] * dq[1]; } #ifdef DEC_DEBUG |