Commit 31d19279 authored by Yaowu Xu's avatar Yaowu Xu Committed by Sebastien Alaiwan

Avoid left shift of negative values

changes shifts to multiplications

BUG=aomedia:617

Change-Id: I46a7b3b5d566f8c671e54d8cb876cc53fdc5009d
parent 23198661
......@@ -835,7 +835,7 @@ static void dr_prediction_z2(uint8_t *dst, ptrdiff_t stride, int bw, int bh,
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 @@ static void dr_prediction_z2(uint8_t *dst, ptrdiff_t stride, int bw, int bh,
} 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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment