diff msmpeg4.c @ 1255:625ccacd1113 libavcodec

decode motion & modulo optimize patch by (BERO <bero at geocities dot co dot jp>)
author michaelni
date Wed, 14 May 2003 01:08:02 +0000
parents b874217f906b
children 362947395f5c
line wrap: on
line diff
--- a/msmpeg4.c	Wed May 14 00:32:22 2003 +0000
+++ b/msmpeg4.c	Wed May 14 01:08:02 2003 +0000
@@ -1481,10 +1481,12 @@
         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;