*/
/**
- * @file libavcodec/golomb.h
+ * @file
* @brief
* exp golomb vlc stuff
* @author Michael Niedermayer <michaelni@gmx.at> and Alex Beregszaszi
#define AVCODEC_GOLOMB_H
#include <stdint.h>
-#include "bitstream.h"
+#include "get_bits.h"
+#include "put_bits.h"
#define INVALID_VLC 0x80000000
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;
log= av_log2(buf);
- if(log - k >= 32-MIN_CACHE_BITS && 32-log < limit){
+ if(log - k >= 32-MIN_CACHE_BITS+(MIN_CACHE_BITS==32) && 32-log < limit){
buf >>= log - k;
buf += (30-log)<<k;
LAST_SKIP_BITS(re, gb, 32 + k - log);