ADPCM Codecs
Classes | Macros
get_bits.h File Reference
#include <stdint.h>
#include "config-adpcm.h"
#include "intreadwrite.h"
#include "adpcm.h"
Include dependency graph for get_bits.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  adpcm_ffmpeg::GetBitContext
 

Macros

#define UNCHECKED_BITSTREAM_READER   !CONFIG_SAFE_BITSTREAM_READER
 
#define MIN_CACHE_BITS   25
 
#define OPEN_READER_NOSIZE(name, gb)
 
#define OPEN_READER(name, gb)   OPEN_READER_NOSIZE(name, gb)
 
#define BITS_AVAILABLE(name, gb)   1
 
#define CLOSE_READER(name, gb)   (gb)->index = name ## _index
 
#define UPDATE_CACHE_LE(name, gb)
 
#define UPDATE_CACHE_BE(name, gb)
 
#define UPDATE_CACHE(name, gb)   UPDATE_CACHE_LE(name, gb)
 
#define SKIP_CACHE(name, gb, num)   name ## _cache >>= (num)
 
#define SKIP_COUNTER(name, gb, num)   name ## _index += (num)
 
#define BITS_LEFT(name, gb)   ((int)((gb)->size_in_bits - name ## _index))
 
#define SKIP_BITS(name, gb, num)
 
#define LAST_SKIP_BITS(name, gb, num)   SKIP_COUNTER(name, gb, num)
 
#define SHOW_UBITS_LE(name, gb, num)   zero_extend(name ## _cache, num)
 
#define SHOW_SBITS_LE(name, gb, num)   sign_extend(name ## _cache, num)
 
#define SHOW_UBITS_BE(name, gb, num)   NEG_USR32(name ## _cache, num)
 
#define SHOW_SBITS_BE(name, gb, num)   NEG_SSR32(name ## _cache, num)
 
#define SHOW_UBITS(name, gb, num)   SHOW_UBITS_LE(name, gb, num)
 
#define SHOW_SBITS(name, gb, num)   SHOW_SBITS_LE(name, gb, num)
 
#define GET_CACHE(name, gb)   ((uint32_t) name ## _cache)
 
#define GET_VLC(code, name, gb, table, bits, max_depth)
 
#define GET_RL_VLC(level, run, name, gb, table, bits, max_depth, need_update)
 

Detailed Description

bitstream reader API header.

Macro Definition Documentation

◆ GET_VLC

#define GET_VLC (   code,
  name,
  gb,
  table,
  bits,
  max_depth 
)
Value:
do { \
int n, nb_bits; \
unsigned int index; \
\
index = SHOW_UBITS(name, gb, bits); \
code = table[index].sym; \
n = table[index].len; \
\
if (max_depth > 1 && n < 0) { \
LAST_SKIP_BITS(name, gb, bits); \
UPDATE_CACHE(name, gb); \
\
nb_bits = -n; \
\
index = SHOW_UBITS(name, gb, nb_bits) + code; \
code = table[index].sym; \
n = table[index].len; \
if (max_depth > 2 && n < 0) { \
LAST_SKIP_BITS(name, gb, nb_bits); \
UPDATE_CACHE(name, gb); \
\
nb_bits = -n; \
\
index = SHOW_UBITS(name, gb, nb_bits) + code; \
code = table[index].sym; \
n = table[index].len; \
} \
} \
SKIP_BITS(name, gb, n); \
} while (0)

If the vlc code is invalid and max_depth=1, then no bits will be removed. If the vlc code is invalid and max_depth>1, then the number of bits removed is undefined.

◆ OPEN_READER_NOSIZE

#define OPEN_READER_NOSIZE (   name,
  gb 
)
Value:
unsigned int name ## _index = (gb)->index; \
unsigned int av_unused name ## _cache

◆ SKIP_BITS

#define SKIP_BITS (   name,
  gb,
  num 
)
Value:
do { \
SKIP_CACHE(name, gb, num); \
SKIP_COUNTER(name, gb, num); \
} while (0)

◆ UPDATE_CACHE_BE

#define UPDATE_CACHE_BE (   name,
  gb 
)
Value:
name ## _cache = \
AV_RB32((gb)->buffer + (name ## _index >> 3)) << (name ## _index & 7)

◆ UPDATE_CACHE_LE

#define UPDATE_CACHE_LE (   name,
  gb 
)
Value:
name ## _cache = \
AV_RL32((gb)->buffer + (name ## _index >> 3)) >> (name ## _index & 7)