Commit 70d9acc1 authored by Yaowu Xu's avatar Yaowu Xu

Avoid left shift of negative numbers

Slience warnings by converting the shifts to mulitplies.

Change-Id: Icde8f2df650f740b8e90691ba706a0853be84984
parent 40131320
......@@ -1014,10 +1014,10 @@ void av1_highbd_warp_affine_c(const int32_t *mat, const uint16_t *ref,
sx4 += alpha * (-4) + beta * (-4);
sy4 += gamma * (-4) + delta * (-4);
sx4 = ROUND_POWER_OF_TWO_SIGNED(sx4, WARP_PARAM_REDUCE_BITS)
<< WARP_PARAM_REDUCE_BITS;
sy4 = ROUND_POWER_OF_TWO_SIGNED(sy4, WARP_PARAM_REDUCE_BITS)
<< WARP_PARAM_REDUCE_BITS;
sx4 = ROUND_POWER_OF_TWO_SIGNED(sx4, WARP_PARAM_REDUCE_BITS) *
(1 << WARP_PARAM_REDUCE_BITS);
sy4 = ROUND_POWER_OF_TWO_SIGNED(sy4, WARP_PARAM_REDUCE_BITS) *
(1 << WARP_PARAM_REDUCE_BITS);
// Horizontal filter
for (k = -7; k < 8; ++k) {
......@@ -1272,10 +1272,10 @@ void av1_warp_affine_c(const int32_t *mat, const uint8_t *ref, int width,
sx4 += alpha * (-4) + beta * (-4);
sy4 += gamma * (-4) + delta * (-4);
sx4 = ROUND_POWER_OF_TWO_SIGNED(sx4, WARP_PARAM_REDUCE_BITS)
<< WARP_PARAM_REDUCE_BITS;
sy4 = ROUND_POWER_OF_TWO_SIGNED(sy4, WARP_PARAM_REDUCE_BITS)
<< WARP_PARAM_REDUCE_BITS;
sx4 = ROUND_POWER_OF_TWO_SIGNED(sx4, WARP_PARAM_REDUCE_BITS) *
(1 << WARP_PARAM_REDUCE_BITS);
sy4 = ROUND_POWER_OF_TWO_SIGNED(sy4, WARP_PARAM_REDUCE_BITS) *
(1 << WARP_PARAM_REDUCE_BITS);
// Horizontal filter
for (k = -7; k < 8; ++k) {
......
......@@ -71,10 +71,10 @@ void av1_highbd_warp_affine_ssse3(const int32_t *mat, const uint16_t *ref,
sx4 += alpha * (-4) + beta * (-4);
sy4 += gamma * (-4) + delta * (-4);
sx4 = ROUND_POWER_OF_TWO_SIGNED(sx4, WARP_PARAM_REDUCE_BITS)
<< WARP_PARAM_REDUCE_BITS;
sy4 = ROUND_POWER_OF_TWO_SIGNED(sy4, WARP_PARAM_REDUCE_BITS)
<< WARP_PARAM_REDUCE_BITS;
sx4 = ROUND_POWER_OF_TWO_SIGNED(sx4, WARP_PARAM_REDUCE_BITS) *
(1 << WARP_PARAM_REDUCE_BITS);
sy4 = ROUND_POWER_OF_TWO_SIGNED(sy4, WARP_PARAM_REDUCE_BITS) *
(1 << WARP_PARAM_REDUCE_BITS);
// Horizontal filter
for (k = -7; k < AOMMIN(8, p_height - i); ++k) {
......
......@@ -66,10 +66,10 @@ void av1_warp_affine_sse2(const int32_t *mat, const uint8_t *ref, int width,
sx4 += alpha * (-4) + beta * (-4);
sy4 += gamma * (-4) + delta * (-4);
sx4 = ROUND_POWER_OF_TWO_SIGNED(sx4, WARP_PARAM_REDUCE_BITS)
<< WARP_PARAM_REDUCE_BITS;
sy4 = ROUND_POWER_OF_TWO_SIGNED(sy4, WARP_PARAM_REDUCE_BITS)
<< WARP_PARAM_REDUCE_BITS;
sx4 = ROUND_POWER_OF_TWO_SIGNED(sx4, WARP_PARAM_REDUCE_BITS) *
(1 << WARP_PARAM_REDUCE_BITS);
sy4 = ROUND_POWER_OF_TWO_SIGNED(sy4, WARP_PARAM_REDUCE_BITS) *
(1 << WARP_PARAM_REDUCE_BITS);
// Horizontal filter
for (k = -7; k < AOMMIN(8, p_height - i); ++k) {
......
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