Go to the documentation of this file.
27 #define VLC_MULTI_MAX_SYMBOLS 6
70 #define vlc_init(vlc, nb_bits, nb_codes, \
71 bits, bits_wrap, bits_size, \
72 codes, codes_wrap, codes_size, \
74 ff_vlc_init_sparse(vlc, nb_bits, nb_codes, \
75 bits, bits_wrap, bits_size, \
76 codes, codes_wrap, codes_size, \
110 const void *codes,
int codes_wrap,
int codes_size,
111 const void *symbols,
int symbols_wrap,
int symbols_size,
144 const int8_t *lens,
int lens_wrap,
145 const void *symbols,
int symbols_wrap,
int symbols_size,
182 int nb_codes,
const int8_t *lens,
int lens_wrap,
183 const void *symbols,
int symbols_wrap,
int symbols_size,
190 #define VLC_INIT_USE_STATIC 1
191 #define VLC_INIT_STATIC_OVERLONG (2 | VLC_INIT_USE_STATIC)
194 #define VLC_INIT_INPUT_LE 4
196 #define VLC_INIT_OUTPUT_LE 8
197 #define VLC_INIT_LE (VLC_INIT_INPUT_LE | VLC_INIT_OUTPUT_LE)
225 #define VLC_INIT_STATE(_table) { .table = (_table), .size = FF_ARRAY_ELEMS(_table) }
228 int nb_bits,
int nb_codes,
229 const int8_t *lens,
int lens_wrap,
230 const void *symbols,
int symbols_wrap,
int symbols_size,
234 int nb_bits,
int nb_codes,
235 const int8_t *lens,
int lens_wrap,
236 const void *symbols,
int symbols_wrap,
int symbols_size,
240 int nb_bits,
int nb_codes,
242 const void *codes,
int codes_wrap,
int codes_size,
243 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,
250 const void *symbols,
int symbols_wrap,
int symbols_size,
255 int nb_bits,
int nb_codes,
257 const void *codes,
int codes_wrap,
int codes_size,
262 codes, codes_wrap, codes_size,
266 #define VLC_INIT_STATIC_SPARSE_TABLE(vlc_table, nb_bits, nb_codes, \
267 bits, bits_wrap, bits_size, \
268 codes, codes_wrap, codes_size, \
269 symbols, symbols_wrap, symbols_size, \
271 ff_vlc_init_table_sparse(vlc_table, FF_ARRAY_ELEMS(vlc_table), \
272 (nb_bits), (nb_codes), \
273 (bits), (bits_wrap), (bits_size), \
274 (codes), (codes_wrap), (codes_size), \
275 (symbols), (symbols_wrap), (symbols_size), \
278 #define VLC_INIT_STATIC_TABLE(vlc_table, nb_bits, nb_codes, \
279 bits, bits_wrap, bits_size, \
280 codes, codes_wrap, codes_size, \
282 ff_vlc_init_table_sparse(vlc_table, FF_ARRAY_ELEMS(vlc_table), \
283 (nb_bits), (nb_codes), \
284 (bits), (bits_wrap), (bits_size), \
285 (codes), (codes_wrap), (codes_size), \
288 #define VLC_INIT_STATIC_TABLE_FROM_LENGTHS(vlc_table, nb_bits, nb_codes, \
290 syms, syms_wrap, syms_size, \
292 ff_vlc_init_table_from_lengths(vlc_table, FF_ARRAY_ELEMS(vlc_table), \
293 (nb_bits), (nb_codes), \
294 (lens), (lens_wrap), \
295 (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]