changeset 2439:6684c0e9e28f libavcodec

svq3_get_se_golomb() fix
author michael
date Wed, 19 Jan 2005 13:03:38 +0000
parents e98b5e0de86b
children cf97353f94c6
files golomb.h
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/golomb.h	Wed Jan 19 12:58:34 2005 +0000
+++ b/golomb.h	Wed Jan 19 13:03:38 2005 +0000
@@ -167,7 +167,10 @@
         
         return ff_interleaved_se_golomb_vlc_code[buf];
     }else{
-        buf |=1;
+        LAST_SKIP_BITS(re, gb, 8);
+        UPDATE_CACHE(re, gb);
+        buf |= 1 | (GET_CACHE(re, gb) >> 8);
+
         if((buf & 0xAAAAAAAA) == 0)
             return INVALID_VLC;
 
@@ -175,7 +178,7 @@
             buf = (buf << 2) - ((buf << log) >> (log - 1)) + (buf >> 30);
         }
 
-        LAST_SKIP_BITS(re, gb, 63 - 2*log);
+        LAST_SKIP_BITS(re, gb, 63 - 2*log - 8);
         CLOSE_READER(re, gb);
 
         return (signed) (((((buf << log) >> log) - 1) ^ -(buf & 0x1)) + 1) >> 1;