summaryrefslogtreecommitdiff
path: root/libavcodec/get_bits.h
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/get_bits.h')
-rw-r--r--libavcodec/get_bits.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h
index f1962f29d5..b7c68e1b9f 100644
--- a/libavcodec/get_bits.h
+++ b/libavcodec/get_bits.h
@@ -123,17 +123,18 @@ typedef struct RL_VLC_ELEM {
# define MIN_CACHE_BITS 25
#endif
-#if UNCHECKED_BITSTREAM_READER
-#define OPEN_READER(name, gb) \
+#define OPEN_READER_NOSIZE(name, gb) \
unsigned int name ## _index = (gb)->index; \
unsigned int av_unused name ## _cache = 0
+#if UNCHECKED_BITSTREAM_READER
+#define OPEN_READER(name, gb) OPEN_READER_NOSIZE(name, gb)
+
#define BITS_AVAILABLE(name, gb) 1
#else
#define OPEN_READER(name, gb) \
- unsigned int name ## _index = (gb)->index; \
- unsigned int av_unused name ## _cache = 0; \
- unsigned int av_unused name ## _size_plus8 = (gb)->size_in_bits_plus8
+ OPEN_READER_NOSIZE(name, gb); \
+ unsigned int name ## _size_plus8 = (gb)->size_in_bits_plus8
#define BITS_AVAILABLE(name, gb) name ## _index < name ## _size_plus8
#endif
@@ -254,7 +255,7 @@ static inline unsigned int get_bits(GetBitContext *s, int n)
static inline unsigned int show_bits(GetBitContext *s, int n)
{
register int tmp;
- OPEN_READER(re, s);
+ OPEN_READER_NOSIZE(re, s);
UPDATE_CACHE(re, s);
tmp = SHOW_UBITS(re, s, n);
return tmp;