Avoid left shift of negative values
changes shifts to multiplications
BUG=aomedia:617
Change-Id: I46a7b3b5d566f8c671e54d8cb876cc53fdc5009d
diff --git a/av1/common/reconintra.c b/av1/common/reconintra.c
index 494b996..c8a0a99 100644
--- a/av1/common/reconintra.c
+++ b/av1/common/reconintra.c
@@ -835,7 +835,7 @@
y = (r << 8) - dy;
for (c = 0; c < bw; ++c, base1 += base_inc_x, y -= dy) {
if (base1 >= min_base_x) {
- shift1 = (x << upsample_above) & 0xFF;
+ shift1 = (x * (1 << upsample_above)) & 0xFF;
#if CONFIG_INTRA_INTERP
val =
intra_subpel_interp(base1, shift1, above, -1, bw - 1, filter_type);
@@ -846,7 +846,7 @@
} else {
base2 = y >> frac_bits_y;
assert(base2 >= -(1 << upsample_left));
- shift2 = (y << upsample_left) & 0xFF;
+ shift2 = (y * (1 << upsample_left)) & 0xFF;
#if CONFIG_INTRA_INTERP
val = intra_subpel_interp(base2, shift2, left, -1, bh - 1, filter_type);
#else