Fix signed left-shifts added in e93acb2d228c.
Since we now require C99, this is undefined behavior.
Thanks to Luc Trudeau for the report and Alex Converse for the
suggestion on how to make the macro safe for all integer sizes.
Change-Id: I99a1342dfedb3e17a6869269be317c2ed26bfe9b
diff --git a/av1/encoder/encodemb.c b/av1/encoder/encodemb.c
index 2368294..506411c 100644
--- a/av1/encoder/encodemb.c
+++ b/av1/encoder/encodemb.c
@@ -1212,8 +1212,9 @@
// copy int16 inputs to int32
for (i = 0; i < tx_blk_size * tx_blk_size; i++) {
- ref_int32[i] = ref_coeff_pvq[i] << (OD_COEFF_SHIFT - coeff_shift);
- in_int32[i] = coeff_pvq[i] << (OD_COEFF_SHIFT - coeff_shift);
+ ref_int32[i] =
+ AOM_SIGNED_SHL(ref_coeff_pvq[i], OD_COEFF_SHIFT - coeff_shift);
+ in_int32[i] = AOM_SIGNED_SHL(coeff_pvq[i], OD_COEFF_SHIFT - coeff_shift);
}
if (abs(in_int32[0] - ref_int32[0]) < pvq_dc_quant * 141 / 256) { /* 0.55 */