-SKIP_COUNTER(name, gb, num)
- will increment the internal bit counter (see SKIP_CACHE & SKIP_BITS)
-
-LAST_SKIP_CACHE(name, gb, num)
- will remove the next num bits from the cache if it is needed for UPDATE_CACHE otherwise it will do nothing
-
-LAST_SKIP_BITS(name, gb, num)
- is equivalent to SKIP_LAST_CACHE; SKIP_COUNTER
-
-for examples see get_bits, show_bits, skip_bits, get_vlc
-*/
-
-#ifdef ALT_BITSTREAM_READER
-# define MIN_CACHE_BITS 25
-
-# define OPEN_READER(name, gb)\
- int name##_index= (gb)->index;\
- int name##_cache= 0;\
-
-# define CLOSE_READER(name, gb)\
- (gb)->index= name##_index;\
-
-# ifdef ALT_BITSTREAM_READER_LE
-# define UPDATE_CACHE(name, gb)\
- name##_cache= AV_RL32( ((const uint8_t *)(gb)->buffer)+(name##_index>>3) ) >> (name##_index&0x07);\
-
-# define SKIP_CACHE(name, gb, num)\
- name##_cache >>= (num);
-# else
-# define UPDATE_CACHE(name, gb)\
- name##_cache= AV_RB32( ((const uint8_t *)(gb)->buffer)+(name##_index>>3) ) << (name##_index&0x07);\
-
-# define SKIP_CACHE(name, gb, num)\
- name##_cache <<= (num);
-# endif
-
-// FIXME name?
-# define SKIP_COUNTER(name, gb, num)\
- name##_index += (num);\
-
-# define SKIP_BITS(name, gb, num)\
- {\
- SKIP_CACHE(name, gb, num)\
- SKIP_COUNTER(name, gb, num)\
- }\
-
-# define LAST_SKIP_BITS(name, gb, num) SKIP_COUNTER(name, gb, num)
-# define LAST_SKIP_CACHE(name, gb, num) ;
-
-# ifdef ALT_BITSTREAM_READER_LE
-# define SHOW_UBITS(name, gb, num)\
- ((name##_cache) & (NEG_USR32(0xffffffff,num)))
-
-# define SHOW_SBITS(name, gb, num)\
- NEG_SSR32((name##_cache)<<(32-(num)), num)
-# else
-# define SHOW_UBITS(name, gb, num)\
- NEG_USR32(name##_cache, num)
-
-# define SHOW_SBITS(name, gb, num)\
- NEG_SSR32(name##_cache, num)
-# endif
-
-# define GET_CACHE(name, gb)\
- ((uint32_t)name##_cache)
-
-static inline int get_bits_count(GetBitContext *s){
- return s->index;