aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/svq1dec.c
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2011-11-26 15:16:29 +0000
committerMans Rullgard <mans@mansr.com>2011-11-26 18:50:02 +0000
commite4faa31a0a68dbff320b419a3a73d6b028d770d5 (patch)
treef4ea192555ff061f16664f52e4dd76fc376333a4 /libavcodec/svq1dec.c
parent171ec812235a5d22fa421242351ee2da5a96c3ba (diff)
downloadffmpeg-e4faa31a0a68dbff320b419a3a73d6b028d770d5.tar.gz
svq1dec: use sign_extend()
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavcodec/svq1dec.c')
-rw-r--r--libavcodec/svq1dec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c
index a604f1dc96..8569615aa9 100644
--- a/libavcodec/svq1dec.c
+++ b/libavcodec/svq1dec.c
@@ -317,9 +317,9 @@ static int svq1_decode_motion_vector (GetBitContext *bitbuf, svq1_pmv *mv, svq1_
/* add median of motion vector predictors and clip result */
if (i == 1)
- mv->y = ((diff + mid_pred(pmv[0]->y, pmv[1]->y, pmv[2]->y)) << 26) >> 26;
+ mv->y = sign_extend(diff + mid_pred(pmv[0]->y, pmv[1]->y, pmv[2]->y), 6);
else
- mv->x = ((diff + mid_pred(pmv[0]->x, pmv[1]->x, pmv[2]->x)) << 26) >> 26;
+ mv->x = sign_extend(diff + mid_pred(pmv[0]->x, pmv[1]->x, pmv[2]->x), 6);
}
return 0;