summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHien Ho <hienho@google.com>2019-08-16 15:48:32 -0700
committerHien Ho <hienho@google.com>2019-08-22 23:15:17 +0000
commit2f52ae2384846b1ccd2c18db75bbb0867c1c9f5e (patch)
tree200eac8da9966608bad41cc10892635e4586a29b
parent232ff9361e5f18189c18e874deb6868db04d7b5b (diff)
downloadlibvpx-2f52ae2384846b1ccd2c18db75bbb0867c1c9f5e.tar
libvpx-2f52ae2384846b1ccd2c18db75bbb0867c1c9f5e.tar.gz
libvpx-2f52ae2384846b1ccd2c18db75bbb0867c1c9f5e.tar.bz2
libvpx-2f52ae2384846b1ccd2c18db75bbb0867c1c9f5e.zip
test/vp9_quantize_test: fix int sanitizer warning
implicit conversion from type 'int' of value 42126 (32-bit, signed) to type 'tran_low_t' (aka 'short') changed the value to -23410 (16-bit, signed) BUG=webm:1615 Change-Id: I339c640fce81e9f2dd73ef9c9bee084b6a5638dc
-rw-r--r--test/vp9_quantize_test.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/vp9_quantize_test.cc b/test/vp9_quantize_test.cc
index d094904f1..a0c883302 100644
--- a/test/vp9_quantize_test.cc
+++ b/test/vp9_quantize_test.cc
@@ -214,12 +214,15 @@ inline void quant_fp_nz(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
tmp = clamp(abs_coeff[y] + _round, INT16_MIN, INT16_MAX);
tmp = (tmp * quant_ptr[rc != 0]) >> (16 - is_32x32);
qcoeff_ptr[rc] = (tmp ^ coeff_sign[y]) - coeff_sign[y];
- dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr[rc != 0];
+ dqcoeff_ptr[rc] =
+ static_cast<tran_low_t>(qcoeff_ptr[rc] * dequant_ptr[rc != 0]);
if (is_32x32) {
- dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr[rc != 0] / 2;
+ dqcoeff_ptr[rc] = static_cast<tran_low_t>(qcoeff_ptr[rc] *
+ dequant_ptr[rc != 0] / 2);
} else {
- dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr[rc != 0];
+ dqcoeff_ptr[rc] =
+ static_cast<tran_low_t>(qcoeff_ptr[rc] * dequant_ptr[rc != 0]);
}
} else {
qcoeff_ptr[rc] = 0;