From aa498fef0dbd6eebd1b4dd90c36d3117cd9a17b2 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Sun, 9 Oct 2011 23:16:07 +0100 Subject: mpeg124: use sign_extend() function Signed-off-by: Mans Rullgard --- libavcodec/ituh263dec.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'libavcodec/ituh263dec.c') diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c index a54d7c1728..a234c2ac7a 100644 --- a/libavcodec/ituh263dec.c +++ b/libavcodec/ituh263dec.c @@ -271,7 +271,7 @@ int ff_h263_resync(MpegEncContext *s){ int h263_decode_motion(MpegEncContext * s, int pred, int f_code) { - int code, val, sign, shift, l; + int code, val, sign, shift; code = get_vlc2(&s->gb, mv_vlc.table, MV_VLC_BITS, 2); if (code == 0) @@ -293,8 +293,7 @@ int h263_decode_motion(MpegEncContext * s, int pred, int f_code) /* modulo decoding */ if (!s->h263_long_vectors) { - l = INT_BIT - 5 - f_code; - val = (val<>l; + val = sign_extend(val, 5 + f_code); } else { /* horrible h263 long vector mode */ if (pred < -31 && val < -63) -- cgit v1.2.3