Go to the documentation of this file.
27 #define VLC_MULTI_MAX_SYMBOLS 6
59 #define vlc_init(vlc, nb_bits, nb_codes, \
60 bits, bits_wrap, bits_size, \
61 codes, codes_wrap, codes_size, \
63 ff_vlc_init_sparse(vlc, nb_bits, nb_codes, \
64 bits, bits_wrap, bits_size, \
65 codes, codes_wrap, codes_size, \
99 const void *codes,
int codes_wrap,
int codes_size,
100 const void *symbols,
int symbols_wrap,
int symbols_size,
133 const int8_t *lens,
int lens_wrap,
134 const void *symbols,
int symbols_wrap,
int symbols_size,
171 int nb_codes,
const int8_t *lens,
int lens_wrap,
172 const void *symbols,
int symbols_wrap,
int symbols_size,
179 #define VLC_INIT_USE_STATIC 1
180 #define VLC_INIT_STATIC_OVERLONG (2 | VLC_INIT_USE_STATIC)
183 #define VLC_INIT_INPUT_LE 4
185 #define VLC_INIT_OUTPUT_LE 8
186 #define VLC_INIT_LE (VLC_INIT_INPUT_LE | VLC_INIT_OUTPUT_LE)
214 #define VLC_INIT_STATE(_table) { .table = (_table), .size = FF_ARRAY_ELEMS(_table) }
217 int nb_bits,
int nb_codes,
218 const int8_t *lens,
int lens_wrap,
219 const void *symbols,
int symbols_wrap,
int symbols_size,
223 int nb_bits,
int nb_codes,
224 const int8_t *lens,
int lens_wrap,
225 const void *symbols,
int symbols_wrap,
int symbols_size,
229 int nb_bits,
int nb_codes,
231 const void *codes,
int codes_wrap,
int codes_size,
232 const void *symbols,
int symbols_wrap,
int symbols_size,
236 int nb_bits,
int nb_codes,
238 const void *codes,
int codes_wrap,
int codes_size,
239 const void *symbols,
int symbols_wrap,
int symbols_size,
244 int nb_bits,
int nb_codes,
246 const void *codes,
int codes_wrap,
int codes_size,
251 codes, codes_wrap, codes_size,
255 #define VLC_INIT_STATIC_SPARSE_TABLE(vlc_table, nb_bits, nb_codes, \
256 bits, bits_wrap, bits_size, \
257 codes, codes_wrap, codes_size, \
258 symbols, symbols_wrap, symbols_size, \
260 ff_vlc_init_table_sparse(vlc_table, FF_ARRAY_ELEMS(vlc_table), \
261 (nb_bits), (nb_codes), \
262 (bits), (bits_wrap), (bits_size), \
263 (codes), (codes_wrap), (codes_size), \
264 (symbols), (symbols_wrap), (symbols_size), \
267 #define VLC_INIT_STATIC_TABLE(vlc_table, nb_bits, nb_codes, \
268 bits, bits_wrap, bits_size, \
269 codes, codes_wrap, codes_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), \
277 #define VLC_INIT_STATIC_TABLE_FROM_LENGTHS(vlc_table, nb_bits, nb_codes, \
279 syms, syms_wrap, syms_size, \
281 ff_vlc_init_table_from_lengths(vlc_table, FF_ARRAY_ELEMS(vlc_table), \
282 (nb_bits), (nb_codes), \
283 (lens), (lens_wrap), \
284 (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)
uint8_t val[VLC_MULTI_MAX_SYMBOLS]
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)
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