summaryrefslogtreecommitdiff
path: root/vpx_dsp/quantize.c
diff options
context:
space:
mode:
authorYaowu Xu <yaowu@google.com>2016-06-15 18:09:11 -0700
committerYaowu Xu <yaowu@google.com>2016-06-16 21:46:14 +0000
commitde3a8f23c8c10f9fb4f4430cca68d34ee316961d (patch)
treee5e8f2360656911b256f42ae68217dba2d855b56 /vpx_dsp/quantize.c
parente5e998a6eb0a51dcaa1be6984525d2263968cf52 (diff)
downloadlibvpx-de3a8f23c8c10f9fb4f4430cca68d34ee316961d.tar
libvpx-de3a8f23c8c10f9fb4f4430cca68d34ee316961d.tar.gz
libvpx-de3a8f23c8c10f9fb4f4430cca68d34ee316961d.tar.bz2
libvpx-de3a8f23c8c10f9fb4f4430cca68d34ee316961d.zip
vpx_dsp/quantize.c: fix ubsan warnings
BUG=webm:1219 Change-Id: I0c80271c6b78adf40aa7a4cac9e6b431d56958cb
Diffstat (limited to 'vpx_dsp/quantize.c')
-rw-r--r--vpx_dsp/quantize.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/vpx_dsp/quantize.c b/vpx_dsp/quantize.c
index 6426cccc7..80fcd66b0 100644
--- a/vpx_dsp/quantize.c
+++ b/vpx_dsp/quantize.c
@@ -53,7 +53,7 @@ void vpx_highbd_quantize_dc(const tran_low_t *coeff_ptr,
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 uint32_t abs_qcoeff = (uint32_t)((tmp * quant) >> 16);
+ const int abs_qcoeff = (int)((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)
@@ -109,7 +109,7 @@ void vpx_highbd_quantize_dc_32x32(const tran_low_t *coeff_ptr,
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 uint32_t abs_qcoeff = (uint32_t)((tmp * quant) >> 15);
+ const int abs_qcoeff = (int)((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)