Go to the documentation of this file.
27 #define VLC_MULTI_MAX_SYMBOLS 6
62 #define vlc_init(vlc, nb_bits, nb_codes, \
63 bits, bits_wrap, bits_size, \
64 codes, codes_wrap, codes_size, \
66 ff_vlc_init_sparse(vlc, nb_bits, nb_codes, \
67 bits, bits_wrap, bits_size, \
68 codes, codes_wrap, codes_size, \
102 const void *codes,
int codes_wrap,
int codes_size,
103 const void *symbols,
int symbols_wrap,
int symbols_size,
136 const int8_t *lens,
int lens_wrap,
137 const void *symbols,
int symbols_wrap,
int symbols_size,
174 int nb_codes,
const int8_t *lens,
int lens_wrap,
175 const void *symbols,
int symbols_wrap,
int symbols_size,
182 #define VLC_INIT_USE_STATIC 1
183 #define VLC_INIT_STATIC_OVERLONG (2 | VLC_INIT_USE_STATIC)
186 #define VLC_INIT_INPUT_LE 4
188 #define VLC_INIT_OUTPUT_LE 8
189 #define VLC_INIT_LE (VLC_INIT_INPUT_LE | VLC_INIT_OUTPUT_LE)
217 #define VLC_INIT_STATE(_table) { .table = (_table), .size = FF_ARRAY_ELEMS(_table) }
220 int nb_bits,
int nb_codes,
221 const int8_t *lens,
int lens_wrap,
222 const void *symbols,
int symbols_wrap,
int symbols_size,
226 int nb_bits,
int nb_codes,
227 const int8_t *lens,
int lens_wrap,
228 const void *symbols,
int symbols_wrap,
int symbols_size,
232 int nb_bits,
int nb_codes,
234 const void *codes,
int codes_wrap,
int codes_size,
235 const void *symbols,
int symbols_wrap,
int symbols_size,
239 int nb_bits,
int nb_codes,
241 const void *codes,
int codes_wrap,
int codes_size,
242 const void *symbols,
int symbols_wrap,
int symbols_size,
247 int nb_bits,
int nb_codes,
249 const void *codes,
int codes_wrap,
int codes_size,
254 codes, codes_wrap, codes_size,
258 #define VLC_INIT_STATIC_SPARSE_TABLE(vlc_table, nb_bits, nb_codes, \
259 bits, bits_wrap, bits_size, \
260 codes, codes_wrap, codes_size, \
261 symbols, symbols_wrap, symbols_size, \
263 ff_vlc_init_table_sparse(vlc_table, FF_ARRAY_ELEMS(vlc_table), \
264 (nb_bits), (nb_codes), \
265 (bits), (bits_wrap), (bits_size), \
266 (codes), (codes_wrap), (codes_size), \
267 (symbols), (symbols_wrap), (symbols_size), \
270 #define VLC_INIT_STATIC_TABLE(vlc_table, nb_bits, nb_codes, \
271 bits, bits_wrap, bits_size, \
272 codes, codes_wrap, codes_size, \
274 ff_vlc_init_table_sparse(vlc_table, FF_ARRAY_ELEMS(vlc_table), \
275 (nb_bits), (nb_codes), \
276 (bits), (bits_wrap), (bits_size), \
277 (codes), (codes_wrap), (codes_size), \
280 #define VLC_INIT_STATIC_TABLE_FROM_LENGTHS(vlc_table, nb_bits, nb_codes, \
282 syms, syms_wrap, syms_size, \
284 ff_vlc_init_table_from_lengths(vlc_table, FF_ARRAY_ELEMS(vlc_table), \
285 (nb_bits), (nb_codes), \
286 (lens), (lens_wrap), \
287 (syms), (syms_wrap), (syms_size), \
VLCElem * table
points to where the next VLC table will be placed
static const uint16_t table[]
void ff_vlc_free_multi(VLC_MULTI *vlc)
For static VLCs, the number of bits can often be hardcoded at each get_vlc2() callsite.
void ff_vlc_free(VLC *vlc)
int ff_vlc_init_from_lengths(VLC *vlc, int nb_bits, int nb_codes, const int8_t *lens, int lens_wrap, const void *symbols, int symbols_wrap, int symbols_size, int offset, int flags, void *logctx)
Build VLC decoding tables suitable for use with get_vlc2()
int ff_vlc_init_multi_from_lengths(VLC *vlc, VLC_MULTI *multi, int nb_bits, int nb_elems, int nb_codes, const int8_t *lens, int lens_wrap, const void *symbols, int symbols_wrap, int symbols_size, int offset, int flags, void *logctx)
Build VLC decoding tables suitable for use with get_vlc_multi()
const VLCElem * ff_vlc_init_tables_from_lengths(VLCInitState *state, int nb_bits, int nb_codes, const int8_t *lens, int lens_wrap, const void *symbols, int symbols_wrap, int symbols_size, int offset, int flags)
#define VLC_MULTI_MAX_SYMBOLS
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
void ff_vlc_init_table_from_lengths(VLCElem table[], int table_size, int nb_bits, int nb_codes, const int8_t *lens, int lens_wrap, const void *symbols, int symbols_wrap, int symbols_size, int offset, int flags)
uint8_t val8[VLC_MULTI_MAX_SYMBOLS]
const VLCElem * ff_vlc_init_tables_sparse(VLCInitState *state, int nb_bits, int nb_codes, const void *bits, int bits_wrap, int bits_size, const void *codes, int codes_wrap, int codes_size, const void *symbols, int symbols_wrap, int symbols_size, int flags)
static const VLCElem * ff_vlc_init_tables(VLCInitState *state, int nb_bits, int nb_codes, const void *bits, int bits_wrap, int bits_size, const void *codes, int codes_wrap, int codes_size, int flags)
int ff_vlc_init_sparse(VLC *vlc, int nb_bits, int nb_codes, const void *bits, int bits_wrap, int bits_size, const void *codes, int codes_wrap, int codes_size, const void *symbols, int symbols_wrap, int symbols_size, int flags)
Build VLC decoding tables suitable for use with get_vlc2().
void ff_vlc_init_table_sparse(VLCElem table[], int table_size, int nb_bits, int nb_codes, const void *bits, int bits_wrap, int bits_size, const void *codes, int codes_wrap, int codes_size, const void *symbols, int symbols_wrap, int symbols_size, int flags)
#define flags(name, subs,...)
unsigned size
remaining number of elements in table
uint16_t val16[VLC_MULTI_MAX_SYMBOLS/2]