aboutsummaryrefslogtreecommitdiff
path: root/libavcodec/msmpeg4.c
diff options
context:
space:
mode:
authorBERO2003-05-14 01:08:02 +0000
committerMichael Niedermayer2003-05-14 01:08:02 +0000
commit05858889b2261fc3a98c19e25219b435ea0f6154 (patch)
tree2f1281f4b777f720da8423fac5665cfa9ba19bca /libavcodec/msmpeg4.c
parentd8e00c099731b8499a8c377469ac5796f5bd186c (diff)
decode motion & modulo optimize patch by (BERO <bero at geocities dot co dot jp>)
Originally committed as revision 1872 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/msmpeg4.c')
-rw-r--r--libavcodec/msmpeg4.c8
1 files changed, 5 insertions, 3 deletions
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;