]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/golomb.h
VP8: faster MV clipping
[ffmpeg] / libavcodec / golomb.h
index 59b4f9eca072b65f95cf463738d69ec76b49d9f8..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
@@ -31,7 +31,8 @@
 #define AVCODEC_GOLOMB_H
 
 #include <stdint.h>
-#include "bitstream.h"
+#include "get_bits.h"
+#include "put_bits.h"
 
 #define INVALID_VLC           0x80000000
 
@@ -252,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;