quantize_b_helper_c(): replace left shift with multiplication Fix ubsan test warnings. Change-Id: I3b5849277c9c8cd387c709238a6453e19705d791
diff --git a/aom_dsp/quantize.c b/aom_dsp/quantize.c index 3e8f0d4..b575ee5 100644 --- a/aom_dsp/quantize.c +++ b/aom_dsp/quantize.c
@@ -36,8 +36,8 @@ const qm_val_t wt = qm_ptr != NULL ? qm_ptr[rc] : (1 << AOM_QM_BITS); const int coeff = coeff_ptr[rc] * wt; - if (coeff < (zbins[rc != 0] << AOM_QM_BITS) && - coeff > (nzbins[rc != 0] << AOM_QM_BITS)) + if (coeff < (zbins[rc != 0] * (1 << AOM_QM_BITS)) && + coeff > (nzbins[rc != 0] * (1 << AOM_QM_BITS))) non_zero_count--; else break; @@ -107,8 +107,8 @@ // If the coefficient is out of the base ZBIN range, keep it for // quantization. - if (coeff >= (zbins[rc != 0] << AOM_QM_BITS) || - coeff <= (nzbins[rc != 0] << AOM_QM_BITS)) + if (coeff >= (zbins[rc != 0] * (1 << AOM_QM_BITS)) || + coeff <= (nzbins[rc != 0] * (1 << AOM_QM_BITS))) idx_arr[idx++] = i; }