24 #define VLC_TYPE int16_t
38 #define init_vlc(vlc, nb_bits, nb_codes, \
39 bits, bits_wrap, bits_size, \
40 codes, codes_wrap, codes_size, \
42 ff_init_vlc_sparse(vlc, nb_bits, nb_codes, \
43 bits, bits_wrap, bits_size, \
44 codes, codes_wrap, codes_size, \
48 const void *
bits,
int bits_wrap,
int bits_size,
49 const void *codes,
int codes_wrap,
int codes_size,
50 const void *symbols,
int symbols_wrap,
int symbols_size,
83 const int8_t *lens,
int lens_wrap,
84 const void *symbols,
int symbols_wrap,
int symbols_size,
91 #define INIT_VLC_INPUT_LE 2
93 #define INIT_VLC_OUTPUT_LE 8
94 #define INIT_VLC_LE (INIT_VLC_INPUT_LE | INIT_VLC_OUTPUT_LE)
95 #define INIT_VLC_USE_NEW_STATIC 4
96 #define INIT_VLC_STATIC_OVERLONG (1 | INIT_VLC_USE_NEW_STATIC)
98 #define INIT_CUSTOM_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \
99 h, i, j, flags, static_size) \
101 static VLC_TYPE table[static_size][2]; \
102 (vlc)->table = table; \
103 (vlc)->table_allocated = static_size; \
104 ff_init_vlc_sparse(vlc, bits, a, b, c, d, e, f, g, h, i, j, \
105 flags | INIT_VLC_USE_NEW_STATIC); \
108 #define INIT_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, h, i, j, static_size) \
109 INIT_CUSTOM_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \
110 h, i, j, 0, static_size)
112 #define INIT_LE_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, h, i, j, static_size) \
113 INIT_CUSTOM_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \
114 h, i, j, INIT_VLC_LE, static_size)
116 #define INIT_CUSTOM_VLC_STATIC(vlc, bits, a, b, c, d, e, f, g, flags, static_size) \
117 INIT_CUSTOM_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \
118 NULL, 0, 0, flags, static_size)
120 #define INIT_VLC_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size) \
121 INIT_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, NULL, 0, 0, static_size)
123 #define INIT_LE_VLC_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size) \
124 INIT_LE_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, NULL, 0, 0, static_size)
126 #define INIT_VLC_STATIC_FROM_LENGTHS(vlc, bits, nb_codes, lens, len_wrap, \
127 symbols, symbols_wrap, symbols_size, \
128 offset, flags, static_size) \
130 static VLC_TYPE table[static_size][2]; \
131 (vlc)->table = table; \
132 (vlc)->table_allocated = static_size; \
133 ff_init_vlc_from_lengths(vlc, bits, nb_codes, lens, len_wrap, \
134 symbols, symbols_wrap, symbols_size, \
135 offset, flags | INIT_VLC_USE_NEW_STATIC, \
#define flags(name, subs,...)
VLC_TYPE(* table)[2]
code, bits
static const uint8_t offset[127][2]
void ff_free_vlc(VLC *vlc)
int ff_init_vlc_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)
int ff_init_vlc_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()