diff --git a/vp9/common/vp9_idct.c b/vp9/common/vp9_idct.c index a2245259e..f06bf047b 100644 --- a/vp9/common/vp9_idct.c +++ b/vp9/common/vp9_idct.c @@ -28,10 +28,10 @@ void vp9_short_iwalsh4x4_add_c(int16_t *input, uint8_t *dest, int dest_stride) { int16_t *op = output; for (i = 0; i < 4; i++) { - a1 = ip[0] >> WHT_UPSCALE_FACTOR; - c1 = ip[1] >> WHT_UPSCALE_FACTOR; - d1 = ip[2] >> WHT_UPSCALE_FACTOR; - b1 = ip[3] >> WHT_UPSCALE_FACTOR; + a1 = ip[0] >> UNIT_QUANT_SHIFT; + c1 = ip[1] >> UNIT_QUANT_SHIFT; + d1 = ip[2] >> UNIT_QUANT_SHIFT; + b1 = ip[3] >> UNIT_QUANT_SHIFT; a1 += c1; d1 -= b1; e1 = (a1 - d1) >> 1; @@ -77,7 +77,7 @@ void vp9_short_iwalsh4x4_1_add_c(int16_t *in, uint8_t *dest, int dest_stride) { int16_t *ip = in; int16_t *op = tmp; - a1 = ip[0] >> WHT_UPSCALE_FACTOR; + a1 = ip[0] >> UNIT_QUANT_SHIFT; e1 = a1 >> 1; a1 -= e1; op[0] = a1; diff --git a/vp9/common/vp9_idct.h b/vp9/common/vp9_idct.h index 5f2f0a569..59892cd03 100644 --- a/vp9/common/vp9_idct.h +++ b/vp9/common/vp9_idct.h @@ -22,7 +22,8 @@ #define DCT_CONST_BITS 14 #define DCT_CONST_ROUNDING (1 << (DCT_CONST_BITS - 1)) -#define WHT_UPSCALE_FACTOR 2 +#define UNIT_QUANT_SHIFT 2 +#define UNIT_QUANT_FACTOR (1 << UNIT_QUANT_SHIFT) #define pair_set_epi16(a, b) \ _mm_set_epi16(b, a, b, a, b, a, b, a) diff --git a/vp9/encoder/vp9_dct.c b/vp9/encoder/vp9_dct.c index ca863931e..b9c300033 100644 --- a/vp9/encoder/vp9_dct.c +++ b/vp9/encoder/vp9_dct.c @@ -637,10 +637,10 @@ void vp9_short_walsh4x4_c(short *input, short *output, int pitch) { c1 = e1 - c1; a1 -= c1; d1 += b1; - op[0] = a1 << WHT_UPSCALE_FACTOR; - op[1] = c1 << WHT_UPSCALE_FACTOR; - op[2] = d1 << WHT_UPSCALE_FACTOR; - op[3] = b1 << WHT_UPSCALE_FACTOR; + op[0] = a1 * UNIT_QUANT_FACTOR; + op[1] = c1 * UNIT_QUANT_FACTOR; + op[2] = d1 * UNIT_QUANT_FACTOR; + op[3] = b1 * UNIT_QUANT_FACTOR; ip += 4; op += 4;