32 for (
int i = 1, j = 0;
i <= 16;
i++) {
33 nb_codes += bits_table[
i];
35 for (; j < nb_codes; j++)
42 const uint8_t *val_table,
int is_ac,
void *logctx)
45 uint16_t huff_sym[256];
48 for (
int i = 0;
i < nb_codes;
i++) {
49 huff_sym[
i] = val_table[
i] + 16 * is_ac;
51 if (is_ac && !val_table[
i])
52 huff_sym[
i] = 16 * 256;
56 huff_sym, 2, 2, 0, 0, logctx);
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
int ff_init_vlc_from_lengths(VLC *vlc_arg, 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_mjpeg_build_vlc(VLC *vlc, const uint8_t *bits_table, const uint8_t *val_table, int is_ac, void *logctx)
static int build_huffman_codes(uint8_t *huff_size, const uint8_t *bits_table)