changeset 3366:c59aa4cdf042 libavcodec

This should make P-frames decoding work on x86 (by avoiding get_bits(0))
author kostya
date Thu, 29 Jun 2006 11:02:33 +0000
parents 84f29207af3a
children 8c7b8ffc2485
files vc1.c
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/vc1.c	Tue Jun 27 21:01:21 2006 +0000
+++ b/vc1.c	Thu Jun 29 11:02:33 2006 +0000
@@ -1341,14 +1341,18 @@
     index1 = index%6;                                               \
     if (s->mspel && index1 == 5) val = 1;                           \
     else                         val = 0;                           \
-    val = get_bits(gb, size_table[index1] - val);                   \
+    if(size_table[index1] - val > 0)                                \
+        val = get_bits(gb, size_table[index1] - val);               \
+    else                                   val = 0;                 \
     sign = 0 - (val&1);                                             \
     _dmv_x = (sign ^ ((val>>1) + offset_table[index1])) - sign;     \
                                                                     \
     index1 = index/6;                                               \
     if (s->mspel && index1 == 5) val = 1;                           \
-    else                          val = 0;                          \
-    val = get_bits(gb, size_table[index1] - val);                   \
+    else                         val = 0;                           \
+    if(size_table[index1] - val > 0)                                \
+        val = get_bits(gb, size_table[index1] - val);               \
+    else                                   val = 0;                 \
     sign = 0 - (val&1);                                             \
     _dmv_y = (sign ^ ((val>>1) + offset_table[index1])) - sign;     \
   }