]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/golomb.h
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavcodec / golomb.h
index 7044042c95ad94cf13aff7e00cd6e0aeb59496c8..90eeb30b545d2c06410ee611f076632db2ce750a 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 /**
- * @file libavcodec/golomb.h
+ * @file
  * @brief
  *     exp golomb vlc stuff
  * @author Michael Niedermayer <michaelni@gmx.at> and Alex Beregszaszi
@@ -253,8 +253,12 @@ static inline int get_ur_golomb(GetBitContext *gb, int k, int limit, int esc_len
 
         return buf;
     }else{
-        buf >>= 32 - limit - esc_len;
-        LAST_SKIP_BITS(re, gb, esc_len + limit);
+        LAST_SKIP_BITS(re, gb, limit);
+        UPDATE_CACHE(re, gb);
+
+        buf = SHOW_UBITS(re, gb, esc_len);
+
+        LAST_SKIP_BITS(re, gb, esc_len);
         CLOSE_READER(re, gb);
 
         return buf + limit - 1;