summaryrefslogtreecommitdiff
path: root/libavcodec/cavsdec.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2014-11-17 00:22:27 +0100
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-11-18 00:39:23 +0100
commit85dc006b1a829726dd5e3a9b0fcc6a1dbfe6dffa (patch)
treed7b57c5be511f35b59873d487eb807160c4d04bc /libavcodec/cavsdec.c
parent771656bd85416cd6308b11aed6f2c69a8db9c21b (diff)
lavc: fix bitshifts amount bigger than the type
CC: libav-stable@libav.org Bug-Id: CID 1194387 / CID 1194389 / CID 1194393 / CID 1206638
Diffstat (limited to 'libavcodec/cavsdec.c')
-rw-r--r--libavcodec/cavsdec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index d0c72a74a0..cf21a8bb03 100644
--- a/libavcodec/cavsdec.c
+++ b/libavcodec/cavsdec.c
@@ -473,7 +473,7 @@ static inline void mv_pred_direct(AVSContext *h, cavs_vector *pmv_fw,
{
cavs_vector *pmv_bw = pmv_fw + MV_BWD_OFFS;
int den = h->direct_den[col_mv->ref];
- int m = col_mv->x >> 31;
+ int m = FF_SIGNBIT(col_mv->x);
pmv_fw->dist = h->dist[1];
pmv_bw->dist = h->dist[0];
@@ -482,7 +482,7 @@ static inline void mv_pred_direct(AVSContext *h, cavs_vector *pmv_fw,
/* scale the co-located motion vector according to its temporal span */
pmv_fw->x = (((den + (den * col_mv->x * pmv_fw->dist ^ m) - m - 1) >> 14) ^ m) - m;
pmv_bw->x = m - (((den + (den * col_mv->x * pmv_bw->dist ^ m) - m - 1) >> 14) ^ m);
- m = col_mv->y >> 31;
+ m = FF_SIGNBIT(col_mv->y);
pmv_fw->y = (((den + (den * col_mv->y * pmv_fw->dist ^ m) - m - 1) >> 14) ^ m) - m;
pmv_bw->y = m - (((den + (den * col_mv->y * pmv_bw->dist ^ m) - m - 1) >> 14) ^ m);
}