]> granicus.if.org Git - libvpx/commitdiff
quantize.c: int->uint32_t for absolute values
authorYaowu Xu <yaowu@google.com>
Fri, 2 Sep 2016 22:28:30 +0000 (15:28 -0700)
committerYaowu Xu <yaowu@google.com>
Tue, 6 Sep 2016 14:51:47 +0000 (14:51 +0000)
Change-Id: I784f32e0e86d873655e46cf68c5c124a698af361

aom_dsp/quantize.c

index 3a2dff775f7b9574585883e47019cb287289badb..1b9bbdc62964c712f9aa939c400a3349d1dcd648 100644 (file)
@@ -416,7 +416,7 @@ void aom_highbd_quantize_dc(const tran_low_t *coeff_ptr, int n_coeffs,
     const int coeff_sign = (coeff >> 31);
     const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign;
     const int64_t tmp = abs_coeff + round_ptr[0];
-    const int abs_qcoeff = (int)((tmp * quant) >> 16);
+    const uint32_t abs_qcoeff = (uint32_t)((tmp * quant) >> 16);
     qcoeff_ptr[0] = (tran_low_t)((abs_qcoeff ^ coeff_sign) - coeff_sign);
     dqcoeff_ptr[0] = qcoeff_ptr[0] * dequant_ptr;
     if (abs_qcoeff) eob = 0;
@@ -468,7 +468,7 @@ void aom_highbd_quantize_dc_32x32(const tran_low_t *coeff_ptr, int skip_block,
     const int coeff_sign = (coeff >> 31);
     const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign;
     const int64_t tmp = abs_coeff + ROUND_POWER_OF_TWO(round_ptr[0], 1);
-    const int abs_qcoeff = (int)((tmp * quant) >> 15);
+    const uint32_t abs_qcoeff = (uint32_t)((tmp * quant) >> 15);
     qcoeff_ptr[0] = (tran_low_t)((abs_qcoeff ^ coeff_sign) - coeff_sign);
     dqcoeff_ptr[0] = qcoeff_ptr[0] * dequant_ptr / 2;
     if (abs_qcoeff) eob = 0;