From 05858889b2261fc3a98c19e25219b435ea0f6154 Mon Sep 17 00:00:00 2001 From: BERO Date: Wed, 14 May 2003 01:08:02 +0000 Subject: decode motion & modulo optimize patch by (BERO ) Originally committed as revision 1872 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/msmpeg4.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'libavcodec/msmpeg4.c') diff --git a/libavcodec/msmpeg4.c b/libavcodec/msmpeg4.c index df39315854..e4daec4e8f 100644 --- a/libavcodec/msmpeg4.c +++ b/libavcodec/msmpeg4.c @@ -1481,10 +1481,12 @@ static int msmpeg4v2_decode_motion(MpegEncContext * s, int pred, int f_code) return pred; sign = get_bits1(&s->gb); shift = f_code - 1; - val = (code - 1) << shift; - if (shift > 0) + val = code; + if (shift) { + val = (val - 1) << shift; val |= get_bits(&s->gb, shift); - val++; + val++; + } if (sign) val = -val; -- cgit v1.2.3