summaryrefslogtreecommitdiff
path: root/libavcodec/mpeg12.c
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2011-10-09 23:16:07 +0100
committerMans Rullgard <mans@mansr.com>2011-10-09 23:22:14 +0100
commitaa498fef0dbd6eebd1b4dd90c36d3117cd9a17b2 (patch)
tree03193ac1cacab49690ac6734dbecfbb76384e780 /libavcodec/mpeg12.c
parent633ddb85192f1cc39d61fae98455eb6ae5638df0 (diff)
mpeg124: use sign_extend() function
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavcodec/mpeg12.c')
-rw-r--r--libavcodec/mpeg12.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index 6a12344139..5734ab8674 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -54,7 +54,7 @@ static VLC mv_vlc;
/* as H.263, but only 17 codes */
static int mpeg_decode_motion(MpegEncContext *s, int fcode, int pred)
{
- int code, sign, val, l, shift;
+ int code, sign, val, shift;
code = get_vlc2(&s->gb, mv_vlc.table, MV_VLC_BITS, 2);
if (code == 0) {
@@ -77,9 +77,7 @@ static int mpeg_decode_motion(MpegEncContext *s, int fcode, int pred)
val += pred;
/* modulo decoding */
- l = INT_BIT - 5 - shift;
- val = (val << l) >> l;
- return val;
+ return sign_extend(val, 5 + shift);
}
static inline int mpeg1_decode_block_intra(MpegEncContext *s, DCTELEM *block, int n)