From 454c7abc1ae56134019f2a26fac6db9bcb1627d4 Mon Sep 17 00:00:00 2001 From: Yaowu Xu Date: Tue, 14 Feb 2012 07:40:26 -0800 Subject: 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 --- vp8/decoder/dequantize.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'vp8/decoder/dequantize.c') 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 -- cgit v1.2.3