History

avcodec/vlc: Use proper namespace

Therefore use a proper prefix for this API, e.g. ff_init_vlc_sparse -> ff_vlc_init_sparse ff_free_vlc -> ff_vlc_free INIT_VLC_LE -> VLC_INIT_LE INIT_VLC_USE_NEW_STATIC -> VLC_INIT_USE_STATIC (The ancient INIT_VLC_USE_STATIC has been removed in 595324e143b57a52e2329eb47b84395c70f93087, so that the NEW has been dropped.) Finally, reorder the flags and change their values accordingly.

Andreas Rheinhardt committed 3 years ago

Commit 9cdf82c1 parent 95e876f87 files · +412 −410Browse files

Unified · Split

87 files
  1. libavcodec/4xm.c +5 −5
  2. libavcodec/aacdec_template.c +3 −3
  3. libavcodec/aacps_common.c +1 −1
  4. libavcodec/aacsbr.h +1 −1
  5. libavcodec/agm.c +4 −4
  6. libavcodec/asvdec.c +5 −5
  7. libavcodec/atrac3.c +2 −2
  8. libavcodec/atrac3plus.c +2 −2
  9. libavcodec/atrac9dec.c +2 −2
  10. libavcodec/bink.c +2 −2
  11. libavcodec/bitstream_template.h +1 −1
  12. libavcodec/cfhddata.c +2 −2
  13. libavcodec/clearvideo.c +6 −6
  14. libavcodec/cllc.c +7 −7
  15. libavcodec/cook.c +4 −4
  16. libavcodec/dcahuff.c +4 −4
  17. libavcodec/dnxhddec.c +10 −10
  18. libavcodec/dvdec.c +2 −2
  19. libavcodec/exr.c +3 −3
  20. libavcodec/faxcompr.c +3 −3
  21. libavcodec/fraps.c +2 −2
  22. libavcodec/g2meet.c +2 −2
  23. libavcodec/get_bits.h +1 −1
  24. libavcodec/h261dec.c +4 −4
  25. libavcodec/h264_cavlc.c +16 −16
  26. libavcodec/hq_hqa.c +2 −2
  27. libavcodec/hq_hqadata.c +2 −2
  28. libavcodec/hqx.c +2 −2
  29. libavcodec/hqxvlc.c +2 −2
  30. libavcodec/huffman.c +1 −1
  31. libavcodec/huffyuvdec.c +9 −9
  32. libavcodec/imc.c +2 −2
  33. libavcodec/imm4.c +4 −4
  34. libavcodec/indeo2.c +2 −2
  35. libavcodec/intrax8.c +2 −2
  36. libavcodec/ituh263dec.c +7 −7
  37. libavcodec/ivi.c +6 −6
  38. libavcodec/jpegxl_parser.c +8 −8
  39. libavcodec/magicyuv.c +5 −5
  40. libavcodec/mimic.c +1 −1
  41. libavcodec/mjpegdec.c +4 −4
  42. libavcodec/mjpegdec_common.c +1 −1
  43. libavcodec/mlpdec.c +2 −2
  44. libavcodec/mobiclip.c +4 −4
  45. libavcodec/motionpixels.c +2 −2
  46. libavcodec/mpc7.c +5 −5
  47. libavcodec/mpc8.c +2 −2
  48. libavcodec/mpeg12.c +8 −8
  49. libavcodec/mpeg4videodec.c +9 −9
  50. libavcodec/mpegaudiodec_common.c +4 −4
  51. libavcodec/msmpeg4_vc1_data.c +5 −5
  52. libavcodec/msmpeg4dec.c +11 −11
  53. libavcodec/mss2.c +2 −2
  54. libavcodec/mss4.c +2 −2
  55. libavcodec/mv30.c +1 −1
  56. libavcodec/mvha.c +3 −3
  57. libavcodec/on2avc.c +4 −4
  58. libavcodec/photocd.c +3 −3
  59. libavcodec/qdm2_tablegen.h +2 −2
  60. libavcodec/qdmc.c +2 −2
  61. libavcodec/ralf.c +7 −7
  62. libavcodec/rl.c +3 −1
  63. libavcodec/rl.h +1 −1
  64. libavcodec/rv10.c +2 −2
  65. libavcodec/rv34.c +2 −2
  66. libavcodec/rv40.c +4 −4
  67. libavcodec/sheervideo.c +4 −4
  68. libavcodec/smacker.c +6 −6
  69. libavcodec/speedhqdec.c +7 −7
  70. libavcodec/svq1dec.c +8 −8
  71. libavcodec/truemotion2.c +2 −2
  72. libavcodec/tscc2.c +2 −2
  73. libavcodec/utvideodec.c +9 −9
  74. libavcodec/vc1dec.c +33 −33
  75. libavcodec/vlc.c +16 −16
  76. libavcodec/vlc.h +35 −35
  77. libavcodec/vorbisdec.c +3 −3
  78. libavcodec/vp3.c +15 −15
  79. libavcodec/vp6.c +4 −4
  80. libavcodec/vqcdec.c +1 −1
  81. libavcodec/webp.c +4 −4
  82. libavcodec/wma.c +4 −4
  83. libavcodec/wmadec.c +2 −2
  84. libavcodec/wmaprodec.c +7 −7
  85. libavcodec/wmavoice.c +1 −1
  86. libavcodec/wnv1.c +2 −2
  87. libavcodec/ylc.c +3 −3
libavcodec/4xm.c+5−5
@@ -257,10 +257,10 @@ static av_cold void init_vlcs(void) · 256 unmodified lines
257257 for (j = 0; j < 4; j++) {
258258 block_type_vlc[i][j].table = table[i][j];
259259 block_type_vlc[i][j].table_allocated = 32;
260− init_vlc(&block_type_vlc[i][j], BLOCK_TYPE_VLC_BITS, 7,
260+ vlc_init(&block_type_vlc[i][j], BLOCK_TYPE_VLC_BITS, 7,
261261 &block_type_tab[i][j][0][1], 2, 1,
262262 &block_type_tab[i][j][0][0], 2, 1,
263− INIT_VLC_USE_NEW_STATIC);
263+ VLC_INIT_USE_STATIC);
264264 }
265265 }
266266 }
@@ -706,8 +706,8 @@ static const uint8_t *read_huffman_tables(FourXContext *f, · 439 unmodified lines
706706 len_tab[j] = len;
707707 }
708708
709− ff_free_vlc(&f->pre_vlc);
710− if (init_vlc(&f->pre_vlc, ACDC_VLC_BITS, 257, len_tab, 1, 1,
709+ ff_vlc_free(&f->pre_vlc);
710+ if (vlc_init(&f->pre_vlc, ACDC_VLC_BITS, 257, len_tab, 1, 1,
711711 bits_tab, 4, 4, 0))
712712 return NULL;
713713
@@ -985,7 +985,7 @@ static av_cold int decode_end(AVCodecContext *avctx) · 271 unmodified lines
985985 av_freep(&f->cfrm[i].data);
986986 f->cfrm[i].allocated_size = 0;
987987 }
988− ff_free_vlc(&f->pre_vlc);
988+ ff_vlc_free(&f->pre_vlc);
989989
990990 return 0;
991991 }
libavcodec/aacdec_template.c+3−3
@@ -1133,14 +1133,14 @@ static av_cold void aac_static_table_init(void) · 1132 unmodified lines
11331133 for (unsigned i = 0, offset = 0; i < 11; i++) {
11341134 vlc_spectral[i].table = &vlc_buf[offset];
11351135 vlc_spectral[i].table_allocated = FF_ARRAY_ELEMS(vlc_buf) - offset;
1136− ff_init_vlc_sparse(&vlc_spectral[i], 8, ff_aac_spectral_sizes[i],
1136+ ff_vlc_init_sparse(&vlc_spectral[i], 8, ff_aac_spectral_sizes[i],
11371137 ff_aac_spectral_bits[i], sizeof(ff_aac_spectral_bits[i][0]),
11381138 sizeof(ff_aac_spectral_bits[i][0]),
11391139 ff_aac_spectral_codes[i], sizeof(ff_aac_spectral_codes[i][0]),
11401140 sizeof(ff_aac_spectral_codes[i][0]),
11411141 ff_aac_codebook_vector_idx[i], sizeof(ff_aac_codebook_vector_idx[i][0]),
11421142 sizeof(ff_aac_codebook_vector_idx[i][0]),
1143− INIT_VLC_STATIC_OVERLONG);
1143+ VLC_INIT_STATIC_OVERLONG);
11441144 offset += vlc_spectral[i].table_size;
11451145 }
11461146
@@ -1148,7 +1148,7 @@ static av_cold void aac_static_table_init(void) · 1 unmodified line
11481148
11491149 ff_aac_tableinit();
11501150
1151− INIT_VLC_STATIC(&vlc_scalefactors, 7,
1151+ VLC_INIT_STATIC(&vlc_scalefactors, 7,
11521152 FF_ARRAY_ELEMS(ff_aac_scalefactor_code),
11531153 ff_aac_scalefactor_bits,
11541154 sizeof(ff_aac_scalefactor_bits[0]),
libavcodec/aacps_common.c+1−1
@@ -290,7 +290,7 @@ err: · 289 unmodified lines
290290 }
291291
292292 #define PS_INIT_VLC_STATIC(num, nb_bits, size) \
293− INIT_VLC_STATIC(&vlc_ps[num], nb_bits, ps_tmp[num].table_size / ps_tmp[num].elem_size, \
293+ VLC_INIT_STATIC(&vlc_ps[num], nb_bits, ps_tmp[num].table_size / ps_tmp[num].elem_size, \
294294 ps_tmp[num].ps_bits, 1, 1, \
295295 ps_tmp[num].ps_codes, ps_tmp[num].elem_size, ps_tmp[num].elem_size, \
296296 size);
libavcodec/aacsbr.h+1−1
@@ -70,7 +70,7 @@ static const int8_t vlc_sbr_lav[10] = · 69 unmodified lines
7070 { 60, 60, 24, 24, 31, 31, 12, 12, 31, 12 };
7171
7272 #define SBR_INIT_VLC_STATIC(num, size) \
73− INIT_VLC_STATIC(&vlc_sbr[num], 9, sbr_tmp[num].table_size / sbr_tmp[num].elem_size, \
73+ VLC_INIT_STATIC(&vlc_sbr[num], 9, sbr_tmp[num].table_size / sbr_tmp[num].elem_size, \
7474 sbr_tmp[num].sbr_bits , 1, 1, \
7575 sbr_tmp[num].sbr_codes, sbr_tmp[num].elem_size, sbr_tmp[num].elem_size, \
7676 size)
libavcodec/agm.c+4−4
@@ -1015,12 +1015,12 @@ static int build_huff(const uint8_t *bitlen, VLC *vlc) · 1014 unmodified lines
10151015 }
10161016 }
10171017
1018− ff_free_vlc(vlc);
1019− return ff_init_vlc_sparse(vlc, 13, nb_codes,
1018+ ff_vlc_free(vlc);
1019+ return ff_vlc_init_sparse(vlc, 13, nb_codes,
10201020 bits, 1, 1,
10211021 codes, 4, 4,
10221022 symbols, 1, 1,
1023− INIT_VLC_LE);
1023+ VLC_INIT_LE);
10241024 }
10251025
10261026 static int decode_huffman2(AVCodecContext *avctx, int header, int size)
@@ -1255,7 +1255,7 @@ static av_cold int decode_close(AVCodecContext *avctx) · 228 unmodified lines
12551255 {
12561256 AGMContext *s = avctx->priv_data;
12571257
1258− ff_free_vlc(&s->vlc);
1258+ ff_vlc_free(&s->vlc);
12591259 av_frame_free(&s->prev_frame);
12601260 av_freep(&s->mvectors);
12611261 s->mvectors_size = 0;
libavcodec/asvdec.c+5−5
@@ -67,19 +67,19 @@ typedef struct ASVDecContext { · 66 unmodified lines
6767
6868 static av_cold void init_vlcs(void)
6969 {
70− INIT_VLC_STATIC(&ccp_vlc, CCP_VLC_BITS, 17,
70+ VLC_INIT_STATIC(&ccp_vlc, CCP_VLC_BITS, 17,
7171 &ff_asv_ccp_tab[0][1], 2, 1,
7272 &ff_asv_ccp_tab[0][0], 2, 1, 32);
73− INIT_LE_VLC_STATIC(&dc_ccp_vlc, DC_CCP_VLC_BITS, 8,
73+ VLC_INIT_LE_STATIC(&dc_ccp_vlc, DC_CCP_VLC_BITS, 8,
7474 &ff_asv_dc_ccp_tab[0][1], 2, 1,
7575 &ff_asv_dc_ccp_tab[0][0], 2, 1, 16);
76− INIT_LE_VLC_STATIC(&ac_ccp_vlc, AC_CCP_VLC_BITS, 16,
76+ VLC_INIT_LE_STATIC(&ac_ccp_vlc, AC_CCP_VLC_BITS, 16,
7777 &ff_asv_ac_ccp_tab[0][1], 2, 1,
7878 &ff_asv_ac_ccp_tab[0][0], 2, 1, 64);
79− INIT_VLC_STATIC(&level_vlc, ASV1_LEVEL_VLC_BITS, 7,
79+ VLC_INIT_STATIC(&level_vlc, ASV1_LEVEL_VLC_BITS, 7,
8080 &ff_asv_level_tab[0][1], 2, 1,
8181 &ff_asv_level_tab[0][0], 2, 1, 16);
82− INIT_LE_VLC_STATIC(&asv2_level_vlc, ASV2_LEVEL_VLC_BITS, 63,
82+ VLC_INIT_LE_STATIC(&asv2_level_vlc, ASV2_LEVEL_VLC_BITS, 63,
8383 &ff_asv2_level_tab[0][1], 4, 2,
8484 &ff_asv2_level_tab[0][0], 4, 2, 1024);
8585 }
libavcodec/atrac3.c+2−2
@@ -863,10 +863,10 @@ static av_cold void atrac3_init_static_data(void) · 862 unmodified lines
863863 for (i = 0; i < 7; i++) {
864864 spectral_coeff_tab[i].table = table;
865865 spectral_coeff_tab[i].table_allocated = 256;
866− ff_init_vlc_from_lengths(&spectral_coeff_tab[i], ATRAC3_VLC_BITS, huff_tab_sizes[i],
866+ ff_vlc_init_from_lengths(&spectral_coeff_tab[i], ATRAC3_VLC_BITS, huff_tab_sizes[i],
867867 &hufftabs[0][1], 2,
868868 &hufftabs[0][0], 2, 1,
869− -31, INIT_VLC_USE_NEW_STATIC, NULL);
869+ -31, VLC_INIT_USE_STATIC, NULL);
870870 hufftabs += huff_tab_sizes[i];
871871 table += 256;
872872 }
libavcodec/atrac3plus.c+2−2
@@ -66,8 +66,8 @@ static av_cold void build_canonical_huff(const uint8_t *cb, const uint8_t **xlat · 65 unmodified lines
6666 out_vlc->table = &tables_data[*tab_offset];
6767 out_vlc->table_allocated = 1 << max_len;
6868
69− ff_init_vlc_from_lengths(out_vlc, max_len, index, bits, 1,
70− *xlat, 1, 1, 0, INIT_VLC_USE_NEW_STATIC, NULL);
69+ ff_vlc_init_from_lengths(out_vlc, max_len, index, bits, 1,
70+ *xlat, 1, 1, 0, VLC_INIT_USE_STATIC, NULL);
7171
7272 *tab_offset += 1 << max_len;
7373 *xlat += index;
libavcodec/atrac9dec.c+2−2
@@ -849,9 +849,9 @@ static av_cold void atrac9_init_vlc(VLC *vlc, int nb_bits, int nb_codes, · 848 unmodified lines
849849
850850 vlc->table = &vlc_buf[*buf_offset];
851851 vlc->table_allocated = FF_ARRAY_ELEMS(vlc_buf) - *buf_offset;
852− ff_init_vlc_from_lengths(vlc, nb_bits, nb_codes,
852+ ff_vlc_init_from_lengths(vlc, nb_bits, nb_codes,
853853 &(*tab)[0][1], 2, &(*tab)[0][0], 2, 1,
854− offset, INIT_VLC_STATIC_OVERLONG, NULL);
854+ offset, VLC_INIT_STATIC_OVERLONG, NULL);
855855 *buf_offset += vlc->table_size;
856856 *tab += nb_codes;
857857 }
libavcodec/bink.c+2−2
@@ -1318,9 +1318,9 @@ static av_cold void bink_init_vlcs(void) · 1317 unmodified lines
13181318 bink_trees[i].table = table + offset;
13191319 bink_trees[i].table_allocated = 1 << maxbits;
13201320 offset += bink_trees[i].table_allocated;
1321− init_vlc(&bink_trees[i], maxbits, 16,
1321+ vlc_init(&bink_trees[i], maxbits, 16,
13221322 bink_tree_lens[i], 1, 1,
1323− bink_tree_bits[i], 1, 1, INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE);
1323+ bink_tree_bits[i], 1, 1, VLC_INIT_USE_STATIC | VLC_INIT_LE);
13241324 }
13251325 }
13261326
libavcodec/bitstream_template.h+1−1
@@ -491,7 +491,7 @@ static inline int BS_FUNC(priv_set_idx)(BSCTX *bc, int code, int *n, · 490 unmodified lines
491491 /**
492492 * Parse a vlc code.
493493 * @param bits is the number of bits which will be read at once, must be
494− * identical to nb_bits in init_vlc()
494+ * identical to nb_bits in vlc_init()
495495 * @param max_depth is the number of times bits bits must be read to completely
496496 * read the longest vlc code
497497 * = (max_vlc_length + bits - 1) / bits
libavcodec/cfhddata.c+2−2
@@ -150,7 +150,7 @@ static av_cold int cfhd_init_vlc(CFHD_RL_VLC_ELEM out[], unsigned out_size, · 149 unmodified lines
150150 }
151151 }
152152
153− ret = ff_init_vlc_from_lengths(&vlc, VLC_BITS, j,
153+ ret = ff_vlc_init_from_lengths(&vlc, VLC_BITS, j,
154154 &tmp[0].len, sizeof(tmp[0]),
155155 NULL, 0, 0, 0, 0, logctx);
156156 if (ret < 0)
@@ -173,7 +173,7 @@ static av_cold int cfhd_init_vlc(CFHD_RL_VLC_ELEM out[], unsigned out_size, · 16 unmodified lines
173173 out[i].level = level;
174174 out[i].run = run;
175175 }
176− ff_free_vlc(&vlc);
176+ ff_vlc_free(&vlc);
177177
178178 return 0;
179179 }
libavcodec/clearvideo.c+6−6
@@ -637,8 +637,8 @@ static av_cold void build_vlc(VLC *vlc, const uint8_t counts[16], · 636 unmodified lines
637637 }
638638 vlc->table = &vlc_buf[*offset];
639639 vlc->table_allocated = FF_ARRAY_ELEMS(vlc_buf) - *offset;
640− ff_init_vlc_from_lengths(vlc, CLV_VLC_BITS, num, lens, 1,
641− *syms, 2, 2, 0, INIT_VLC_STATIC_OVERLONG, NULL);
640+ ff_vlc_init_from_lengths(vlc, CLV_VLC_BITS, num, lens, 1,
641+ *syms, 2, 2, 0, VLC_INIT_STATIC_OVERLONG, NULL);
642642 *syms += num;
643643 *offset += vlc->table_size;
644644 }
@@ -647,10 +647,10 @@ static av_cold void clv_init_static(void) · 2 unmodified lines
647647 {
648648 const uint16_t *mv_syms = clv_mv_syms, *bias_syms = clv_bias_syms;
649649
650− INIT_VLC_STATIC_FROM_LENGTHS(&dc_vlc, CLV_VLC_BITS, NUM_DC_CODES,
650+ VLC_INIT_STATIC_FROM_LENGTHS(&dc_vlc, CLV_VLC_BITS, NUM_DC_CODES,
651651 clv_dc_lens, 1,
652652 clv_dc_syms, 1, 1, -63, 0, 1104);
653− INIT_VLC_STATIC_FROM_LENGTHS(&ac_vlc, CLV_VLC_BITS, NUM_AC_CODES,
653+ VLC_INIT_STATIC_FROM_LENGTHS(&ac_vlc, CLV_VLC_BITS, NUM_AC_CODES,
654654 clv_ac_bits, 1,
655655 clv_ac_syms, 2, 2, 0, 0, 554);
656656 for (unsigned i = 0, j = 0, k = 0, offset = 0;; i++) {
@@ -663,10 +663,10 @@ static av_cold void clv_init_static(void) · 6 unmodified lines
663663 if (0x1B7 & (1 << i)) {
664664 lev[i].flags_cb.table = &vlc_buf[offset];
665665 lev[i].flags_cb.table_allocated = FF_ARRAY_ELEMS(vlc_buf) - offset;
666− ff_init_vlc_from_lengths(&lev[i].flags_cb, CLV_VLC_BITS, 16,
666+ ff_vlc_init_from_lengths(&lev[i].flags_cb, CLV_VLC_BITS, 16,
667667 clv_flags_bits[j], 1,
668668 clv_flags_syms[j], 1, 1,
669− 0, INIT_VLC_STATIC_OVERLONG, NULL);
669+ 0, VLC_INIT_STATIC_OVERLONG, NULL);
670670 offset += lev[i].flags_cb.table_size;
671671
672672 build_vlc(&lev[i + 1].bias_cb, clv_bias_len_counts[j],
libavcodec/cllc.c+7−7
@@ -77,7 +77,7 @@ static int read_code_table(CLLCContext *ctx, GetBitContext *gb, VLC *vlc) · 76 unmodified lines
7777 }
7878 }
7979
80− return ff_init_vlc_from_lengths(vlc, VLC_BITS, count, bits, 1,
80+ return ff_vlc_init_from_lengths(vlc, VLC_BITS, count, bits, 1,
8181 symbols, 1, 1, 0, 0, ctx->avctx);
8282 }
8383
@@ -235,7 +235,7 @@ static int decode_argb_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic) · 151 unmodified lines
235235 ret = read_code_table(ctx, gb, &vlc[i]);
236236 if (ret < 0) {
237237 for (j = 0; j < i; j++)
238− ff_free_vlc(&vlc[j]);
238+ ff_vlc_free(&vlc[j]);
239239
240240 av_log(ctx->avctx, AV_LOG_ERROR,
241241 "Could not read code table %d.\n", i);
@@ -251,7 +251,7 @@ static int decode_argb_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic) · 9 unmodified lines
251251 }
252252
253253 for (i = 0; i < 4; i++)
254− ff_free_vlc(&vlc[i]);
254+ ff_vlc_free(&vlc[i]);
255255
256256 return 0;
257257 }
@@ -278,7 +278,7 @@ static int decode_rgb24_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic) · 20 unmodified lines
278278 ret = read_code_table(ctx, gb, &vlc[i]);
279279 if (ret < 0) {
280280 for (j = 0; j < i; j++)
281− ff_free_vlc(&vlc[j]);
281+ ff_vlc_free(&vlc[j]);
282282
283283 av_log(ctx->avctx, AV_LOG_ERROR,
284284 "Could not read code table %d.\n", i);
@@ -295,7 +295,7 @@ static int decode_rgb24_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic) · 10 unmodified lines
295295 }
296296
297297 for (i = 0; i < 3; i++)
298− ff_free_vlc(&vlc[i]);
298+ ff_vlc_free(&vlc[i]);
299299
300300 return 0;
301301 }
@@ -331,7 +331,7 @@ static int decode_yuv_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic) · 29 unmodified lines
331331 ret = read_code_table(ctx, gb, &vlc[i]);
332332 if (ret < 0) {
333333 for (j = 0; j < i; j++)
334− ff_free_vlc(&vlc[j]);
334+ ff_vlc_free(&vlc[j]);
335335
336336 av_log(ctx->avctx, AV_LOG_ERROR,
337337 "Could not read code table %d.\n", i);
@@ -350,7 +350,7 @@ static int decode_yuv_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic) · 12 unmodified lines
350350 }
351351
352352 for (i = 0; i < 2; i++)
353− ff_free_vlc(&vlc[i]);
353+ ff_vlc_free(&vlc[i]);
354354
355355 return 0;
356356 }
libavcodec/cook.c+4−4
@@ -208,7 +208,7 @@ static av_cold int build_vlc(VLC *vlc, int nb_bits, const uint8_t counts[16], · 207 unmodified lines
208208 for (unsigned count = num + counts[i]; num < count; num++)
209209 lens[num] = i + 1;
210210
211− return ff_init_vlc_from_lengths(vlc, nb_bits, num, lens, 1,
211+ return ff_vlc_init_from_lengths(vlc, nb_bits, num, lens, 1,
212212 syms, symbol_size, symbol_size,
213213 offset, 0, logctx);
214214 }
@@ -341,11 +341,11 @@ static av_cold int cook_decode_close(AVCodecContext *avctx) · 126 unmodified lines
341341
342342 /* Free the VLC tables. */
343343 for (i = 0; i < 13; i++)
344− ff_free_vlc(&q->envelope_quant_index[i]);
344+ ff_vlc_free(&q->envelope_quant_index[i]);
345345 for (i = 0; i < 7; i++)
346− ff_free_vlc(&q->sqvh[i]);
346+ ff_vlc_free(&q->sqvh[i]);
347347 for (i = 0; i < q->num_subpackets; i++)
348− ff_free_vlc(&q->subpacket[i].channel_coupling);
348+ ff_vlc_free(&q->subpacket[i].channel_coupling);
349349
350350 av_log(avctx, AV_LOG_DEBUG, "Memory deallocated.\n");
351351
libavcodec/dcahuff.c+4−4
@@ -796,9 +796,9 @@ av_cold void ff_dca_init_vlcs(void) · 795 unmodified lines
796796 do { \
797797 vlc.table = &dca_table[offset]; \
798798 vlc.table_allocated = FF_ARRAY_ELEMS(dca_table) - offset; \
799− ff_init_vlc_from_lengths(&vlc, nb_bits, nb_codes, &src_table[0][1], 2, \
799+ ff_vlc_init_from_lengths(&vlc, nb_bits, nb_codes, &src_table[0][1], 2, \
800800 &src_table[0][0], 2, 1, entry_offset, \
801− INIT_VLC_STATIC_OVERLONG, NULL); \
801+ VLC_INIT_STATIC_OVERLONG, NULL); \
802802 offset += vlc.table_size; \
803803 src_table += nb_codes; \
804804 } while (0)
@@ -822,9 +822,9 @@ av_cold void ff_dca_init_vlcs(void) · 17 unmodified lines
822822 do { \
823823 vlc.table = &dca_table[offset]; \
824824 vlc.table_allocated = FF_ARRAY_ELEMS(dca_table) - offset; \
825− ff_init_vlc_from_lengths(&vlc, nb_bits, nb_codes, &src_table[0][1], 2, \
825+ ff_vlc_init_from_lengths(&vlc, nb_bits, nb_codes, &src_table[0][1], 2, \
826826 &src_table[0][0], 2, 1, entry_offset, \
827− INIT_VLC_STATIC_OVERLONG | INIT_VLC_LE,\
827+ VLC_INIT_STATIC_OVERLONG | VLC_INIT_LE,\
828828 NULL); \
829829 offset += vlc.table_size; \
830830 src_table += nb_codes; \
libavcodec/dnxhddec.c+10−10
@@ -130,19 +130,19 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, uint32_t cid, int bitdepth) · 129 unmodified lines
130130 ctx->cid_table = cid_table;
131131 av_log(ctx->avctx, AV_LOG_VERBOSE, "Profile cid %"PRIu32".\n", cid);
132132
133− ff_free_vlc(&ctx->ac_vlc);
134− ff_free_vlc(&ctx->dc_vlc);
135− ff_free_vlc(&ctx->run_vlc);
133+ ff_vlc_free(&ctx->ac_vlc);
134+ ff_vlc_free(&ctx->dc_vlc);
135+ ff_vlc_free(&ctx->run_vlc);
136136
137− if ((ret = init_vlc(&ctx->ac_vlc, DNXHD_VLC_BITS, 257,
137+ if ((ret = vlc_init(&ctx->ac_vlc, DNXHD_VLC_BITS, 257,
138138 ctx->cid_table->ac_bits, 1, 1,
139139 ctx->cid_table->ac_codes, 2, 2, 0)) < 0)
140140 goto out;
141− if ((ret = init_vlc(&ctx->dc_vlc, DNXHD_DC_VLC_BITS, bitdepth > 8 ? 14 : 12,
141+ if ((ret = vlc_init(&ctx->dc_vlc, DNXHD_DC_VLC_BITS, bitdepth > 8 ? 14 : 12,
142142 ctx->cid_table->dc_bits, 1, 1,
143143 ctx->cid_table->dc_codes, 1, 1, 0)) < 0)
144144 goto out;
145− if ((ret = init_vlc(&ctx->run_vlc, DNXHD_VLC_BITS, 62,
145+ if ((ret = vlc_init(&ctx->run_vlc, DNXHD_VLC_BITS, 62,
146146 ctx->cid_table->run_bits, 1, 1,
147147 ctx->cid_table->run_codes, 2, 2, 0)) < 0)
148148 goto out;
@@ -152,7 +152,7 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, uint32_t cid, int bitdepth) · 3 unmodified lines
152152 ret = 0;
153153 out:
154154 if (ret < 0)
155− av_log(ctx->avctx, AV_LOG_ERROR, "init_vlc failed\n");
155+ av_log(ctx->avctx, AV_LOG_ERROR, "vlc_init failed\n");
156156 return ret;
157157 }
158158
@@ -716,9 +716,9 @@ static av_cold int dnxhd_decode_close(AVCodecContext *avctx) · 557 unmodified lines
716716 {
717717 DNXHDContext *ctx = avctx->priv_data;
718718
719− ff_free_vlc(&ctx->ac_vlc);
720− ff_free_vlc(&ctx->dc_vlc);
721− ff_free_vlc(&ctx->run_vlc);
719+ ff_vlc_free(&ctx->ac_vlc);
720+ ff_vlc_free(&ctx->dc_vlc);
721+ ff_vlc_free(&ctx->run_vlc);
722722
723723 av_freep(&ctx->rows);
724724
libavcodec/dvdec.c+2−2
@@ -175,9 +175,9 @@ static av_cold void dv_init_static(void) · 174 unmodified lines
175175
176176 /* NOTE: as a trick, we use the fact the no codes are unused
177177 * to accelerate the parsing of partial codes */
178− ff_init_vlc_from_lengths(&dv_vlc, TEX_VLC_BITS, j,
178+ ff_vlc_init_from_lengths(&dv_vlc, TEX_VLC_BITS, j,
179179 &tmp[0].len, sizeof(tmp[0]),
180− NULL, 0, 0, 0, INIT_VLC_USE_NEW_STATIC, NULL);
180+ NULL, 0, 0, 0, VLC_INIT_USE_STATIC, NULL);
181181 av_assert1(dv_vlc.table_size == 1664);
182182
183183 for (int i = 0; i < dv_vlc.table_size; i++) {
libavcodec/exr.c+3−3
@@ -404,8 +404,8 @@ static int huf_build_dec_table(const EXRContext *s, · 403 unmodified lines
404404 td->he[j].code = td->freq[iM] >> 6;
405405 j++;
406406
407− ff_free_vlc(&td->vlc);
408− return ff_init_vlc_sparse(&td->vlc, 12, j,
407+ ff_vlc_free(&td->vlc);
408+ return ff_vlc_init_sparse(&td->vlc, 12, j,
409409 &td->he[0].len, sizeof(td->he[0]), sizeof(td->he[0].len),
410410 &td->he[0].code, sizeof(td->he[0]), sizeof(td->he[0].code),
411411 &td->he[0].sym, sizeof(td->he[0]), sizeof(td->he[0].sym), 0);
@@ -2284,7 +2284,7 @@ static av_cold int decode_end(AVCodecContext *avctx) · 1872 unmodified lines
22842284 av_freep(&td->dc_data);
22852285 av_freep(&td->rle_data);
22862286 av_freep(&td->rle_raw_data);
2287− ff_free_vlc(&td->vlc);
2287+ ff_vlc_free(&td->vlc);
22882288 }
22892289
22902290 av_freep(&s->thread_data);
libavcodec/faxcompr.c+3−3
@@ -108,13 +108,13 @@ static av_cold void ccitt_unpack_init(void) · 107 unmodified lines
108108 ccitt_vlc[1].table = code_table2;
109109 ccitt_vlc[1].table_allocated = 648;
110110 for (i = 0; i < 2; i++) {
111− ff_init_vlc_sparse(&ccitt_vlc[i], 9, CCITT_SYMS,
111+ ff_vlc_init_sparse(&ccitt_vlc[i], 9, CCITT_SYMS,
112112 ccitt_codes_lens[i], 1, 1,
113113 ccitt_codes_bits[i], 1, 1,
114114 ccitt_syms, 2, 2,
115− INIT_VLC_USE_NEW_STATIC);
115+ VLC_INIT_USE_STATIC);
116116 }
117− INIT_VLC_STATIC(&ccitt_group3_2d_vlc, 9, 11,
117+ VLC_INIT_STATIC(&ccitt_group3_2d_vlc, 9, 11,
118118 ccitt_group3_2d_lens, 1, 1,
119119 ccitt_group3_2d_bits, 1, 1, 512);
120120 }
libavcodec/fraps.c+2−2
@@ -123,13 +123,13 @@ static int fraps2_decode_plane(FrapsContext *s, uint8_t *dst, int stride, int w, · 122 unmodified lines
123123 else if (Uoff)
124124 dst[i] += 0x80;
125125 if (get_bits_left(&gb) < 0) {
126− ff_free_vlc(&vlc);
126+ ff_vlc_free(&vlc);
127127 return AVERROR_INVALIDDATA;
128128 }
129129 }
130130 dst += stride;
131131 }
132− ff_free_vlc(&vlc);
132+ ff_vlc_free(&vlc);
133133 return 0;
134134 }
135135
libavcodec/g2meet.c+2−2
@@ -195,8 +195,8 @@ static av_cold void jpg_free_context(JPGContext *ctx) · 194 unmodified lines
195195 int i;
196196
197197 for (i = 0; i < 2; i++) {
198− ff_free_vlc(&ctx->dc_vlc[i]);
199− ff_free_vlc(&ctx->ac_vlc[i]);
198+ ff_vlc_free(&ctx->dc_vlc[i]);
199+ ff_vlc_free(&ctx->ac_vlc[i]);
200200 }
201201
202202 av_freep(&ctx->buf);
libavcodec/get_bits.h+1−1
@@ -643,7 +643,7 @@ static inline const uint8_t *align_get_bits(GetBitContext *s) · 642 unmodified lines
643643 /**
644644 * Parse a vlc code.
645645 * @param bits is the number of bits which will be read at once, must be
646− * identical to nb_bits in init_vlc()
646+ * identical to nb_bits in vlc_init()
647647 * @param max_depth is the number of times bits bits must be read to completely
648648 * read the longest vlc code
649649 * = (max_vlc_length + bits - 1) / bits
libavcodec/h261dec.c+4−4
@@ -64,16 +64,16 @@ typedef struct H261DecContext { · 63 unmodified lines
6464
6565 static av_cold void h261_decode_init_static(void)
6666 {
67− INIT_VLC_STATIC(&h261_mba_vlc, H261_MBA_VLC_BITS, 35,
67+ VLC_INIT_STATIC(&h261_mba_vlc, H261_MBA_VLC_BITS, 35,
6868 ff_h261_mba_bits, 1, 1,
6969 ff_h261_mba_code, 1, 1, 540);
70− INIT_VLC_STATIC(&h261_mtype_vlc, H261_MTYPE_VLC_BITS, 10,
70+ VLC_INIT_STATIC(&h261_mtype_vlc, H261_MTYPE_VLC_BITS, 10,
7171 ff_h261_mtype_bits, 1, 1,
7272 ff_h261_mtype_code, 1, 1, 80);
73− INIT_VLC_STATIC(&h261_mv_vlc, H261_MV_VLC_BITS, 17,
73+ VLC_INIT_STATIC(&h261_mv_vlc, H261_MV_VLC_BITS, 17,
7474 &ff_h261_mv_tab[0][1], 2, 1,
7575 &ff_h261_mv_tab[0][0], 2, 1, 144);
76− INIT_VLC_STATIC(&h261_cbp_vlc, H261_CBP_VLC_BITS, 63,
76+ VLC_INIT_STATIC(&h261_cbp_vlc, H261_CBP_VLC_BITS, 63,
7777 &ff_h261_cbp_tab[0][1], 2, 1,
7878 &ff_h261_cbp_tab[0][0], 2, 1, 512);
7979 INIT_FIRST_VLC_RL(ff_h261_rl_tcoeff, 552);
libavcodec/h264_cavlc.c+16−16
@@ -328,26 +328,26 @@ av_cold void ff_h264_decode_init_vlc(void) · 327 unmodified lines
328328
329329 chroma_dc_coeff_token_vlc.table = chroma_dc_coeff_token_vlc_table;
330330 chroma_dc_coeff_token_vlc.table_allocated = chroma_dc_coeff_token_vlc_table_size;
331− init_vlc(&chroma_dc_coeff_token_vlc, CHROMA_DC_COEFF_TOKEN_VLC_BITS, 4*5,
331+ vlc_init(&chroma_dc_coeff_token_vlc, CHROMA_DC_COEFF_TOKEN_VLC_BITS, 4*5,
332332 &chroma_dc_coeff_token_len [0], 1, 1,
333333 &chroma_dc_coeff_token_bits[0], 1, 1,
334− INIT_VLC_USE_NEW_STATIC);
334+ VLC_INIT_USE_STATIC);
335335
336336 chroma422_dc_coeff_token_vlc.table = chroma422_dc_coeff_token_vlc_table;
337337 chroma422_dc_coeff_token_vlc.table_allocated = chroma422_dc_coeff_token_vlc_table_size;
338− init_vlc(&chroma422_dc_coeff_token_vlc, CHROMA422_DC_COEFF_TOKEN_VLC_BITS, 4*9,
338+ vlc_init(&chroma422_dc_coeff_token_vlc, CHROMA422_DC_COEFF_TOKEN_VLC_BITS, 4*9,
339339 &chroma422_dc_coeff_token_len [0], 1, 1,
340340 &chroma422_dc_coeff_token_bits[0], 1, 1,
341− INIT_VLC_USE_NEW_STATIC);
341+ VLC_INIT_USE_STATIC);
342342
343343 offset = 0;
344344 for (int i = 0; i < 4; i++) {
345345 coeff_token_vlc[i].table = coeff_token_vlc_tables + offset;
346346 coeff_token_vlc[i].table_allocated = coeff_token_vlc_tables_size[i];
347− init_vlc(&coeff_token_vlc[i], COEFF_TOKEN_VLC_BITS, 4*17,
347+ vlc_init(&coeff_token_vlc[i], COEFF_TOKEN_VLC_BITS, 4*17,
348348 &coeff_token_len [i][0], 1, 1,
349349 &coeff_token_bits[i][0], 1, 1,
350− INIT_VLC_USE_NEW_STATIC);
350+ VLC_INIT_USE_STATIC);
351351 offset += coeff_token_vlc_tables_size[i];
352352 }
353353 /*
@@ -360,48 +360,48 @@ av_cold void ff_h264_decode_init_vlc(void) · 6 unmodified lines
360360 for (int i = 0; i < 3; i++) {
361361 chroma_dc_total_zeros_vlc[i + 1].table = chroma_dc_total_zeros_vlc_tables[i];
362362 chroma_dc_total_zeros_vlc[i + 1].table_allocated = chroma_dc_total_zeros_vlc_tables_size;
363− init_vlc(&chroma_dc_total_zeros_vlc[i + 1],
363+ vlc_init(&chroma_dc_total_zeros_vlc[i + 1],
364364 CHROMA_DC_TOTAL_ZEROS_VLC_BITS, 4,
365365 &chroma_dc_total_zeros_len [i][0], 1, 1,
366366 &chroma_dc_total_zeros_bits[i][0], 1, 1,
367− INIT_VLC_USE_NEW_STATIC);
367+ VLC_INIT_USE_STATIC);
368368 }
369369
370370 for (int i = 0; i < 7; i++) {
371371 chroma422_dc_total_zeros_vlc[i + 1].table = chroma422_dc_total_zeros_vlc_tables[i];
372372 chroma422_dc_total_zeros_vlc[i + 1].table_allocated = chroma422_dc_total_zeros_vlc_tables_size;
373− init_vlc(&chroma422_dc_total_zeros_vlc[i + 1],
373+ vlc_init(&chroma422_dc_total_zeros_vlc[i + 1],
374374 CHROMA422_DC_TOTAL_ZEROS_VLC_BITS, 8,
375375 &chroma422_dc_total_zeros_len [i][0], 1, 1,
376376 &chroma422_dc_total_zeros_bits[i][0], 1, 1,
377− INIT_VLC_USE_NEW_STATIC);
377+ VLC_INIT_USE_STATIC);
378378 }
379379
380380 for (int i = 0; i < 15; i++) {
381381 total_zeros_vlc[i + 1].table = total_zeros_vlc_tables[i];
382382 total_zeros_vlc[i + 1].table_allocated = total_zeros_vlc_tables_size;
383− init_vlc(&total_zeros_vlc[i + 1],
383+ vlc_init(&total_zeros_vlc[i + 1],
384384 TOTAL_ZEROS_VLC_BITS, 16,
385385 &total_zeros_len [i][0], 1, 1,
386386 &total_zeros_bits[i][0], 1, 1,
387− INIT_VLC_USE_NEW_STATIC);
387+ VLC_INIT_USE_STATIC);
388388 }
389389
390390 for (int i = 0; i < 6; i++) {
391391 run_vlc[i + 1].table = run_vlc_tables[i];
392392 run_vlc[i + 1].table_allocated = run_vlc_tables_size;
393− init_vlc(&run_vlc[i + 1],
393+ vlc_init(&run_vlc[i + 1],
394394 RUN_VLC_BITS, 7,
395395 &run_len [i][0], 1, 1,
396396 &run_bits[i][0], 1, 1,
397− INIT_VLC_USE_NEW_STATIC);
397+ VLC_INIT_USE_STATIC);
398398 }
399399 run7_vlc.table = run7_vlc_table;
400400 run7_vlc.table_allocated = run7_vlc_table_size;
401− init_vlc(&run7_vlc, RUN7_VLC_BITS, 16,
401+ vlc_init(&run7_vlc, RUN7_VLC_BITS, 16,
402402 &run_len [6][0], 1, 1,
403403 &run_bits[6][0], 1, 1,
404− INIT_VLC_USE_NEW_STATIC);
404+ VLC_INIT_USE_STATIC);
405405
406406 init_cavlc_level_tab();
407407 }
libavcodec/hq_hqa.c+2−2
@@ -376,8 +376,8 @@ static av_cold int hq_hqa_decode_close(AVCodecContext *avctx) · 375 unmodified lines
376376 {
377377 HQContext *ctx = avctx->priv_data;
378378
379− ff_free_vlc(&ctx->hq_ac_vlc);
380− ff_free_vlc(&ctx->hqa_cbp_vlc);
379+ ff_vlc_free(&ctx->hq_ac_vlc);
380+ ff_vlc_free(&ctx->hqa_cbp_vlc);
381381
382382 return 0;
383383 }
libavcodec/hq_hqadata.c+2−2
@@ -8367,11 +8367,11 @@ const HQProfile ff_hq_profile[NUM_HQ_PROFILES] = { · 8366 unmodified lines
83678367
83688368 av_cold int ff_hq_init_vlcs(HQContext *c)
83698369 {
8370− int ret = init_vlc(&c->hqa_cbp_vlc, 5, FF_ARRAY_ELEMS(cbp_vlc_lens),
8370+ int ret = vlc_init(&c->hqa_cbp_vlc, 5, FF_ARRAY_ELEMS(cbp_vlc_lens),
83718371 cbp_vlc_lens, 1, 1, cbp_vlc_bits, 1, 1, 0);
83728372 if (ret < 0)
83738373 return ret;
83748374
8375− return init_vlc(&c->hq_ac_vlc, 9, NUM_HQ_AC_ENTRIES,
8375+ return vlc_init(&c->hq_ac_vlc, 9, NUM_HQ_AC_ENTRIES,
83768376 hq_ac_bits, 1, 1, hq_ac_codes, 2, 2, 0);
83778377 }
libavcodec/hqx.c+2−2
@@ -517,9 +517,9 @@ static av_cold int hqx_decode_close(AVCodecContext *avctx) · 516 unmodified lines
517517 int i;
518518 HQXContext *ctx = avctx->priv_data;
519519
520− ff_free_vlc(&ctx->cbp_vlc);
520+ ff_vlc_free(&ctx->cbp_vlc);
521521 for (i = 0; i < 3; i++) {
522− ff_free_vlc(&ctx->dc_vlc[i]);
522+ ff_vlc_free(&ctx->dc_vlc[i]);
523523 }
524524
525525 return 0;
libavcodec/hqxvlc.c+2−2
@@ -2140,7 +2140,7 @@ const HQXAC ff_hqx_ac[NUM_HQX_AC] = { · 2139 unmodified lines
21402140
21412141 #define INIT_DC_TABLE(idx, name) \
21422142 do { \
2143− ret = init_vlc(&ctx->dc_vlc[idx], HQX_DC_VLC_BITS, \
2143+ ret = vlc_init(&ctx->dc_vlc[idx], HQX_DC_VLC_BITS, \
21442144 FF_ARRAY_ELEMS(name ## _vlc_lens), \
21452145 name ## _vlc_lens, 1, 1, \
21462146 name ## _vlc_bits, 2, 2, 0); \
@@ -2150,7 +2150,7 @@ const HQXAC ff_hqx_ac[NUM_HQX_AC] = { · 3 unmodified lines
21502150
21512151 av_cold int ff_hqx_init_vlcs(HQXContext *ctx)
21522152 {
2153− int ret = init_vlc(&ctx->cbp_vlc, HQX_CBP_VLC_BITS, FF_ARRAY_ELEMS(cbp_vlc_lens),
2153+ int ret = vlc_init(&ctx->cbp_vlc, HQX_CBP_VLC_BITS, FF_ARRAY_ELEMS(cbp_vlc_lens),
21542154 cbp_vlc_lens, 1, 1, cbp_vlc_bits, 1, 1, 0);
21552155 if (ret < 0)
21562156 return ret;
libavcodec/huffman.c+1−1
@@ -148,7 +148,7 @@ static int build_huff_tree(VLC *vlc, Node *nodes, int head, int flags, int nb_bi · 147 unmodified lines
148148
149149 get_tree_codes(bits, lens, xlat, nodes, head, 0, 0,
150150 &pos, no_zero_count);
151− return ff_init_vlc_sparse(vlc, nb_bits, pos, lens, 2, 2, bits, 4, 4, xlat, 1, 1, 0);
151+ return ff_vlc_init_sparse(vlc, nb_bits, pos, lens, 2, 2, bits, 4, 4, xlat, 1, 1, 0);
152152 }
153153
154154
libavcodec/huffyuvdec.c+9−9
@@ -193,8 +193,8 @@ static int generate_joint_tables(HYuvDecContext *s) · 192 unmodified lines
193193 i++;
194194 }
195195 }
196− ff_free_vlc(&s->vlc[4 + p]);
197− if ((ret = ff_init_vlc_sparse(&s->vlc[4 + p], VLC_BITS, i, len, 1, 1,
196+ ff_vlc_free(&s->vlc[4 + p]);
197+ if ((ret = ff_vlc_init_sparse(&s->vlc[4 + p], VLC_BITS, i, len, 1, 1,
198198 bits, 2, 2, symbols, 2, 2, 0)) < 0)
199199 goto out;
200200 }
@@ -237,8 +237,8 @@ static int generate_joint_tables(HYuvDecContext *s) · 36 unmodified lines
237237 }
238238 }
239239 }
240− ff_free_vlc(&s->vlc[4]);
241− if ((ret = init_vlc(&s->vlc[4], VLC_BITS, i, len, 1, 1,
240+ ff_vlc_free(&s->vlc[4]);
241+ if ((ret = vlc_init(&s->vlc[4], VLC_BITS, i, len, 1, 1,
242242 bits, 2, 2, 0)) < 0)
243243 goto out;
244244 }
@@ -265,8 +265,8 @@ static int read_huffman_tables(HYuvDecContext *s, const uint8_t *src, int length · 20 unmodified lines
265265 return ret;
266266 if ((ret = ff_huffyuv_generate_bits_table(s->bits[i], s->len[i], s->vlc_n)) < 0)
267267 return ret;
268− ff_free_vlc(&s->vlc[i]);
269− if ((ret = init_vlc(&s->vlc[i], VLC_BITS, s->vlc_n, s->len[i], 1, 1,
268+ ff_vlc_free(&s->vlc[i]);
269+ if ((ret = vlc_init(&s->vlc[i], VLC_BITS, s->vlc_n, s->len[i], 1, 1,
270270 s->bits[i], 4, 4, 0)) < 0)
271271 return ret;
272272 }
@@ -305,8 +305,8 @@ static int read_old_huffman_tables(HYuvDecContext *s) · 32 unmodified lines
305305 memcpy(s->len[2], s->len[1], 256 * sizeof(uint8_t));
306306
307307 for (i = 0; i < 4; i++) {
308− ff_free_vlc(&s->vlc[i]);
309− if ((ret = init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1,
308+ ff_vlc_free(&s->vlc[i]);
309+ if ((ret = vlc_init(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1,
310310 s->bits[i], 4, 4, 0)) < 0)
311311 return ret;
312312 }
@@ -326,7 +326,7 @@ static av_cold int decode_end(AVCodecContext *avctx) · 13 unmodified lines
326326 av_freep(&s->bitstream_buffer);
327327
328328 for (i = 0; i < 8; i++)
329− ff_free_vlc(&s->vlc[i]);
329+ ff_vlc_free(&s->vlc[i]);
330330
331331 return 0;
332332 }
libavcodec/imc.c+2−2
@@ -176,10 +176,10 @@ static av_cold void imc_init_static(void) · 175 unmodified lines
176176 for (int j = 0; j < 4; j++) {
177177 huffman_vlc[i][j].table = &vlc_tables[offset];
178178 huffman_vlc[i][j].table_allocated = VLC_TABLES_SIZE - offset;
179− ff_init_vlc_from_lengths(&huffman_vlc[i][j], IMC_VLC_BITS, imc_huffman_sizes[i],
179+ ff_vlc_init_from_lengths(&huffman_vlc[i][j], IMC_VLC_BITS, imc_huffman_sizes[i],
180180 imc_huffman_lens[i][j], 1,
181181 imc_huffman_syms[i][j], 1, 1,
182− 0, INIT_VLC_STATIC_OVERLONG, NULL);
182+ 0, VLC_INIT_STATIC_OVERLONG, NULL);
183183 offset += huffman_vlc[i][j].table_size;
184184 }
185185 }
libavcodec/imm4.c+4−4
@@ -473,18 +473,18 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, · 472 unmodified lines
473473
474474 static av_cold void imm4_init_static_data(void)
475475 {
476− INIT_VLC_STATIC_FROM_LENGTHS(&cbplo_tab, CBPLO_VLC_BITS, FF_ARRAY_ELEMS(cbplo),
476+ VLC_INIT_STATIC_FROM_LENGTHS(&cbplo_tab, CBPLO_VLC_BITS, FF_ARRAY_ELEMS(cbplo),
477477 &cbplo[0][1], 2, &cbplo[0][0], 2, 1,
478478 0, 0, 1 << CBPLO_VLC_BITS);
479479
480− INIT_VLC_SPARSE_STATIC(&cbphi_tab, CBPHI_VLC_BITS, FF_ARRAY_ELEMS(cbphi_bits),
480+ VLC_INIT_SPARSE_STATIC(&cbphi_tab, CBPHI_VLC_BITS, FF_ARRAY_ELEMS(cbphi_bits),
481481 cbphi_bits, 1, 1, cbphi_codes, 1, 1, NULL, 0, 0, 64);
482482
483− INIT_VLC_STATIC_FROM_LENGTHS(&blktype_tab, BLKTYPE_VLC_BITS, FF_ARRAY_ELEMS(blktype),
483+ VLC_INIT_STATIC_FROM_LENGTHS(&blktype_tab, BLKTYPE_VLC_BITS, FF_ARRAY_ELEMS(blktype),
484484 &blktype[0][1], 2, &blktype[0][0], 2, 1,
485485 0, 0, 1 << BLKTYPE_VLC_BITS);
486486
487− INIT_VLC_STATIC_FROM_LENGTHS(&block_tab, BLOCK_VLC_BITS, FF_ARRAY_ELEMS(block_bits),
487+ VLC_INIT_STATIC_FROM_LENGTHS(&block_tab, BLOCK_VLC_BITS, FF_ARRAY_ELEMS(block_bits),
488488 block_bits, 1, block_symbols, 2, 2,
489489 0, 0, 1 << BLOCK_VLC_BITS);
490490 }
libavcodec/indeo2.c+2−2
@@ -226,9 +226,9 @@ static int ir2_decode_frame(AVCodecContext *avctx, AVFrame *picture, · 225 unmodified lines
226226
227227 static av_cold void ir2_init_static(void)
228228 {
229− INIT_VLC_STATIC_FROM_LENGTHS(&ir2_vlc, CODE_VLC_BITS, IR2_CODES,
229+ VLC_INIT_STATIC_FROM_LENGTHS(&ir2_vlc, CODE_VLC_BITS, IR2_CODES,
230230 &ir2_tab[0][1], 2, &ir2_tab[0][0], 2, 1,
231− 0, INIT_VLC_OUTPUT_LE, 1 << CODE_VLC_BITS);
231+ 0, VLC_INIT_OUTPUT_LE, 1 << CODE_VLC_BITS);
232232 }
233233
234234 static av_cold int ir2_decode_init(AVCodecContext *avctx)
libavcodec/intrax8.c+2−2
@@ -56,8 +56,8 @@ static av_cold void x8_init_vlc(VLC *vlc, int nb_bits, int nb_codes, · 55 unmodified lines
5656
5757 vlc->table = &vlc_buf[*offset];
5858 vlc->table_allocated = VLC_BUFFER_SIZE - *offset;
59− ff_init_vlc_from_lengths(vlc, nb_bits, nb_codes, &table[0][1], 2,
60− &table[0][0], 2, 1, 0, INIT_VLC_STATIC_OVERLONG, NULL);
59+ ff_vlc_init_from_lengths(vlc, nb_bits, nb_codes, &table[0][1], 2,
60+ &table[0][0], 2, 1, 0, VLC_INIT_STATIC_OVERLONG, NULL);
6161 *offset += vlc->table_size;
6262 }
6363
libavcodec/ituh263dec.c+7−7
@@ -110,25 +110,25 @@ static VLC cbpc_b_vlc; · 109 unmodified lines
110110
111111 static av_cold void h263_decode_init_vlc(void)
112112 {
113− INIT_VLC_STATIC(&ff_h263_intra_MCBPC_vlc, INTRA_MCBPC_VLC_BITS, 9,
113+ VLC_INIT_STATIC(&ff_h263_intra_MCBPC_vlc, INTRA_MCBPC_VLC_BITS, 9,
114114 ff_h263_intra_MCBPC_bits, 1, 1,
115115 ff_h263_intra_MCBPC_code, 1, 1, 72);
116− INIT_VLC_STATIC(&ff_h263_inter_MCBPC_vlc, INTER_MCBPC_VLC_BITS, 28,
116+ VLC_INIT_STATIC(&ff_h263_inter_MCBPC_vlc, INTER_MCBPC_VLC_BITS, 28,
117117 ff_h263_inter_MCBPC_bits, 1, 1,
118118 ff_h263_inter_MCBPC_code, 1, 1, 198);
119− INIT_VLC_STATIC(&ff_h263_cbpy_vlc, CBPY_VLC_BITS, 16,
119+ VLC_INIT_STATIC(&ff_h263_cbpy_vlc, CBPY_VLC_BITS, 16,
120120 &ff_h263_cbpy_tab[0][1], 2, 1,
121121 &ff_h263_cbpy_tab[0][0], 2, 1, 64);
122− INIT_VLC_STATIC(&ff_h263_mv_vlc, H263_MV_VLC_BITS, 33,
122+ VLC_INIT_STATIC(&ff_h263_mv_vlc, H263_MV_VLC_BITS, 33,
123123 &ff_mvtab[0][1], 2, 1,
124124 &ff_mvtab[0][0], 2, 1, 538);
125125 ff_h263_init_rl_inter();
126− INIT_VLC_RL(ff_h263_rl_inter, 554);
126+ VLC_INIT_RL(ff_h263_rl_inter, 554);
127127 INIT_FIRST_VLC_RL(ff_rl_intra_aic, 554);
128− INIT_VLC_STATIC(&h263_mbtype_b_vlc, H263_MBTYPE_B_VLC_BITS, 15,
128+ VLC_INIT_STATIC(&h263_mbtype_b_vlc, H263_MBTYPE_B_VLC_BITS, 15,
129129 &ff_h263_mbtype_b_tab[0][1], 2, 1,
130130 &ff_h263_mbtype_b_tab[0][0], 2, 1, 80);
131− INIT_VLC_STATIC(&cbpc_b_vlc, CBPC_B_VLC_BITS, 4,
131+ VLC_INIT_STATIC(&cbpc_b_vlc, CBPC_B_VLC_BITS, 4,
132132 &ff_cbpc_b_tab[0][1], 2, 1,
133133 &ff_cbpc_b_tab[0][0], 2, 1, 8);
134134 }
libavcodec/ivi.c+6−6
@@ -154,8 +154,8 @@ static int ivi_create_huff_from_desc(const IVIHuffDesc *cb, VLC *vlc, int flag) · 153 unmodified lines
154154 }//for i
155155
156156 /* number of codewords = pos */
157− return init_vlc(vlc, IVI_VLC_BITS, pos, bits, 1, 1, codewords, 2, 2,
158− (flag ? INIT_VLC_USE_NEW_STATIC : 0) | INIT_VLC_OUTPUT_LE);
157+ return vlc_init(vlc, IVI_VLC_BITS, pos, bits, 1, 1, codewords, 2, 2,
158+ (flag ? VLC_INIT_USE_STATIC : 0) | VLC_INIT_OUTPUT_LE);
159159 }
160160
161161 static av_cold void ivi_init_static_vlc(void)
@@ -237,7 +237,7 @@ int ff_ivi_dec_huff_desc(GetBitContext *gb, int desc_coded, int which_tab, · 75 unmodified lines
237237 ivi_huff_desc_copy(&huff_tab->cust_desc, &new_huff);
238238
239239 if (huff_tab->cust_tab.table)
240− ff_free_vlc(&huff_tab->cust_tab);
240+ ff_vlc_free(&huff_tab->cust_tab);
241241 result = ivi_create_huff_from_desc(&huff_tab->cust_desc,
242242 &huff_tab->cust_tab, 0);
243243 if (result) {
@@ -277,7 +277,7 @@ static av_cold void ivi_free_buffers(IVIPlaneDesc *planes) · 33 unmodified lines
277277 av_freep(&band->bufs[3]);
278278
279279 if (band->blk_vlc.cust_tab.table)
280− ff_free_vlc(&band->blk_vlc.cust_tab);
280+ ff_vlc_free(&band->blk_vlc.cust_tab);
281281 for (t = 0; t < band->num_tiles; t++)
282282 av_freep(&band->tiles[t].mbs);
283283 av_freep(&band->tiles);
@@ -1215,10 +1215,10 @@ av_cold int ff_ivi_decode_close(AVCodecContext *avctx) · 931 unmodified lines
12151215 ivi_free_buffers(&ctx->planes[0]);
12161216
12171217 if (ctx->mb_vlc.cust_tab.table)
1218− ff_free_vlc(&ctx->mb_vlc.cust_tab);
1218+ ff_vlc_free(&ctx->mb_vlc.cust_tab);
12191219
12201220 if (ctx->blk_vlc.cust_tab.table)
1221− ff_free_vlc(&ctx->blk_vlc.cust_tab);
1221+ ff_vlc_free(&ctx->blk_vlc.cust_tab);
12221222
12231223 av_frame_free(&ctx->p_frame);
12241224
libavcodec/jpegxl_parser.c+8−8
@@ -474,7 +474,7 @@ static void dist_bundle_close(JXLDistributionBundle *bundle) · 473 unmodified lines
474474 {
475475 if (bundle->use_prefix_code && bundle->dists)
476476 for (int i = 0; i < bundle->num_clusters; i++)
477− ff_free_vlc(&bundle->dists[i].vlc);
477+ ff_vlc_free(&bundle->dists[i].vlc);
478478 av_freep(&bundle->dists);
479479 av_freep(&bundle->cluster_map);
480480 }
@@ -668,8 +668,8 @@ static int read_simple_vlc_prefix(GetBitContext *gb, JXLEntropyDecoder *dec, JXL · 187 unmodified lines
668668 return AVERROR_BUG;
669669 }
670670
671− return ff_init_vlc_from_lengths(&dist->vlc, bits, nsym, lens, 1, symbols,
672− 2, 2, 0, INIT_VLC_LE, dec->logctx);
671+ return ff_vlc_init_from_lengths(&dist->vlc, bits, nsym, lens, 1, symbols,
672+ 2, 2, 0, VLC_INIT_LE, dec->logctx);
673673 }
674674
675675 static int read_vlc_prefix(GetBitContext *gb, JXLEntropyDecoder *dec, JXLSymbolDistribution *dist)
@@ -724,8 +724,8 @@ static int read_vlc_prefix(GetBitContext *gb, JXLEntropyDecoder *dec, JXLSymbolD · 48 unmodified lines
724724 level1_syms[idx] = i;
725725 }
726726
727− ret = ff_init_vlc_from_lengths(&level1_vlc, 5, 18, level1_lens_s, 1, level1_syms, 2, 2,
728− 0, INIT_VLC_LE, dec->logctx);
727+ ret = ff_vlc_init_from_lengths(&level1_vlc, 5, 18, level1_lens_s, 1, level1_syms, 2, 2,
728+ 0, VLC_INIT_LE, dec->logctx);
729729 if (ret < 0)
730730 goto end;
731731
@@ -789,12 +789,12 @@ static int read_vlc_prefix(GetBitContext *gb, JXLEntropyDecoder *dec, JXLSymbolD · 57 unmodified lines
789789 level2_syms[idx] = i;
790790 }
791791
792− ret = ff_init_vlc_from_lengths(&dist->vlc, 15, dist->alphabet_size, level2_lens_s,
793− 1, level2_syms, 2, 2, 0, INIT_VLC_LE, dec->logctx);
792+ ret = ff_vlc_init_from_lengths(&dist->vlc, 15, dist->alphabet_size, level2_lens_s,
793+ 1, level2_syms, 2, 2, 0, VLC_INIT_LE, dec->logctx);
794794
795795 end:
796796 av_freep(&buf);
797− ff_free_vlc(&level1_vlc);
797+ ff_vlc_free(&level1_vlc);
798798
799799 return ret;
800800 }
libavcodec/magicyuv.c+5−5
@@ -86,9 +86,9 @@ static int huff_build(const uint8_t len[], uint16_t codes_pos[33], · 85 unmodified lines
8686 for (unsigned i = nb_elems; i-- > 0;)
8787 he[--codes_pos[len[i]]] = (HuffEntry){ len[i], i };
8888
89− ff_free_vlc(vlc);
90− ff_free_vlc_multi(multi);
91− return ff_init_vlc_multi_from_lengths(vlc, multi, FFMIN(he[0].len, VLC_BITS), nb_elems, nb_elems,
89+ ff_vlc_free(vlc);
90+ ff_vlc_free_multi(multi);
91+ return ff_vlc_init_multi_from_lengths(vlc, multi, FFMIN(he[0].len, VLC_BITS), nb_elems, nb_elems,
9292 &he[0].len, sizeof(he[0]),
9393 &he[0].sym, sizeof(he[0]), sizeof(he[0].sym),
9494 0, 0, logctx);
@@ -688,8 +688,8 @@ static av_cold int magy_decode_end(AVCodecContext *avctx) · 593 unmodified lines
688688 for (i = 0; i < FF_ARRAY_ELEMS(s->slices); i++) {
689689 av_freep(&s->slices[i]);
690690 s->slices_size[i] = 0;
691− ff_free_vlc(&s->vlc[i]);
692− ff_free_vlc_multi(&s->multi[i]);
691+ ff_vlc_free(&s->vlc[i]);
692+ ff_vlc_free_multi(&s->multi[i]);
693693 }
694694
695695 return 0;
libavcodec/mimic.c+1−1
@@ -120,7 +120,7 @@ static av_cold int mimic_decode_end(AVCodecContext *avctx) · 119 unmodified lines
120120
121121 static av_cold void mimic_init_static(void)
122122 {
123− INIT_VLC_STATIC_FROM_LENGTHS(&block_vlc, MIMIC_VLC_BITS, FF_ARRAY_ELEMS(huffbits),
123+ VLC_INIT_STATIC_FROM_LENGTHS(&block_vlc, MIMIC_VLC_BITS, FF_ARRAY_ELEMS(huffbits),
124124 huffbits, 1, huffsyms, 1, 1, 0, 0, 4368);
125125 }
126126
libavcodec/mjpegdec.c+4−4
@@ -83,7 +83,7 @@ static int init_default_huffman_tables(MJpegDecodeContext *s) · 82 unmodified lines
8383 int i, ret;
8484
8585 for (i = 0; i < FF_ARRAY_ELEMS(ht); i++) {
86− ff_free_vlc(&s->vlcs[ht[i].class][ht[i].index]);
86+ ff_vlc_free(&s->vlcs[ht[i].class][ht[i].index]);
8787 ret = ff_mjpeg_build_vlc(&s->vlcs[ht[i].class][ht[i].index],
8888 ht[i].bits, ht[i].values,
8989 ht[i].class == 1, s->avctx);
@@ -277,7 +277,7 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s) · 187 unmodified lines
277277 len -= n;
278278
279279 /* build VLC and flush previous vlc if present */
280− ff_free_vlc(&s->vlcs[class][index]);
280+ ff_vlc_free(&s->vlcs[class][index]);
281281 av_log(s->avctx, AV_LOG_DEBUG, "class=%d index=%d nb_codes=%d\n",
282282 class, index, n);
283283 if ((ret = ff_mjpeg_build_vlc(&s->vlcs[class][index], bits_table,
@@ -285,7 +285,7 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s) · 1 unmodified line
285285 return ret;
286286
287287 if (class > 0) {
288− ff_free_vlc(&s->vlcs[2][index]);
288+ ff_vlc_free(&s->vlcs[2][index]);
289289 if ((ret = ff_mjpeg_build_vlc(&s->vlcs[2][index], bits_table,
290290 val_table, 0, s->avctx)) < 0)
291291 return ret;
@@ -2955,7 +2955,7 @@ av_cold int ff_mjpeg_decode_end(AVCodecContext *avctx) · 2663 unmodified lines
29552955
29562956 for (i = 0; i < 3; i++) {
29572957 for (j = 0; j < 4; j++)
2958− ff_free_vlc(&s->vlcs[i][j]);
2958+ ff_vlc_free(&s->vlcs[i][j]);
29592959 }
29602960 for (i = 0; i < MAX_COMPONENTS; i++) {
29612961 av_freep(&s->blocks[i]);
libavcodec/mjpegdec_common.c+1−1
@@ -52,6 +52,6 @@ int ff_mjpeg_build_vlc(VLC *vlc, const uint8_t *bits_table, · 51 unmodified lines
5252 huff_sym[i] = 16 * 256;
5353 }
5454
55− return ff_init_vlc_from_lengths(vlc, 9, nb_codes, huff_size, 1,
55+ return ff_vlc_init_from_lengths(vlc, 9, nb_codes, huff_size, 1,
5656 huff_sym, 2, 2, 0, 0, logctx);
5757 }
libavcodec/mlpdec.c+2−2
@@ -230,9 +230,9 @@ static av_cold void init_static(void) · 229 unmodified lines
230230 static VLCElem vlc_buf[3 * VLC_STATIC_SIZE];
231231 huff_vlc[i].table = &vlc_buf[i * VLC_STATIC_SIZE];
232232 huff_vlc[i].table_allocated = VLC_STATIC_SIZE;
233− init_vlc(&huff_vlc[i], VLC_BITS, 18,
233+ vlc_init(&huff_vlc[i], VLC_BITS, 18,
234234 &ff_mlp_huffman_tables[i][0][1], 2, 1,
235− &ff_mlp_huffman_tables[i][0][0], 2, 1, INIT_VLC_USE_NEW_STATIC);
235+ &ff_mlp_huffman_tables[i][0][0], 2, 1, VLC_INIT_USE_STATIC);
236236 }
237237
238238 ff_mlp_init_crc();
libavcodec/mobiclip.c+4−4
@@ -279,11 +279,11 @@ static VLC mv_vlc[2][16]; · 278 unmodified lines
279279
280280 static av_cold void mobiclip_init_static(void)
281281 {
282− INIT_VLC_STATIC_FROM_LENGTHS(&rl_vlc[0], MOBI_RL_VLC_BITS, 104,
282+ VLC_INIT_STATIC_FROM_LENGTHS(&rl_vlc[0], MOBI_RL_VLC_BITS, 104,
283283 bits0, sizeof(*bits0),
284284 syms0, sizeof(*syms0), sizeof(*syms0),
285285 0, 0, 1 << MOBI_RL_VLC_BITS);
286− INIT_VLC_STATIC_FROM_LENGTHS(&rl_vlc[1], MOBI_RL_VLC_BITS, 104,
286+ VLC_INIT_STATIC_FROM_LENGTHS(&rl_vlc[1], MOBI_RL_VLC_BITS, 104,
287287 bits0, sizeof(*bits0),
288288 syms1, sizeof(*syms1), sizeof(*syms1),
289289 0, 0, 1 << MOBI_RL_VLC_BITS);
@@ -292,10 +292,10 @@ static av_cold void mobiclip_init_static(void) · 2 unmodified lines
292292 for (int j = 0; j < 16; j++) {
293293 mv_vlc[i][j].table = &vlc_buf[(16 * i + j) << MOBI_MV_VLC_BITS];
294294 mv_vlc[i][j].table_allocated = 1 << MOBI_MV_VLC_BITS;
295− ff_init_vlc_from_lengths(&mv_vlc[i][j], MOBI_MV_VLC_BITS, mv_len[j],
295+ ff_vlc_init_from_lengths(&mv_vlc[i][j], MOBI_MV_VLC_BITS, mv_len[j],
296296 mv_bits[i][j], sizeof(*mv_bits[i][j]),
297297 mv_syms[i][j], sizeof(*mv_syms[i][j]), sizeof(*mv_syms[i][j]),
298− 0, INIT_VLC_USE_NEW_STATIC, NULL);
298+ 0, VLC_INIT_USE_STATIC, NULL);
299299 }
300300 }
301301 }
libavcodec/motionpixels.c+2−2
@@ -328,7 +328,7 @@ static int mp_decode_frame(AVCodecContext *avctx, AVFrame *rframe, · 327 unmodified lines
328328 if (mp->codes_count > 1) {
329329 /* The entries of the mp->codes array are sorted from right to left
330330 * in the Huffman tree, hence -(int)sizeof(HuffCode). */
331− ret = ff_init_vlc_from_lengths(&mp->vlc, mp->max_codes_bits, mp->codes_count,
331+ ret = ff_vlc_init_from_lengths(&mp->vlc, mp->max_codes_bits, mp->codes_count,
332332 &mp->codes[mp->codes_count - 1].size, -(int)sizeof(HuffCode),
333333 &mp->codes[mp->codes_count - 1].delta, -(int)sizeof(HuffCode), 1,
334334 0, 0, avctx);
@@ -336,7 +336,7 @@ static int mp_decode_frame(AVCodecContext *avctx, AVFrame *rframe, · 1 unmodified line
336336 goto end;
337337 }
338338 mp_decode_frame_helper(mp, &gb);
339− ff_free_vlc(&mp->vlc);
339+ ff_vlc_free(&mp->vlc);
340340
341341 end:
342342 if ((ret = av_frame_ref(rframe, mp->frame)) < 0)
libavcodec/mpc7.c+5−5
@@ -47,24 +47,24 @@ static av_cold void mpc7_init_static(void) · 46 unmodified lines
4747 static VLCElem quant_tables[7224];
4848 const uint8_t *raw_quant_table = mpc7_quant_vlcs;
4949
50− INIT_VLC_STATIC_FROM_LENGTHS(&scfi_vlc, MPC7_SCFI_BITS, MPC7_SCFI_SIZE,
50+ VLC_INIT_STATIC_FROM_LENGTHS(&scfi_vlc, MPC7_SCFI_BITS, MPC7_SCFI_SIZE,
5151 &mpc7_scfi[1], 2,
5252 &mpc7_scfi[0], 2, 1, 0, 0, 1 << MPC7_SCFI_BITS);
53− INIT_VLC_STATIC_FROM_LENGTHS(&dscf_vlc, MPC7_DSCF_BITS, MPC7_DSCF_SIZE,
53+ VLC_INIT_STATIC_FROM_LENGTHS(&dscf_vlc, MPC7_DSCF_BITS, MPC7_DSCF_SIZE,
5454 &mpc7_dscf[1], 2,
5555 &mpc7_dscf[0], 2, 1, -7, 0, 1 << MPC7_DSCF_BITS);
56− INIT_VLC_STATIC_FROM_LENGTHS(&hdr_vlc, MPC7_HDR_BITS, MPC7_HDR_SIZE,
56+ VLC_INIT_STATIC_FROM_LENGTHS(&hdr_vlc, MPC7_HDR_BITS, MPC7_HDR_SIZE,
5757 &mpc7_hdr[1], 2,
5858 &mpc7_hdr[0], 2, 1, -5, 0, 1 << MPC7_HDR_BITS);
5959 for (unsigned i = 0, offset = 0; i < MPC7_QUANT_VLC_TABLES; i++){
6060 for (int j = 0; j < 2; j++) {
6161 quant_vlc[i][j].table = &quant_tables[offset];
6262 quant_vlc[i][j].table_allocated = FF_ARRAY_ELEMS(quant_tables) - offset;
63− ff_init_vlc_from_lengths(&quant_vlc[i][j], 9, mpc7_quant_vlc_sizes[i],
63+ ff_vlc_init_from_lengths(&quant_vlc[i][j], 9, mpc7_quant_vlc_sizes[i],
6464 &raw_quant_table[1], 2,
6565 &raw_quant_table[0], 2, 1,
6666 mpc7_quant_vlc_off[i],
67− INIT_VLC_STATIC_OVERLONG, NULL);
67+ VLC_INIT_STATIC_OVERLONG, NULL);
6868 raw_quant_table += 2 * mpc7_quant_vlc_sizes[i];
6969 offset += quant_vlc[i][j].table_size;
7070 }
libavcodec/mpc8.c+2−2
@@ -103,8 +103,8 @@ static av_cold void build_vlc(VLC *vlc, unsigned *buf_offset, · 102 unmodified lines
103103 for (unsigned tmp = num + codes_counts[i - 1]; num < tmp; num++)
104104 len[num] = i;
105105
106− ff_init_vlc_from_lengths(vlc, FFMIN(len[0], 9), num, len, 1,
107− *syms, 1, 1, offset, INIT_VLC_STATIC_OVERLONG, NULL);
106+ ff_vlc_init_from_lengths(vlc, FFMIN(len[0], 9), num, len, 1,
107+ *syms, 1, 1, offset, VLC_INIT_STATIC_OVERLONG, NULL);
108108 *buf_offset += vlc->table_size;
109109 *syms += num;
110110 }
libavcodec/mpeg12.c+8−8
@@ -72,7 +72,7 @@ av_cold void ff_init_2d_vlc_rl(const uint16_t table_vlc[][2], RL_VLC_ELEM rl_vlc · 71 unmodified lines
7272 VLCElem table[680] = { 0 };
7373 VLC vlc = { .table = table, .table_allocated = static_size };
7474 av_assert0(static_size <= FF_ARRAY_ELEMS(table));
75− init_vlc(&vlc, TEX_VLC_BITS, n + 2, &table_vlc[0][1], 4, 2, &table_vlc[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC | flags);
75+ vlc_init(&vlc, TEX_VLC_BITS, n + 2, &table_vlc[0][1], 4, 2, &table_vlc[0][0], 4, 2, VLC_INIT_USE_STATIC | flags);
7676
7777 for (i = 0; i < vlc.table_size; i++) {
7878 int code = vlc.table[i].sym;
@@ -130,26 +130,26 @@ RL_VLC_ELEM ff_mpeg2_rl_vlc[674]; · 51 unmodified lines
130130
131131 static av_cold void mpeg12_init_vlcs(void)
132132 {
133− INIT_VLC_STATIC(&ff_dc_lum_vlc, DC_VLC_BITS, 12,
133+ VLC_INIT_STATIC(&ff_dc_lum_vlc, DC_VLC_BITS, 12,
134134 ff_mpeg12_vlc_dc_lum_bits, 1, 1,
135135 ff_mpeg12_vlc_dc_lum_code, 2, 2, 512);
136− INIT_VLC_STATIC(&ff_dc_chroma_vlc, DC_VLC_BITS, 12,
136+ VLC_INIT_STATIC(&ff_dc_chroma_vlc, DC_VLC_BITS, 12,
137137 ff_mpeg12_vlc_dc_chroma_bits, 1, 1,
138138 ff_mpeg12_vlc_dc_chroma_code, 2, 2, 514);
139− INIT_VLC_STATIC(&ff_mv_vlc, MV_VLC_BITS, 17,
139+ VLC_INIT_STATIC(&ff_mv_vlc, MV_VLC_BITS, 17,
140140 &ff_mpeg12_mbMotionVectorTable[0][1], 2, 1,
141141 &ff_mpeg12_mbMotionVectorTable[0][0], 2, 1, 266);
142− INIT_VLC_STATIC(&ff_mbincr_vlc, MBINCR_VLC_BITS, 36,
142+ VLC_INIT_STATIC(&ff_mbincr_vlc, MBINCR_VLC_BITS, 36,
143143 &ff_mpeg12_mbAddrIncrTable[0][1], 2, 1,
144144 &ff_mpeg12_mbAddrIncrTable[0][0], 2, 1, 538);
145− INIT_VLC_STATIC(&ff_mb_pat_vlc, MB_PAT_VLC_BITS, 64,
145+ VLC_INIT_STATIC(&ff_mb_pat_vlc, MB_PAT_VLC_BITS, 64,
146146 &ff_mpeg12_mbPatTable[0][1], 2, 1,
147147 &ff_mpeg12_mbPatTable[0][0], 2, 1, 512);
148148
149− INIT_VLC_STATIC(&ff_mb_ptype_vlc, MB_PTYPE_VLC_BITS, 7,
149+ VLC_INIT_STATIC(&ff_mb_ptype_vlc, MB_PTYPE_VLC_BITS, 7,
150150 &table_mb_ptype[0][1], 2, 1,
151151 &table_mb_ptype[0][0], 2, 1, 64);
152− INIT_VLC_STATIC(&ff_mb_btype_vlc, MB_BTYPE_VLC_BITS, 11,
152+ VLC_INIT_STATIC(&ff_mb_btype_vlc, MB_BTYPE_VLC_BITS, 11,
153153 &table_mb_btype[0][1], 2, 1,
154154 &table_mb_btype[0][0], 2, 1, 64);
155155
libavcodec/mpeg4videodec.c+9−9
@@ -3761,12 +3761,12 @@ static av_cold void mpeg4_init_static(void) · 3760 unmodified lines
37613761 {
37623762 static uint8_t mpeg4_rvlc_rl_tables[2][2][2 * MAX_RUN + MAX_LEVEL + 3];
37633763
3764− INIT_VLC_STATIC_FROM_LENGTHS(&studio_luma_dc, STUDIO_INTRA_BITS, 19,
3764+ VLC_INIT_STATIC_FROM_LENGTHS(&studio_luma_dc, STUDIO_INTRA_BITS, 19,
37653765 &ff_mpeg4_studio_dc_luma[0][1], 2,
37663766 &ff_mpeg4_studio_dc_luma[0][0], 2, 1,
37673767 0, 0, 528);
37683768
3769− INIT_VLC_STATIC_FROM_LENGTHS(&studio_chroma_dc, STUDIO_INTRA_BITS, 19,
3769+ VLC_INIT_STATIC_FROM_LENGTHS(&studio_chroma_dc, STUDIO_INTRA_BITS, 19,
37703770 &ff_mpeg4_studio_dc_chroma[0][1], 2,
37713771 &ff_mpeg4_studio_dc_chroma[0][0], 2, 1,
37723772 0, 0, 528);
@@ -3776,11 +3776,11 @@ static av_cold void mpeg4_init_static(void) · 3 unmodified lines
37763776
37773777 studio_intra_tab[i].table = &vlc_buf[offset];
37783778 studio_intra_tab[i].table_allocated = FF_ARRAY_ELEMS(vlc_buf) - offset;
3779− ff_init_vlc_from_lengths(&studio_intra_tab[i],
3779+ ff_vlc_init_from_lengths(&studio_intra_tab[i],
37803780 STUDIO_INTRA_BITS, 24,
37813781 &ff_mpeg4_studio_intra[i][0][1], 2,
37823782 &ff_mpeg4_studio_intra[i][0][0], 2, 1,
3783− 0, INIT_VLC_STATIC_OVERLONG, NULL);
3783+ 0, VLC_INIT_STATIC_OVERLONG, NULL);
37843784 offset += studio_intra_tab[i].table_size;
37853785 }
37863786
@@ -3788,18 +3788,18 @@ static av_cold void mpeg4_init_static(void) · 1 unmodified line
37883788 ff_rl_init(&ff_rvlc_rl_inter, mpeg4_rvlc_rl_tables[0]);
37893789 ff_rl_init(&ff_rvlc_rl_intra, mpeg4_rvlc_rl_tables[1]);
37903790 INIT_FIRST_VLC_RL(ff_mpeg4_rl_intra, 554);
3791− INIT_VLC_RL(ff_rvlc_rl_inter, 1072);
3791+ VLC_INIT_RL(ff_rvlc_rl_inter, 1072);
37923792 INIT_FIRST_VLC_RL(ff_rvlc_rl_intra, 1072);
3793− INIT_VLC_STATIC(&dc_lum, DC_VLC_BITS, 10 /* 13 */,
3793+ VLC_INIT_STATIC(&dc_lum, DC_VLC_BITS, 10 /* 13 */,
37943794 &ff_mpeg4_DCtab_lum[0][1], 2, 1,
37953795 &ff_mpeg4_DCtab_lum[0][0], 2, 1, 512);
3796− INIT_VLC_STATIC(&dc_chrom, DC_VLC_BITS, 10 /* 13 */,
3796+ VLC_INIT_STATIC(&dc_chrom, DC_VLC_BITS, 10 /* 13 */,
37973797 &ff_mpeg4_DCtab_chrom[0][1], 2, 1,
37983798 &ff_mpeg4_DCtab_chrom[0][0], 2, 1, 512);
3799− INIT_VLC_STATIC_FROM_LENGTHS(&sprite_trajectory, SPRITE_TRAJ_VLC_BITS, 15,
3799+ VLC_INIT_STATIC_FROM_LENGTHS(&sprite_trajectory, SPRITE_TRAJ_VLC_BITS, 15,
38003800 ff_sprite_trajectory_lens, 1,
38013801 NULL, 0, 0, 0, 0, 128);
3802− INIT_VLC_STATIC(&mb_type_b_vlc, MB_TYPE_B_VLC_BITS, 4,
3802+ VLC_INIT_STATIC(&mb_type_b_vlc, MB_TYPE_B_VLC_BITS, 4,
38033803 &ff_mb_type_b_tab[0][1], 2, 1,
38043804 &ff_mb_type_b_tab[0][0], 2, 1, 16);
38053805 }
libavcodec/mpegaudiodec_common.c+4−4
@@ -428,9 +428,9 @@ static av_cold void mpegaudiodec_common_init_static(void) · 427 unmodified lines
428428
429429 ff_huff_vlc[++i].table = huff_vlc_tables + offset;
430430 ff_huff_vlc[i].table_allocated = FF_ARRAY_ELEMS(huff_vlc_tables) - offset;
431− ff_init_vlc_from_lengths(&ff_huff_vlc[i], 7, j,
431+ ff_vlc_init_from_lengths(&ff_huff_vlc[i], 7, j,
432432 huff_lens, 1, tmp_symbols, 2, 2,
433− 0, INIT_VLC_STATIC_OVERLONG, NULL);
433+ 0, VLC_INIT_STATIC_OVERLONG, NULL);
434434 offset += ff_huff_vlc[i].table_size;
435435 huff_lens += j;
436436 huff_sym += j;
@@ -443,9 +443,9 @@ static av_cold void mpegaudiodec_common_init_static(void) · 6 unmodified lines
443443 ff_huff_quad_vlc[i].table = huff_quad_vlc_tables + offset;
444444 ff_huff_quad_vlc[i].table_allocated = 1 << bits;
445445 offset += 1 << bits;
446− init_vlc(&ff_huff_quad_vlc[i], bits, 16,
446+ vlc_init(&ff_huff_quad_vlc[i], bits, 16,
447447 mpa_quad_bits[i], 1, 1, mpa_quad_codes[i], 1, 1,
448− INIT_VLC_USE_NEW_STATIC);
448+ VLC_INIT_USE_STATIC);
449449 }
450450 av_assert0(offset == FF_ARRAY_ELEMS(huff_quad_vlc_tables));
451451
libavcodec/msmpeg4_vc1_data.c+5−5
@@ -38,20 +38,20 @@ VLC ff_msmp4_dc_chroma_vlc[2]; · 37 unmodified lines
3838
3939 static av_cold void msmp4_vc1_vlcs_init(void)
4040 {
41− INIT_VLC_STATIC(&ff_msmp4_dc_luma_vlc[0], MSMP4_DC_VLC_BITS, 120,
41+ VLC_INIT_STATIC(&ff_msmp4_dc_luma_vlc[0], MSMP4_DC_VLC_BITS, 120,
4242 &ff_table0_dc_lum[0][1], 8, 4,
4343 &ff_table0_dc_lum[0][0], 8, 4, 1158);
44− INIT_VLC_STATIC(&ff_msmp4_dc_chroma_vlc[0], MSMP4_DC_VLC_BITS, 120,
44+ VLC_INIT_STATIC(&ff_msmp4_dc_chroma_vlc[0], MSMP4_DC_VLC_BITS, 120,
4545 &ff_table0_dc_chroma[0][1], 8, 4,
4646 &ff_table0_dc_chroma[0][0], 8, 4, 1118);
47− INIT_VLC_STATIC(&ff_msmp4_dc_luma_vlc[1], MSMP4_DC_VLC_BITS, 120,
47+ VLC_INIT_STATIC(&ff_msmp4_dc_luma_vlc[1], MSMP4_DC_VLC_BITS, 120,
4848 &ff_table1_dc_lum[0][1], 8, 4,
4949 &ff_table1_dc_lum[0][0], 8, 4, 1476);
50− INIT_VLC_STATIC(&ff_msmp4_dc_chroma_vlc[1], MSMP4_DC_VLC_BITS, 120,
50+ VLC_INIT_STATIC(&ff_msmp4_dc_chroma_vlc[1], MSMP4_DC_VLC_BITS, 120,
5151 &ff_table1_dc_chroma[0][1], 8, 4,
5252 &ff_table1_dc_chroma[0][0], 8, 4, 1216);
5353
54− INIT_VLC_STATIC(&ff_msmp4_mb_i_vlc, MSMP4_MB_INTRA_VLC_BITS, 64,
54+ VLC_INIT_STATIC(&ff_msmp4_mb_i_vlc, MSMP4_MB_INTRA_VLC_BITS, 64,
5555 &ff_msmp4_mb_i_table[0][1], 4, 2,
5656 &ff_msmp4_mb_i_table[0][0], 4, 2, 536);
5757 }
libavcodec/msmpeg4dec.c+11−11
@@ -301,33 +301,33 @@ static av_cold void msmpeg4_decode_init_static(void) · 300 unmodified lines
301301 INIT_FIRST_VLC_RL(ff_rl_table[0], 642);
302302 INIT_FIRST_VLC_RL(ff_rl_table[1], 1104);
303303 INIT_FIRST_VLC_RL(ff_rl_table[2], 554);
304− INIT_VLC_RL(ff_rl_table[3], 940);
305− INIT_VLC_RL(ff_rl_table[4], 962);
304+ VLC_INIT_RL(ff_rl_table[3], 940);
305+ VLC_INIT_RL(ff_rl_table[4], 962);
306306 /* ff_rl_table[5] coincides with ff_h263_rl_inter which has just been
307307 * initialized in ff_h263_decode_init() earlier. So just copy the VLCs. */
308308 av_assert1(ff_h263_rl_inter.rl_vlc[0]);
309309 memcpy(ff_rl_table[5].rl_vlc, ff_h263_rl_inter.rl_vlc, sizeof(ff_rl_table[5].rl_vlc));
310310
311311 mv = &ff_mv_tables[0];
312− INIT_VLC_STATIC(&mv->vlc, MV_VLC_BITS, MSMPEG4_MV_TABLES_NB_ELEMS + 1,
312+ VLC_INIT_STATIC(&mv->vlc, MV_VLC_BITS, MSMPEG4_MV_TABLES_NB_ELEMS + 1,
313313 mv->table_mv_bits, 1, 1,
314314 mv->table_mv_code, 2, 2, 3714);
315315 mv = &ff_mv_tables[1];
316− INIT_VLC_STATIC(&mv->vlc, MV_VLC_BITS, MSMPEG4_MV_TABLES_NB_ELEMS + 1,
316+ VLC_INIT_STATIC(&mv->vlc, MV_VLC_BITS, MSMPEG4_MV_TABLES_NB_ELEMS + 1,
317317 mv->table_mv_bits, 1, 1,
318318 mv->table_mv_code, 2, 2, 2694);
319319
320− INIT_VLC_STATIC(&v2_dc_lum_vlc, MSMP4_DC_VLC_BITS, 512,
320+ VLC_INIT_STATIC(&v2_dc_lum_vlc, MSMP4_DC_VLC_BITS, 512,
321321 &ff_v2_dc_lum_table[0][1], 8, 4,
322322 &ff_v2_dc_lum_table[0][0], 8, 4, 1472);
323− INIT_VLC_STATIC(&v2_dc_chroma_vlc, MSMP4_DC_VLC_BITS, 512,
323+ VLC_INIT_STATIC(&v2_dc_chroma_vlc, MSMP4_DC_VLC_BITS, 512,
324324 &ff_v2_dc_chroma_table[0][1], 8, 4,
325325 &ff_v2_dc_chroma_table[0][0], 8, 4, 1506);
326326
327− INIT_VLC_STATIC(&v2_intra_cbpc_vlc, V2_INTRA_CBPC_VLC_BITS, 4,
327+ VLC_INIT_STATIC(&v2_intra_cbpc_vlc, V2_INTRA_CBPC_VLC_BITS, 4,
328328 &ff_v2_intra_cbpc[0][1], 2, 1,
329329 &ff_v2_intra_cbpc[0][0], 2, 1, 8);
330− INIT_VLC_STATIC(&v2_mb_type_vlc, V2_MB_TYPE_VLC_BITS, 8,
330+ VLC_INIT_STATIC(&v2_mb_type_vlc, V2_MB_TYPE_VLC_BITS, 8,
331331 &ff_v2_mb_type[0][1], 2, 1,
332332 &ff_v2_mb_type[0][0], 2, 1, 128);
333333
@@ -335,14 +335,14 @@ static av_cold void msmpeg4_decode_init_static(void) · 1 unmodified line
335335 static VLCElem vlc_buf[1636 + 2648 + 1532 + 2488];
336336 ff_mb_non_intra_vlc[i].table = &vlc_buf[offset];
337337 ff_mb_non_intra_vlc[i].table_allocated = FF_ARRAY_ELEMS(vlc_buf) - offset;
338− init_vlc(&ff_mb_non_intra_vlc[i], MB_NON_INTRA_VLC_BITS, 128,
338+ vlc_init(&ff_mb_non_intra_vlc[i], MB_NON_INTRA_VLC_BITS, 128,
339339 &ff_wmv2_inter_table[i][0][1], 8, 4,
340340 &ff_wmv2_inter_table[i][0][0], 8, 4,
341− INIT_VLC_STATIC_OVERLONG);
341+ VLC_INIT_STATIC_OVERLONG);
342342 offset += ff_mb_non_intra_vlc[i].table_size;
343343 }
344344
345− INIT_VLC_STATIC(&ff_inter_intra_vlc, INTER_INTRA_VLC_BITS, 4,
345+ VLC_INIT_STATIC(&ff_inter_intra_vlc, INTER_INTRA_VLC_BITS, 4,
346346 &ff_table_inter_intra[0][1], 2, 1,
347347 &ff_table_inter_intra[0][0], 2, 1, 8);
348348 ff_msmp4_vc1_vlcs_init_once();
libavcodec/mss2.c+2−2
@@ -324,7 +324,7 @@ static int decode_rle(GetBitContext *gb, uint8_t *pal_dst, ptrdiff_t pal_stride, · 323 unmodified lines
324324 if (next_code != 1 << current_length)
325325 return AVERROR_INVALIDDATA;
326326
327− if ((i = init_vlc(&vlc, 9, alphabet_size, bits, 1, 1, codes, 4, 4, 0)) < 0)
327+ if ((i = vlc_init(&vlc, 9, alphabet_size, bits, 1, 1, codes, 4, 4, 0)) < 0)
328328 return i;
329329
330330 /* frame decode */
@@ -371,7 +371,7 @@ static int decode_rle(GetBitContext *gb, uint8_t *pal_dst, ptrdiff_t pal_stride, · 40 unmodified lines
371371 prev_avail = 1;
372372 } while (--h);
373373
374− ff_free_vlc(&vlc);
374+ ff_vlc_free(&vlc);
375375 return 0;
376376 }
377377
libavcodec/mss4.c+2−2
@@ -115,9 +115,9 @@ static av_cold void mss4_init_vlc(VLC *vlc, unsigned *offset, · 114 unmodified lines
115115
116116 vlc->table = &vlc_buf[*offset];
117117 vlc->table_allocated = FF_ARRAY_ELEMS(vlc_buf) - *offset;
118− ff_init_vlc_from_lengths(vlc, FFMIN(bits[idx - 1], 9), idx,
118+ ff_vlc_init_from_lengths(vlc, FFMIN(bits[idx - 1], 9), idx,
119119 bits, 1, syms, 1, 1,
120− 0, INIT_VLC_STATIC_OVERLONG, NULL);
120+ 0, VLC_INIT_STATIC_OVERLONG, NULL);
121121 *offset += vlc->table_size;
122122 }
123123
libavcodec/mv30.c+1−1
@@ -657,7 +657,7 @@ static const uint8_t cbp_bits[] = { · 656 unmodified lines
657657
658658 static av_cold void init_static_data(void)
659659 {
660− INIT_VLC_STATIC_FROM_LENGTHS(&cbp_tab, CBP_VLC_BITS, FF_ARRAY_ELEMS(cbp_bits),
660+ VLC_INIT_STATIC_FROM_LENGTHS(&cbp_tab, CBP_VLC_BITS, FF_ARRAY_ELEMS(cbp_bits),
661661 cbp_bits, 1, NULL, 0, 0, 0, 0, 1 << CBP_VLC_BITS);
662662 }
663663
libavcodec/mvha.c+3−3
@@ -83,7 +83,7 @@ static int build_vlc(AVCodecContext *avctx, VLC *vlc) · 82 unmodified lines
8383 uint8_t xlat[256];
8484 int cur_node, i, j, pos = 0;
8585
86− ff_free_vlc(vlc);
86+ ff_vlc_free(vlc);
8787
8888 for (i = 0; i < s->nb_symbols; i++) {
8989 nodes[i].count = s->prob[i];
@@ -140,7 +140,7 @@ static int build_vlc(AVCodecContext *avctx, VLC *vlc) · 50 unmodified lines
140140
141141 get_tree_codes(bits, lens, xlat, nodes, cur_node - 1, 0, 0, &pos);
142142
143− return ff_init_vlc_sparse(vlc, 12, pos, lens, 2, 2, bits, 4, 4, xlat, 1, 1, 0);
143+ return ff_vlc_init_sparse(vlc, 12, pos, lens, 2, 2, bits, 4, 4, xlat, 1, 1, 0);
144144 }
145145
146146 static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
@@ -294,7 +294,7 @@ static av_cold int decode_close(AVCodecContext *avctx) · 147 unmodified lines
294294 MVHAContext *s = avctx->priv_data;
295295
296296 ff_inflate_end(&s->zstream);
297− ff_free_vlc(&s->vlc);
297+ ff_vlc_free(&s->vlc);
298298
299299 return 0;
300300 }
libavcodec/on2avc.c+4−4
@@ -892,9 +892,9 @@ static av_cold void on2avc_free_vlcs(On2AVCContext *c) · 891 unmodified lines
892892 {
893893 int i;
894894
895− ff_free_vlc(&c->scale_diff);
895+ ff_vlc_free(&c->scale_diff);
896896 for (i = 1; i < 16; i++)
897− ff_free_vlc(&c->cb_vlc[i]);
897+ ff_vlc_free(&c->cb_vlc[i]);
898898 }
899899
900900 static av_cold int on2avc_decode_init(AVCodecContext *avctx)
@@ -969,14 +969,14 @@ static av_cold int on2avc_decode_init(AVCodecContext *avctx) · 68 unmodified lines
969969 if (!c->fdsp)
970970 return AVERROR(ENOMEM);
971971
972− ret = ff_init_vlc_from_lengths(&c->scale_diff, 9, ON2AVC_SCALE_DIFFS,
972+ ret = ff_vlc_init_from_lengths(&c->scale_diff, 9, ON2AVC_SCALE_DIFFS,
973973 ff_on2avc_scale_diff_bits, 1,
974974 ff_on2avc_scale_diff_syms, 1, 1, -60, 0, avctx);
975975 if (ret < 0)
976976 goto vlc_fail;
977977 for (i = 1; i < 16; i++) {
978978 int idx = i - 1;
979− ret = ff_init_vlc_from_lengths(&c->cb_vlc[i], 9, ff_on2avc_cb_elems[idx],
979+ ret = ff_vlc_init_from_lengths(&c->cb_vlc[i], 9, ff_on2avc_cb_elems[idx],
980980 lens, 1,
981981 syms, 2, 2, 0, 0, avctx);
982982 if (ret < 0)
libavcodec/photocd.c+3−3
@@ -210,8 +210,8 @@ static av_noinline int read_hufftable(AVCodecContext *avctx, VLC *vlc) · 209 unmodified lines
210210 s->syms[j] = sym;
211211 }
212212
213− ff_free_vlc(vlc);
214− ret = ff_init_vlc_sparse(vlc, 12, count,
213+ ff_vlc_free(vlc);
214+ ret = ff_vlc_init_sparse(vlc, 12, count,
215215 s->bits, sizeof(*s->bits), sizeof(*s->bits),
216216 s->codes, sizeof(*s->codes), sizeof(*s->codes),
217217 s->syms, sizeof(*s->syms), sizeof(*s->syms), 0);
@@ -438,7 +438,7 @@ static av_cold int photocd_decode_close(AVCodecContext *avctx) · 220 unmodified lines
438438 PhotoCDContext *s = avctx->priv_data;
439439
440440 for (int i = 0; i < 3; i++)
441− ff_free_vlc(&s->vlc[i]);
441+ ff_vlc_free(&s->vlc[i]);
442442
443443 return 0;
444444 }
libavcodec/qdm2_tablegen.h+2−2
@@ -116,9 +116,9 @@ static av_cold void build_vlc(VLC *vlc, int nb_bits, int nb_codes, · 115 unmodified lines
116116 {
117117 vlc->table = &qdm2_table[*offset];
118118 vlc->table_allocated = FF_ARRAY_ELEMS(qdm2_table) - *offset;
119− ff_init_vlc_from_lengths(vlc, nb_bits, nb_codes,
119+ ff_vlc_init_from_lengths(vlc, nb_bits, nb_codes,
120120 &tab[0][1], 2, &tab[0][0], 2, 1,
121− -1, INIT_VLC_STATIC_OVERLONG | INIT_VLC_LE, NULL);
121+ -1, VLC_INIT_STATIC_OVERLONG | VLC_INIT_LE, NULL);
122122 *offset += vlc->table_size;
123123 }
124124
libavcodec/qdmc.c+2−2
@@ -172,9 +172,9 @@ static av_cold void qdmc_init_static_data(void) · 171 unmodified lines
172172 static VLCElem vlc_buffer[13698];
173173 vtable[i].table = &vlc_buffer[offset];
174174 vtable[i].table_allocated = FF_ARRAY_ELEMS(vlc_buffer) - offset;
175− ff_init_vlc_from_lengths(&vtable[i], huff_bits[i], huff_sizes[i],
175+ ff_vlc_init_from_lengths(&vtable[i], huff_bits[i], huff_sizes[i],
176176 &hufftab[0][1], 2, &hufftab[0][0], 2, 1, -1,
177− INIT_VLC_LE | INIT_VLC_STATIC_OVERLONG, NULL);
177+ VLC_INIT_LE | VLC_INIT_STATIC_OVERLONG, NULL);
178178 hufftab += huff_sizes[i];
179179 offset += vtable[i].table_size;
180180 }
libavcodec/ralf.c+7−7
@@ -99,7 +99,7 @@ static av_cold int init_ralf_vlc(VLC *vlc, const uint8_t *data, int elems) · 98 unmodified lines
9999 for (i = 0; i < elems; i++)
100100 codes[i] = prefixes[lens[i]]++;
101101
102− return ff_init_vlc_sparse(vlc, FFMIN(max_bits, 9), elems,
102+ return ff_vlc_init_sparse(vlc, FFMIN(max_bits, 9), elems,
103103 lens, 1, 1, codes, 2, 2, NULL, 0, 0, 0);
104104 }
105105
@@ -109,16 +109,16 @@ static av_cold int decode_close(AVCodecContext *avctx) · 3 unmodified lines
109109 int i, j, k;
110110
111111 for (i = 0; i < 3; i++) {
112− ff_free_vlc(&ctx->sets[i].filter_params);
113− ff_free_vlc(&ctx->sets[i].bias);
114− ff_free_vlc(&ctx->sets[i].coding_mode);
112+ ff_vlc_free(&ctx->sets[i].filter_params);
113+ ff_vlc_free(&ctx->sets[i].bias);
114+ ff_vlc_free(&ctx->sets[i].coding_mode);
115115 for (j = 0; j < 10; j++)
116116 for (k = 0; k < 11; k++)
117− ff_free_vlc(&ctx->sets[i].filter_coeffs[j][k]);
117+ ff_vlc_free(&ctx->sets[i].filter_coeffs[j][k]);
118118 for (j = 0; j < 15; j++)
119− ff_free_vlc(&ctx->sets[i].short_codes[j]);
119+ ff_vlc_free(&ctx->sets[i].short_codes[j]);
120120 for (j = 0; j < 125; j++)
121− ff_free_vlc(&ctx->sets[i].long_codes[j]);
121+ ff_vlc_free(&ctx->sets[i].long_codes[j]);
122122 }
123123
124124 return 0;
libavcodec/rl.c+3−1
@@ -82,7 +82,9 @@ av_cold void ff_rl_init_vlc(RLTable *rl, unsigned static_size) · 81 unmodified lines
8282 VLCElem table[1500] = { 0 };
8383 VLC vlc = { .table = table, .table_allocated = static_size };
8484 av_assert0(static_size <= FF_ARRAY_ELEMS(table));
85− init_vlc(&vlc, 9, rl->n + 1, &rl->table_vlc[0][1], 4, 2, &rl->table_vlc[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC);
85+ vlc_init(&vlc, 9, rl->n + 1,
86+ &rl->table_vlc[0][1], 4, 2,
87+ &rl->table_vlc[0][0], 4, 2, VLC_INIT_USE_STATIC);
8688
8789 for (q = 0; q < 32; q++) {
8890 int qmul = q * 2;
libavcodec/rl.h+1−1
@@ -80,7 +80,7 @@ void ff_rl_init(RLTable *rl, uint8_t static_store[2][2*MAX_RUN + MAX_LEVEL + 3]) · 79 unmodified lines
8080 */
8181 void ff_rl_init_vlc(RLTable *rl, unsigned static_size);
8282
83−#define INIT_VLC_RL(rl, static_size)\
83+#define VLC_INIT_RL(rl, static_size)\
8484 {\
8585 static RL_VLC_ELEM rl_vlc_table[32][static_size];\
8686 \
libavcodec/rv10.c+2−2
@@ -334,8 +334,8 @@ static av_cold void rv10_build_vlc(VLC *vlc, const uint16_t len_count[15], · 333 unmodified lines
334334 for (unsigned tmp = nb_lens + len_count[i]; nb_lens < tmp; nb_lens++)
335335 lens[nb_lens] = i + 2;
336336 av_assert1(nb_lens == nb_syms);
337− ff_init_vlc_from_lengths(vlc, DC_VLC_BITS, nb_lens, lens, 1,
338− syms, 2, 2, 0, INIT_VLC_STATIC_OVERLONG, NULL);
337+ ff_vlc_init_from_lengths(vlc, DC_VLC_BITS, nb_lens, lens, 1,
338+ syms, 2, 2, 0, VLC_INIT_STATIC_OVERLONG, NULL);
339339 }
340340
341341 static av_cold void rv10_init_static(void)
libavcodec/rv34.c+2−2
@@ -113,10 +113,10 @@ static void rv34_gen_vlc(const uint8_t *bits, int size, VLC *vlc, const uint8_t · 112 unmodified lines
113113
114114 vlc->table = &table_data[*offset];
115115 vlc->table_allocated = FF_ARRAY_ELEMS(table_data) - *offset;
116− ff_init_vlc_sparse(vlc, FFMIN(maxbits, 9), size,
116+ ff_vlc_init_sparse(vlc, FFMIN(maxbits, 9), size,
117117 bits, 1, 1,
118118 cw, 2, 2,
119− syms, !!syms, !!syms, INIT_VLC_STATIC_OVERLONG);
119+ syms, !!syms, !!syms, VLC_INIT_STATIC_OVERLONG);
120120 *offset += vlc->table_size;
121121 }
122122
libavcodec/rv40.c+4−4
@@ -53,9 +53,9 @@ static av_cold void rv40_init_table(VLC *vlc, unsigned *offset, int nb_bits, · 52 unmodified lines
5353 vlc->table_allocated = 1 << nb_bits;
5454 *offset += 1 << nb_bits;
5555
56− ff_init_vlc_from_lengths(vlc, nb_bits, nb_codes,
56+ ff_vlc_init_from_lengths(vlc, nb_bits, nb_codes,
5757 &tab[0][1], 2, &tab[0][0], 2, 1,
58− 0, INIT_VLC_USE_NEW_STATIC, NULL);
58+ 0, VLC_INIT_USE_STATIC, NULL);
5959 }
6060
6161 /**
@@ -87,9 +87,9 @@ static av_cold void rv40_init_tables(void) · 25 unmodified lines
8787 }
8888 aic_mode2_vlc[i].table = &aic_mode2_table[offset];
8989 aic_mode2_vlc[i].table_allocated = FF_ARRAY_ELEMS(aic_mode2_table) - offset;
90− ff_init_vlc_from_lengths(&aic_mode2_vlc[i], AIC_MODE2_BITS, AIC_MODE2_SIZE,
90+ ff_vlc_init_from_lengths(&aic_mode2_vlc[i], AIC_MODE2_BITS, AIC_MODE2_SIZE,
9191 aic_mode2_vlc_bits[i], 1,
92− syms, 2, 2, 0, INIT_VLC_STATIC_OVERLONG, NULL);
92+ syms, 2, 2, 0, VLC_INIT_STATIC_OVERLONG, NULL);
9393 offset += aic_mode2_vlc[i].table_size;
9494 }
9595 for(i = 0; i < NUM_PTYPE_VLCS; i++){
libavcodec/sheervideo.c+4−4
@@ -1796,8 +1796,8 @@ static av_cold int build_vlc(VLC *vlc, const SheerTable *table) · 1795 unmodified lines
17961796 lens[count] = len;
17971797 }
17981798
1799− ff_free_vlc(vlc);
1800− return ff_init_vlc_from_lengths(vlc, SHEER_VLC_BITS, count,
1799+ ff_vlc_free(vlc);
1800+ return ff_vlc_init_from_lengths(vlc, SHEER_VLC_BITS, count,
18011801 lens, sizeof(*lens), NULL, 0, 0, 0, 0, NULL);
18021802 }
18031803
@@ -1992,8 +1992,8 @@ static av_cold int decode_end(AVCodecContext *avctx) · 188 unmodified lines
19921992 {
19931993 SheerVideoContext *s = avctx->priv_data;
19941994
1995− ff_free_vlc(&s->vlc[0]);
1996− ff_free_vlc(&s->vlc[1]);
1995+ ff_vlc_free(&s->vlc[0]);
1996+ ff_vlc_free(&s->vlc[1]);
19971997
19981998 return 0;
19991999 }
libavcodec/smacker.c+6−6
@@ -220,10 +220,10 @@ static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int · 219 unmodified lines
220220 goto error;
221221 skip_bits1(gb);
222222 if (h.current > 1) {
223− err = ff_init_vlc_from_lengths(&vlc[i], SMKTREE_BITS, h.current,
223+ err = ff_vlc_init_from_lengths(&vlc[i], SMKTREE_BITS, h.current,
224224 &h.entries[0].length, sizeof(*h.entries),
225225 &h.entries[0].value, sizeof(*h.entries), 1,
226− 0, INIT_VLC_OUTPUT_LE, smk->avctx);
226+ 0, VLC_INIT_OUTPUT_LE, smk->avctx);
227227 if (err < 0) {
228228 av_log(smk->avctx, AV_LOG_ERROR, "Cannot build VLC table\n");
229229 goto error;
@@ -264,7 +264,7 @@ static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int · 34 unmodified lines
264264 err = 0;
265265 error:
266266 for (int i = 0; i < 2; i++) {
267− ff_free_vlc(&vlc[i]);
267+ ff_vlc_free(&vlc[i]);
268268 }
269269
270270 return err;
@@ -659,10 +659,10 @@ static int smka_decode_frame(AVCodecContext *avctx, AVFrame *frame, · 388 unmodified lines
659659 goto error;
660660 skip_bits1(&gb);
661661 if (h.current > 1) {
662− ret = ff_init_vlc_from_lengths(&vlc[i], SMKTREE_BITS, h.current,
662+ ret = ff_vlc_init_from_lengths(&vlc[i], SMKTREE_BITS, h.current,
663663 &h.entries[0].length, sizeof(*h.entries),
664664 &h.entries[0].value, sizeof(*h.entries), 1,
665− 0, INIT_VLC_OUTPUT_LE, avctx);
665+ 0, VLC_INIT_OUTPUT_LE, avctx);
666666 if (ret < 0) {
667667 av_log(avctx, AV_LOG_ERROR, "Cannot build VLC table\n");
668668 goto error;
@@ -740,7 +740,7 @@ static int smka_decode_frame(AVCodecContext *avctx, AVFrame *frame, · 71 unmodified lines
740740
741741 error:
742742 for(i = 0; i < 4; i++) {
743− ff_free_vlc(&vlc[i]);
743+ ff_vlc_free(&vlc[i]);
744744 }
745745
746746 return ret;
libavcodec/speedhqdec.c+7−7
@@ -506,7 +506,7 @@ static av_cold void compute_alpha_vlcs(void) · 505 unmodified lines
506506
507507 av_assert0(entry == FF_ARRAY_ELEMS(run_code));
508508
509− INIT_LE_VLC_SPARSE_STATIC(&dc_alpha_run_vlc_le, ALPHA_VLC_BITS,
509+ VLC_INIT_LE_SPARSE_STATIC(&dc_alpha_run_vlc_le, ALPHA_VLC_BITS,
510510 FF_ARRAY_ELEMS(run_code),
511511 run_bits, 1, 1,
512512 run_code, 2, 2,
@@ -546,7 +546,7 @@ static av_cold void compute_alpha_vlcs(void) · 33 unmodified lines
546546
547547 av_assert0(entry == FF_ARRAY_ELEMS(level_code));
548548
549− INIT_LE_VLC_SPARSE_STATIC(&dc_alpha_level_vlc_le, ALPHA_VLC_BITS,
549+ VLC_INIT_LE_SPARSE_STATIC(&dc_alpha_level_vlc_le, ALPHA_VLC_BITS,
550550 FF_ARRAY_ELEMS(level_code),
551551 level_bits, 1, 1,
552552 level_code, 2, 2,
@@ -556,18 +556,18 @@ static av_cold void compute_alpha_vlcs(void) · 3 unmodified lines
556556 static av_cold void speedhq_static_init(void)
557557 {
558558 /* Exactly the same as MPEG-2, except for a little-endian reader. */
559− INIT_CUSTOM_VLC_STATIC(&dc_lum_vlc_le, DC_VLC_BITS, 12,
559+ VLC_INIT_CUSTOM_STATIC(&dc_lum_vlc_le, DC_VLC_BITS, 12,
560560 ff_mpeg12_vlc_dc_lum_bits, 1, 1,
561561 ff_mpeg12_vlc_dc_lum_code, 2, 2,
562− INIT_VLC_OUTPUT_LE, 512);
563− INIT_CUSTOM_VLC_STATIC(&dc_chroma_vlc_le, DC_VLC_BITS, 12,
562+ VLC_INIT_OUTPUT_LE, 512);
563+ VLC_INIT_CUSTOM_STATIC(&dc_chroma_vlc_le, DC_VLC_BITS, 12,
564564 ff_mpeg12_vlc_dc_chroma_bits, 1, 1,
565565 ff_mpeg12_vlc_dc_chroma_code, 2, 2,
566− INIT_VLC_OUTPUT_LE, 514);
566+ VLC_INIT_OUTPUT_LE, 514);
567567
568568 ff_init_2d_vlc_rl(ff_speedhq_vlc_table, speedhq_rl_vlc, ff_speedhq_run,
569569 ff_speedhq_level, SPEEDHQ_RL_NB_ELEMS,
570− FF_ARRAY_ELEMS(speedhq_rl_vlc), INIT_VLC_LE);
570+ FF_ARRAY_ELEMS(speedhq_rl_vlc), VLC_INIT_LE);
571571
572572 compute_alpha_vlcs();
573573 }
libavcodec/svq1dec.c+8−8
@@ -777,11 +777,11 @@ static int svq1_decode_frame(AVCodecContext *avctx, AVFrame *cur, · 776 unmodified lines
777777
778778 static av_cold void svq1_static_init(void)
779779 {
780− INIT_VLC_STATIC(&svq1_block_type, SVQ1_BLOCK_TYPE_VLC_BITS, 4,
780+ VLC_INIT_STATIC(&svq1_block_type, SVQ1_BLOCK_TYPE_VLC_BITS, 4,
781781 &ff_svq1_block_type_vlc[0][1], 2, 1,
782782 &ff_svq1_block_type_vlc[0][0], 2, 1, 8);
783783
784− INIT_VLC_STATIC(&svq1_motion_component, 7, 33,
784+ VLC_INIT_STATIC(&svq1_motion_component, 7, 33,
785785 &ff_mvtab[0][1], 2, 1,
786786 &ff_mvtab[0][0], 2, 1, 176);
787787
@@ -792,24 +792,24 @@ static av_cold void svq1_static_init(void) · 4 unmodified lines
792792 svq1_intra_multistage[i].table = &table[offset];
793793 svq1_intra_multistage[i].table_allocated = sizes[0][i];
794794 offset += sizes[0][i];
795− init_vlc(&svq1_intra_multistage[i], 3, 8,
795+ vlc_init(&svq1_intra_multistage[i], 3, 8,
796796 &ff_svq1_intra_multistage_vlc[i][0][1], 2, 1,
797797 &ff_svq1_intra_multistage_vlc[i][0][0], 2, 1,
798− INIT_VLC_USE_NEW_STATIC);
798+ VLC_INIT_USE_STATIC);
799799 svq1_inter_multistage[i].table = &table[offset];
800800 svq1_inter_multistage[i].table_allocated = sizes[1][i];
801801 offset += sizes[1][i];
802− init_vlc(&svq1_inter_multistage[i], 3, 8,
802+ vlc_init(&svq1_inter_multistage[i], 3, 8,
803803 &ff_svq1_inter_multistage_vlc[i][0][1], 2, 1,
804804 &ff_svq1_inter_multistage_vlc[i][0][0], 2, 1,
805− INIT_VLC_USE_NEW_STATIC);
805+ VLC_INIT_USE_STATIC);
806806 }
807807
808− INIT_VLC_STATIC(&svq1_intra_mean, 8, 256,
808+ VLC_INIT_STATIC(&svq1_intra_mean, 8, 256,
809809 &ff_svq1_intra_mean_vlc[0][1], 4, 2,
810810 &ff_svq1_intra_mean_vlc[0][0], 4, 2, 632);
811811
812− INIT_VLC_STATIC(&svq1_inter_mean, 9, 512,
812+ VLC_INIT_STATIC(&svq1_inter_mean, 9, 512,
813813 &ff_svq1_inter_mean_vlc[0][1], 4, 2,
814814 &ff_svq1_inter_mean_vlc[0][0], 4, 2, 1434);
815815 }
libavcodec/truemotion2.c+2−2
@@ -198,7 +198,7 @@ static int tm2_build_huff_table(TM2Context *ctx, TM2Codes *code) · 197 unmodified lines
198198
199199 /* convert codes to vlc_table */
200200 if (res >= 0) {
201− res = ff_init_vlc_from_lengths(&code->vlc, huff.max_bits, huff.max_num,
201+ res = ff_vlc_init_from_lengths(&code->vlc, huff.max_bits, huff.max_num,
202202 huff.lens, sizeof(huff.lens[0]),
203203 NULL, 0, 0, 0, 0, ctx->avctx);
204204 if (res < 0)
@@ -223,7 +223,7 @@ static void tm2_free_codes(TM2Codes *code) · 18 unmodified lines
223223 {
224224 av_free(code->recode);
225225 if (code->vlc.table)
226− ff_free_vlc(&code->vlc);
226+ ff_vlc_free(&code->vlc);
227227 }
228228
229229 static inline int tm2_get_token(GetBitContext *gb, TM2Codes *code)
libavcodec/tscc2.c+2−2
@@ -61,9 +61,9 @@ static av_cold void tscc2_init_vlc(VLC *vlc, int *offset, int nb_codes, · 60 unmodified lines
6161
6262 vlc->table = &vlc_buf[*offset];
6363 vlc->table_allocated = FF_ARRAY_ELEMS(vlc_buf) - *offset;
64− ff_init_vlc_from_lengths(vlc, TSCC2_VLC_BITS, nb_codes,
64+ ff_vlc_init_from_lengths(vlc, TSCC2_VLC_BITS, nb_codes,
6565 lens, 1, syms, sym_length, sym_length, 0,
66− INIT_VLC_STATIC_OVERLONG | INIT_VLC_OUTPUT_LE, NULL);
66+ VLC_INIT_STATIC_OVERLONG | VLC_INIT_OUTPUT_LE, NULL);
6767 *offset += vlc->table_size;
6868 }
6969
libavcodec/utvideodec.c+9−9
@@ -82,7 +82,7 @@ static int build_huff(UtvideoContext *c, const uint8_t *src, VLC *vlc, · 81 unmodified lines
8282 he[--codes_count[bits[i]]] = (HuffEntry) { bits[i], i };
8383
8484 #define VLC_BITS 11
85− return ff_init_vlc_multi_from_lengths(vlc, multi, VLC_BITS, nb_elems, codes_count[0],
85+ return ff_vlc_init_multi_from_lengths(vlc, multi, VLC_BITS, nb_elems, codes_count[0],
8686 &he[0].len, sizeof(*he),
8787 &he[0].sym, sizeof(*he), 2, 0, 0, c->avctx);
8888 }
@@ -188,13 +188,13 @@ static int decode_plane10(UtvideoContext *c, int plane_no, · 99 unmodified lines
188188 "%d bits left after decoding slice\n", get_bits_left(&gb));
189189 }
190190
191− ff_free_vlc(&vlc);
192− ff_free_vlc_multi(&multi);
191+ ff_vlc_free(&vlc);
192+ ff_vlc_free_multi(&multi);
193193
194194 return 0;
195195 fail:
196− ff_free_vlc(&vlc);
197− ff_free_vlc_multi(&multi);
196+ ff_vlc_free(&vlc);
197+ ff_vlc_free_multi(&multi);
198198 return AVERROR_INVALIDDATA;
199199 }
200200
@@ -333,13 +333,13 @@ static int decode_plane(UtvideoContext *c, int plane_no, · 132 unmodified lines
333333 "%d bits left after decoding slice\n", get_bits_left(&gb));
334334 }
335335
336− ff_free_vlc(&vlc);
337− ff_free_vlc_multi(&multi);
336+ ff_vlc_free(&vlc);
337+ ff_vlc_free_multi(&multi);
338338
339339 return 0;
340340 fail:
341− ff_free_vlc(&vlc);
342− ff_free_vlc_multi(&multi);
341+ ff_vlc_free(&vlc);
342+ ff_vlc_free_multi(&multi);
343343 return AVERROR_INVALIDDATA;
344344 }
345345
libavcodec/vc1dec.c+33−33
@@ -484,108 +484,108 @@ static av_cold void vc1_init_static(void) · 483 unmodified lines
484484 {
485485 static VLCElem vlc_table[32372];
486486
487− INIT_VLC_STATIC(&ff_vc1_norm2_vlc, VC1_NORM2_VLC_BITS, 4,
487+ VLC_INIT_STATIC(&ff_vc1_norm2_vlc, VC1_NORM2_VLC_BITS, 4,
488488 vc1_norm2_bits, 1, 1,
489489 vc1_norm2_codes, 1, 1, 1 << VC1_NORM2_VLC_BITS);
490− INIT_VLC_STATIC(&ff_vc1_norm6_vlc, VC1_NORM6_VLC_BITS, 64,
490+ VLC_INIT_STATIC(&ff_vc1_norm6_vlc, VC1_NORM6_VLC_BITS, 64,
491491 vc1_norm6_bits, 1, 1,
492492 vc1_norm6_codes, 2, 2, 556);
493− INIT_VLC_STATIC(&ff_vc1_imode_vlc, VC1_IMODE_VLC_BITS, 7,
493+ VLC_INIT_STATIC(&ff_vc1_imode_vlc, VC1_IMODE_VLC_BITS, 7,
494494 vc1_imode_bits, 1, 1,
495495 vc1_imode_codes, 1, 1, 1 << VC1_IMODE_VLC_BITS);
496496 for (int i = 0; i < 3; i++) {
497497 ff_vc1_ttmb_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 0]];
498498 ff_vc1_ttmb_vlc[i].table_allocated = vlc_offs[i * 3 + 1] - vlc_offs[i * 3 + 0];
499− init_vlc(&ff_vc1_ttmb_vlc[i], VC1_TTMB_VLC_BITS, 16,
499+ vlc_init(&ff_vc1_ttmb_vlc[i], VC1_TTMB_VLC_BITS, 16,
500500 vc1_ttmb_bits[i], 1, 1,
501− vc1_ttmb_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
501+ vc1_ttmb_codes[i], 2, 2, VLC_INIT_USE_STATIC);
502502 ff_vc1_ttblk_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 1]];
503503 ff_vc1_ttblk_vlc[i].table_allocated = vlc_offs[i * 3 + 2] - vlc_offs[i * 3 + 1];
504− init_vlc(&ff_vc1_ttblk_vlc[i], VC1_TTBLK_VLC_BITS, 8,
504+ vlc_init(&ff_vc1_ttblk_vlc[i], VC1_TTBLK_VLC_BITS, 8,
505505 vc1_ttblk_bits[i], 1, 1,
506− vc1_ttblk_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
506+ vc1_ttblk_codes[i], 1, 1, VLC_INIT_USE_STATIC);
507507 ff_vc1_subblkpat_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 2]];
508508 ff_vc1_subblkpat_vlc[i].table_allocated = vlc_offs[i * 3 + 3] - vlc_offs[i * 3 + 2];
509− init_vlc(&ff_vc1_subblkpat_vlc[i], VC1_SUBBLKPAT_VLC_BITS, 15,
509+ vlc_init(&ff_vc1_subblkpat_vlc[i], VC1_SUBBLKPAT_VLC_BITS, 15,
510510 vc1_subblkpat_bits[i], 1, 1,
511− vc1_subblkpat_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
511+ vc1_subblkpat_codes[i], 1, 1, VLC_INIT_USE_STATIC);
512512 }
513513 for (int i = 0; i < 4; i++) {
514514 ff_vc1_4mv_block_pattern_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 9]];
515515 ff_vc1_4mv_block_pattern_vlc[i].table_allocated = vlc_offs[i * 3 + 10] - vlc_offs[i * 3 + 9];
516− init_vlc(&ff_vc1_4mv_block_pattern_vlc[i], VC1_4MV_BLOCK_PATTERN_VLC_BITS, 16,
516+ vlc_init(&ff_vc1_4mv_block_pattern_vlc[i], VC1_4MV_BLOCK_PATTERN_VLC_BITS, 16,
517517 vc1_4mv_block_pattern_bits[i], 1, 1,
518− vc1_4mv_block_pattern_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
518+ vc1_4mv_block_pattern_codes[i], 1, 1, VLC_INIT_USE_STATIC);
519519 ff_vc1_cbpcy_p_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 10]];
520520 ff_vc1_cbpcy_p_vlc[i].table_allocated = vlc_offs[i * 3 + 11] - vlc_offs[i * 3 + 10];
521− init_vlc(&ff_vc1_cbpcy_p_vlc[i], VC1_CBPCY_P_VLC_BITS, 64,
521+ vlc_init(&ff_vc1_cbpcy_p_vlc[i], VC1_CBPCY_P_VLC_BITS, 64,
522522 vc1_cbpcy_p_bits[i], 1, 1,
523− vc1_cbpcy_p_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
523+ vc1_cbpcy_p_codes[i], 2, 2, VLC_INIT_USE_STATIC);
524524 ff_vc1_mv_diff_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 11]];
525525 ff_vc1_mv_diff_vlc[i].table_allocated = vlc_offs[i * 3 + 12] - vlc_offs[i * 3 + 11];
526− init_vlc(&ff_vc1_mv_diff_vlc[i], VC1_MV_DIFF_VLC_BITS, 73,
526+ vlc_init(&ff_vc1_mv_diff_vlc[i], VC1_MV_DIFF_VLC_BITS, 73,
527527 vc1_mv_diff_bits[i], 1, 1,
528− vc1_mv_diff_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
528+ vc1_mv_diff_codes[i], 2, 2, VLC_INIT_USE_STATIC);
529529 }
530530 for (int i = 0; i < 8; i++) {
531531 ff_vc1_ac_coeff_table[i].table = &vlc_table[vlc_offs[i * 2 + 21]];
532532 ff_vc1_ac_coeff_table[i].table_allocated = vlc_offs[i * 2 + 22] - vlc_offs[i * 2 + 21];
533− init_vlc(&ff_vc1_ac_coeff_table[i], AC_VLC_BITS, ff_vc1_ac_sizes[i],
533+ vlc_init(&ff_vc1_ac_coeff_table[i], AC_VLC_BITS, ff_vc1_ac_sizes[i],
534534 &vc1_ac_tables[i][0][1], 8, 4,
535− &vc1_ac_tables[i][0][0], 8, 4, INIT_VLC_USE_NEW_STATIC);
535+ &vc1_ac_tables[i][0][0], 8, 4, VLC_INIT_USE_STATIC);
536536 /* initialize interlaced MVDATA tables (2-Ref) */
537537 ff_vc1_2ref_mvdata_vlc[i].table = &vlc_table[vlc_offs[i * 2 + 22]];
538538 ff_vc1_2ref_mvdata_vlc[i].table_allocated = vlc_offs[i * 2 + 23] - vlc_offs[i * 2 + 22];
539− init_vlc(&ff_vc1_2ref_mvdata_vlc[i], VC1_2REF_MVDATA_VLC_BITS, 126,
539+ vlc_init(&ff_vc1_2ref_mvdata_vlc[i], VC1_2REF_MVDATA_VLC_BITS, 126,
540540 vc1_2ref_mvdata_bits[i], 1, 1,
541− vc1_2ref_mvdata_codes[i], 4, 4, INIT_VLC_USE_NEW_STATIC);
541+ vc1_2ref_mvdata_codes[i], 4, 4, VLC_INIT_USE_STATIC);
542542 }
543543 for (int i = 0; i < 4; i++) {
544544 /* initialize 4MV MBMODE VLC tables for interlaced frame P picture */
545545 ff_vc1_intfr_4mv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 37]];
546546 ff_vc1_intfr_4mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 38] - vlc_offs[i * 3 + 37];
547− init_vlc(&ff_vc1_intfr_4mv_mbmode_vlc[i], VC1_INTFR_4MV_MBMODE_VLC_BITS, 15,
547+ vlc_init(&ff_vc1_intfr_4mv_mbmode_vlc[i], VC1_INTFR_4MV_MBMODE_VLC_BITS, 15,
548548 vc1_intfr_4mv_mbmode_bits[i], 1, 1,
549− vc1_intfr_4mv_mbmode_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
549+ vc1_intfr_4mv_mbmode_codes[i], 2, 2, VLC_INIT_USE_STATIC);
550550 /* initialize NON-4MV MBMODE VLC tables for the same */
551551 ff_vc1_intfr_non4mv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 38]];
552552 ff_vc1_intfr_non4mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 39] - vlc_offs[i * 3 + 38];
553− init_vlc(&ff_vc1_intfr_non4mv_mbmode_vlc[i], VC1_INTFR_NON4MV_MBMODE_VLC_BITS, 9,
553+ vlc_init(&ff_vc1_intfr_non4mv_mbmode_vlc[i], VC1_INTFR_NON4MV_MBMODE_VLC_BITS, 9,
554554 vc1_intfr_non4mv_mbmode_bits[i], 1, 1,
555− vc1_intfr_non4mv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
555+ vc1_intfr_non4mv_mbmode_codes[i], 1, 1, VLC_INIT_USE_STATIC);
556556 /* initialize interlaced MVDATA tables (1-Ref) */
557557 ff_vc1_1ref_mvdata_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 39]];
558558 ff_vc1_1ref_mvdata_vlc[i].table_allocated = vlc_offs[i * 3 + 40] - vlc_offs[i * 3 + 39];
559− init_vlc(&ff_vc1_1ref_mvdata_vlc[i], VC1_1REF_MVDATA_VLC_BITS, 72,
559+ vlc_init(&ff_vc1_1ref_mvdata_vlc[i], VC1_1REF_MVDATA_VLC_BITS, 72,
560560 vc1_1ref_mvdata_bits[i], 1, 1,
561− vc1_1ref_mvdata_codes[i], 4, 4, INIT_VLC_USE_NEW_STATIC);
561+ vc1_1ref_mvdata_codes[i], 4, 4, VLC_INIT_USE_STATIC);
562562 }
563563 for (int i = 0; i < 4; i++) {
564564 /* Initialize 2MV Block pattern VLC tables */
565565 ff_vc1_2mv_block_pattern_vlc[i].table = &vlc_table[vlc_offs[i + 49]];
566566 ff_vc1_2mv_block_pattern_vlc[i].table_allocated = vlc_offs[i + 50] - vlc_offs[i + 49];
567− init_vlc(&ff_vc1_2mv_block_pattern_vlc[i], VC1_2MV_BLOCK_PATTERN_VLC_BITS, 4,
567+ vlc_init(&ff_vc1_2mv_block_pattern_vlc[i], VC1_2MV_BLOCK_PATTERN_VLC_BITS, 4,
568568 vc1_2mv_block_pattern_bits[i], 1, 1,
569− vc1_2mv_block_pattern_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
569+ vc1_2mv_block_pattern_codes[i], 1, 1, VLC_INIT_USE_STATIC);
570570 }
571571 for (int i = 0; i < 8; i++) {
572572 /* Initialize interlaced CBPCY VLC tables (Table 124 - Table 131) */
573573 ff_vc1_icbpcy_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 53]];
574574 ff_vc1_icbpcy_vlc[i].table_allocated = vlc_offs[i * 3 + 54] - vlc_offs[i * 3 + 53];
575− init_vlc(&ff_vc1_icbpcy_vlc[i], VC1_ICBPCY_VLC_BITS, 63,
575+ vlc_init(&ff_vc1_icbpcy_vlc[i], VC1_ICBPCY_VLC_BITS, 63,
576576 vc1_icbpcy_p_bits[i], 1, 1,
577− vc1_icbpcy_p_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
577+ vc1_icbpcy_p_codes[i], 2, 2, VLC_INIT_USE_STATIC);
578578 /* Initialize interlaced field picture MBMODE VLC tables */
579579 ff_vc1_if_mmv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 54]];
580580 ff_vc1_if_mmv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 55] - vlc_offs[i * 3 + 54];
581− init_vlc(&ff_vc1_if_mmv_mbmode_vlc[i], VC1_IF_MMV_MBMODE_VLC_BITS, 8,
581+ vlc_init(&ff_vc1_if_mmv_mbmode_vlc[i], VC1_IF_MMV_MBMODE_VLC_BITS, 8,
582582 vc1_if_mmv_mbmode_bits[i], 1, 1,
583− vc1_if_mmv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
583+ vc1_if_mmv_mbmode_codes[i], 1, 1, VLC_INIT_USE_STATIC);
584584 ff_vc1_if_1mv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 55]];
585585 ff_vc1_if_1mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 56] - vlc_offs[i * 3 + 55];
586− init_vlc(&ff_vc1_if_1mv_mbmode_vlc[i], VC1_IF_1MV_MBMODE_VLC_BITS, 6,
586+ vlc_init(&ff_vc1_if_1mv_mbmode_vlc[i], VC1_IF_1MV_MBMODE_VLC_BITS, 6,
587587 vc1_if_1mv_mbmode_bits[i], 1, 1,
588− vc1_if_1mv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
588+ vc1_if_1mv_mbmode_codes[i], 1, 1, VLC_INIT_USE_STATIC);
589589 }
590590 ff_msmp4_vc1_vlcs_init_once();
591591 }
libavcodec/vlc.c+16−16
@@ -64,7 +64,7 @@ static int alloc_table(VLC *vlc, int size, int use_static) · 63 unmodified lines
6464 vlc->table_size += size;
6565 if (vlc->table_size > vlc->table_allocated) {
6666 if (use_static)
67− abort(); // cannot do anything, init_vlc() is used with too little memory
67+ abort(); // cannot do anything, vlc_init() is used with too little memory
6868 vlc->table_allocated += (1 << vlc->bits);
6969 vlc->table = av_realloc_f(vlc->table, vlc->table_allocated, sizeof(*vlc->table));
7070 if (!vlc->table) {
@@ -100,7 +100,7 @@ static int vlc_common_init(VLC *vlc, int nb_bits, int nb_codes, · 29 unmodified lines
100100 {
101101 vlc->bits = nb_bits;
102102 vlc->table_size = 0;
103− if (flags & INIT_VLC_USE_NEW_STATIC) {
103+ if (flags & VLC_INIT_USE_STATIC) {
104104 av_assert0(nb_codes <= LOCALBUF_ELEMS);
105105 } else {
106106 vlc->table = NULL;
@@ -144,7 +144,7 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes, · 37 unmodified lines
144144 if (table_nb_bits > 30)
145145 return AVERROR(EINVAL);
146146 table_size = 1 << table_nb_bits;
147− table_index = alloc_table(vlc, table_size, flags & INIT_VLC_USE_NEW_STATIC);
147+ table_index = alloc_table(vlc, table_size, flags & VLC_INIT_USE_STATIC);
148148 ff_dlog(NULL, "new table index=%d size=%d\n", table_index, table_size);
149149 if (table_index < 0)
150150 return table_index;
@@ -162,7 +162,7 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes, · 11 unmodified lines
162162 int nb = 1 << (table_nb_bits - n);
163163 int inc = 1;
164164
165− if (flags & INIT_VLC_OUTPUT_LE) {
165+ if (flags & VLC_INIT_OUTPUT_LE) {
166166 j = bitswap_32(code);
167167 inc = 1 << n;
168168 }
@@ -200,7 +200,7 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes, · 31 unmodified lines
200200 subtable_bits = FFMAX(subtable_bits, n);
201201 }
202202 subtable_bits = FFMIN(subtable_bits, table_nb_bits);
203− j = (flags & INIT_VLC_OUTPUT_LE) ? bitswap_32(code_prefix) >> (32 - table_nb_bits) : code_prefix;
203+ j = (flags & VLC_INIT_OUTPUT_LE) ? bitswap_32(code_prefix) >> (32 - table_nb_bits) : code_prefix;
204204 table[j].len = -subtable_bits;
205205 ff_dlog(NULL, "%4x: n=%d (subtable)\n",
206206 j, codes[i].bits + table_nb_bits);
@@ -231,9 +231,9 @@ static int vlc_common_end(VLC *vlc, int nb_bits, int nb_codes, VLCcode *codes, · 24 unmodified lines
231231 {
232232 int ret = build_table(vlc, nb_bits, nb_codes, codes, flags);
233233
234− if (flags & INIT_VLC_USE_NEW_STATIC) {
234+ if (flags & VLC_INIT_USE_STATIC) {
235235 if (vlc->table_size != vlc->table_allocated &&
236− !(flags & (INIT_VLC_STATIC_OVERLONG & ~INIT_VLC_USE_NEW_STATIC)))
236+ !(flags & (VLC_INIT_STATIC_OVERLONG & ~VLC_INIT_USE_STATIC)))
237237 av_log(NULL, AV_LOG_ERROR, "needed %d had %d\n", vlc->table_size, vlc->table_allocated);
238238 av_assert0(ret >= 0);
239239 } else {
@@ -247,7 +247,7 @@ static int vlc_common_end(VLC *vlc, int nb_bits, int nb_codes, VLCcode *codes, · 7 unmodified lines
247247 return 0;
248248 }
249249
250−int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes,
250+int ff_vlc_init_sparse(VLC *vlc, int nb_bits, int nb_codes,
251251 const void *bits, int bits_wrap, int bits_size,
252252 const void *codes, int codes_wrap, int codes_size,
253253 const void *symbols, int symbols_wrap, int symbols_size,
@@ -269,7 +269,7 @@ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, · 15 unmodified lines
269269 if (!(condition)) \
270270 continue; \
271271 if (len > 3*nb_bits || len > 32) { \
272− av_log(NULL, AV_LOG_ERROR, "Too long VLC (%u) in init_vlc\n", len);\
272+ av_log(NULL, AV_LOG_ERROR, "Too long VLC (%u) in vlc_init\n", len);\
273273 if (buf != localbuf) \
274274 av_free(buf); \
275275 return AVERROR(EINVAL); \
@@ -278,12 +278,12 @@ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, · 2 unmodified lines
278278 GET_DATA(buf[j].code, codes, i, codes_wrap, codes_size); \
279279 if (buf[j].code >= (1LL<<buf[j].bits)) { \
280280 av_log(NULL, AV_LOG_ERROR, "Invalid code %"PRIx32" for %d in " \
281− "init_vlc\n", buf[j].code, i); \
281+ "vlc_init\n", buf[j].code, i); \
282282 if (buf != localbuf) \
283283 av_free(buf); \
284284 return AVERROR(EINVAL); \
285285 } \
286− if (flags & INIT_VLC_INPUT_LE) \
286+ if (flags & VLC_INIT_INPUT_LE) \
287287 buf[j].code = bitswap_32(buf[j].code); \
288288 else \
289289 buf[j].code <<= 32 - buf[j].bits; \
@@ -294,7 +294,7 @@ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, · 4 unmodified lines
294294 j++; \
295295 }
296296 COPY(len > nb_bits);
297− // qsort is the slowest part of init_vlc, and could probably be improved or avoided
297+ // qsort is the slowest part of vlc_init, and could probably be improved or avoided
298298 AV_QSORT(buf, j, struct VLCcode, compare_vlcspec);
299299 COPY(len && len <= nb_bits);
300300 nb_codes = j;
@@ -303,7 +303,7 @@ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, · 2 unmodified lines
303303 flags, localbuf);
304304 }
305305
306−int ff_init_vlc_from_lengths(VLC *vlc, int nb_bits, int nb_codes,
306+int ff_vlc_init_from_lengths(VLC *vlc, int nb_bits, int nb_codes,
307307 const int8_t *lens, int lens_wrap,
308308 const void *symbols, int symbols_wrap, int symbols_size,
309309 int offset, int flags, void *logctx)
@@ -427,7 +427,7 @@ static int vlc_multi_gen(VLC_MULTI_ELEM *table, const VLC *single, · 117 unmodified lines
427427 return 0;
428428 }
429429
430−int ff_init_vlc_multi_from_lengths(VLC *vlc, VLC_MULTI *multi, int nb_bits, int nb_elems,
430+int ff_vlc_init_multi_from_lengths(VLC *vlc, VLC_MULTI *multi, int nb_bits, int nb_elems,
431431 int nb_codes, const int8_t *lens, int lens_wrap,
432432 const void *symbols, int symbols_wrap, int symbols_size,
433433 int offset, int flags, void *logctx)
@@ -481,12 +481,12 @@ fail: · 47 unmodified lines
481481 return AVERROR_INVALIDDATA;
482482 }
483483
484−void ff_free_vlc_multi(VLC_MULTI *vlc)
484+void ff_vlc_free_multi(VLC_MULTI *vlc)
485485 {
486486 av_freep(&vlc->table);
487487 }
488488
489−void ff_free_vlc(VLC *vlc)
489+void ff_vlc_free(VLC *vlc)
490490 {
491491 av_freep(&vlc->table);
492492 }
libavcodec/vlc.h+35−35
@@ -53,11 +53,11 @@ typedef struct RL_VLC_ELEM { · 52 unmodified lines
5353 uint8_t run;
5454 } RL_VLC_ELEM;
5555
56−#define init_vlc(vlc, nb_bits, nb_codes, \
56+#define vlc_init(vlc, nb_bits, nb_codes, \
5757 bits, bits_wrap, bits_size, \
5858 codes, codes_wrap, codes_size, \
5959 flags) \
60− ff_init_vlc_sparse(vlc, nb_bits, nb_codes, \
60+ ff_vlc_init_sparse(vlc, nb_bits, nb_codes, \
6161 bits, bits_wrap, bits_size, \
6262 codes, codes_wrap, codes_size, \
6363 NULL, 0, 0, flags)
@@ -86,12 +86,12 @@ typedef struct RL_VLC_ELEM { · 22 unmodified lines
8686 * May be NULL, then 0, 1, 2, 3, 4,... will be used.
8787 * @param[in] symbols_wrap Stride (in bytes) of the symbols table.
8888 * @param[in] symbols_size Size of the symbols. 1 and 2 are supported.
89− * @param[in] flags A combination of the INIT_VLC_* flags.
89+ * @param[in] flags A combination of the VLC_INIT_* flags.
9090 *
9191 * 'wrap' and 'size' make it possible to use any memory configuration and types
9292 * (byte/word/int) to store the 'bits', 'codes', and 'symbols' tables.
9393 */
94−int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes,
94+int ff_vlc_init_sparse(VLC *vlc, int nb_bits, int nb_codes,
9595 const void *bits, int bits_wrap, int bits_size,
9696 const void *codes, int codes_wrap, int codes_size,
9797 const void *symbols, int symbols_wrap, int symbols_size,
@@ -123,10 +123,10 @@ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, · 25 unmodified lines
123123 * @param[in] symbols_wrap Stride (in bytes) of the symbols.
124124 * @param[in] symbols_size Size of the symbols. 1 and 2 are supported.
125125 * @param[in] offset An offset to apply to all the valid symbols.
126− * @param[in] flags A combination of the INIT_VLC_* flags; notice that
127− * INIT_VLC_INPUT_LE is pointless and ignored.
126+ * @param[in] flags A combination of the VLC_INIT_* flags; notice that
127+ * VLC_INIT_INPUT_LE is pointless and ignored.
128128 */
129−int ff_init_vlc_from_lengths(VLC *vlc, int nb_bits, int nb_codes,
129+int ff_vlc_init_from_lengths(VLC *vlc, int nb_bits, int nb_codes,
130130 const int8_t *lens, int lens_wrap,
131131 const void *symbols, int symbols_wrap, int symbols_size,
132132 int offset, int flags, void *logctx);
@@ -161,65 +161,65 @@ int ff_init_vlc_from_lengths(VLC *vlc, int nb_bits, int nb_codes, · 28 unmodified lines
161161 * @param[in] symbols_wrap Stride (in bytes) of the symbols.
162162 * @param[in] symbols_size Size of the symbols. 1 and 2 are supported.
163163 * @param[in] offset An offset to apply to all the valid symbols.
164− * @param[in] flags A combination of the INIT_VLC_* flags; notice that
165− * INIT_VLC_INPUT_LE is pointless and ignored.
164+ * @param[in] flags A combination of the VLC_INIT_* flags; notice that
165+ * VLC_INIT_INPUT_LE is pointless and ignored.
166166 */
167−int ff_init_vlc_multi_from_lengths(VLC *vlc, VLC_MULTI *multi, int nb_bits, int nb_elems,
167+int ff_vlc_init_multi_from_lengths(VLC *vlc, VLC_MULTI *multi, int nb_bits, int nb_elems,
168168 int nb_codes, const int8_t *lens, int lens_wrap,
169169 const void *symbols, int symbols_wrap, int symbols_size,
170170 int offset, int flags, void *logctx);
171171
172172
173−void ff_free_vlc_multi(VLC_MULTI *vlc);
174−void ff_free_vlc(VLC *vlc);
173+void ff_vlc_free_multi(VLC_MULTI *vlc);
174+void ff_vlc_free(VLC *vlc);
175175
176−/* If INIT_VLC_INPUT_LE is set, the LSB bit of the codes used to
176+#define VLC_INIT_USE_STATIC 1
177+#define VLC_INIT_STATIC_OVERLONG (2 | VLC_INIT_USE_STATIC)
178+/* If VLC_INIT_INPUT_LE is set, the LSB bit of the codes used to
177179 * initialize the VLC table is the first bit to be read. */
178−#define INIT_VLC_INPUT_LE 2
180+#define VLC_INIT_INPUT_LE 4
179181 /* If set the VLC is intended for a little endian bitstream reader. */
180−#define INIT_VLC_OUTPUT_LE 8
181−#define INIT_VLC_LE (INIT_VLC_INPUT_LE | INIT_VLC_OUTPUT_LE)
182−#define INIT_VLC_USE_NEW_STATIC 4
183−#define INIT_VLC_STATIC_OVERLONG (1 | INIT_VLC_USE_NEW_STATIC)
182+#define VLC_INIT_OUTPUT_LE 8
183+#define VLC_INIT_LE (VLC_INIT_INPUT_LE | VLC_INIT_OUTPUT_LE)
184184
185−#define INIT_CUSTOM_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \
185+#define VLC_INIT_CUSTOM_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \
186186 h, i, j, flags, static_size) \
187187 do { \
188188 static VLCElem table[static_size]; \
189189 (vlc)->table = table; \
190190 (vlc)->table_allocated = static_size; \
191− ff_init_vlc_sparse(vlc, bits, a, b, c, d, e, f, g, h, i, j, \
192− flags | INIT_VLC_USE_NEW_STATIC); \
191+ ff_vlc_init_sparse(vlc, bits, a, b, c, d, e, f, g, h, i, j, \
192+ flags | VLC_INIT_USE_STATIC); \
193193 } while (0)
194194
195−#define INIT_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, h, i, j, static_size) \
196− INIT_CUSTOM_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \
195+#define VLC_INIT_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, h, i, j, static_size) \
196+ VLC_INIT_CUSTOM_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \
197197 h, i, j, 0, static_size)
198198
199−#define INIT_LE_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, h, i, j, static_size) \
200− INIT_CUSTOM_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \
201− h, i, j, INIT_VLC_LE, static_size)
199+#define VLC_INIT_LE_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, h, i, j, static_size) \
200+ VLC_INIT_CUSTOM_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \
201+ h, i, j, VLC_INIT_LE, static_size)
202202
203−#define INIT_CUSTOM_VLC_STATIC(vlc, bits, a, b, c, d, e, f, g, flags, static_size) \
204− INIT_CUSTOM_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \
203+#define VLC_INIT_CUSTOM_STATIC(vlc, bits, a, b, c, d, e, f, g, flags, static_size) \
204+ VLC_INIT_CUSTOM_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \
205205 NULL, 0, 0, flags, static_size)
206206
207−#define INIT_VLC_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size) \
208− INIT_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, NULL, 0, 0, static_size)
207+#define VLC_INIT_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size) \
208+ VLC_INIT_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, NULL, 0, 0, static_size)
209209
210−#define INIT_LE_VLC_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size) \
211− INIT_LE_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, NULL, 0, 0, static_size)
210+#define VLC_INIT_LE_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size) \
211+ VLC_INIT_LE_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, NULL, 0, 0, static_size)
212212
213−#define INIT_VLC_STATIC_FROM_LENGTHS(vlc, bits, nb_codes, lens, len_wrap, \
213+#define VLC_INIT_STATIC_FROM_LENGTHS(vlc, bits, nb_codes, lens, len_wrap, \
214214 symbols, symbols_wrap, symbols_size, \
215215 offset, flags, static_size) \
216216 do { \
217217 static VLCElem table[static_size]; \
218218 (vlc)->table = table; \
219219 (vlc)->table_allocated = static_size; \
220− ff_init_vlc_from_lengths(vlc, bits, nb_codes, lens, len_wrap, \
220+ ff_vlc_init_from_lengths(vlc, bits, nb_codes, lens, len_wrap, \
221221 symbols, symbols_wrap, symbols_size, \
222− offset, flags | INIT_VLC_USE_NEW_STATIC, \
222+ offset, flags | VLC_INIT_USE_STATIC, \
223223 NULL); \
224224 } while (0)
225225
libavcodec/vorbisdec.c+3−3
@@ -210,7 +210,7 @@ static void vorbis_free(vorbis_context *vc) · 209 unmodified lines
210210 if (vc->codebooks)
211211 for (i = 0; i < vc->codebook_count; ++i) {
212212 av_freep(&vc->codebooks[i].codevectors);
213− ff_free_vlc(&vc->codebooks[i].vlc);
213+ ff_vlc_free(&vc->codebooks[i].vlc);
214214 }
215215 av_freep(&vc->codebooks);
216216
@@ -454,11 +454,11 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc) · 237 unmodified lines
454454
455455 codebook_setup->maxdepth = (codebook_setup->maxdepth+codebook_setup->nb_bits - 1) / codebook_setup->nb_bits;
456456
457− if ((ret = init_vlc(&codebook_setup->vlc, codebook_setup->nb_bits,
457+ if ((ret = vlc_init(&codebook_setup->vlc, codebook_setup->nb_bits,
458458 entries, tmp_vlc_bits, sizeof(*tmp_vlc_bits),
459459 sizeof(*tmp_vlc_bits), tmp_vlc_codes,
460460 sizeof(*tmp_vlc_codes), sizeof(*tmp_vlc_codes),
461− INIT_VLC_LE))) {
461+ VLC_INIT_LE))) {
462462 av_log(vc->avctx, AV_LOG_ERROR, " Error generating vlc tables. \n");
463463 goto error;
464464 }
libavcodec/vp3.c+15−15
@@ -361,19 +361,19 @@ static av_cold int vp3_decode_end(AVCodecContext *avctx) · 360 unmodified lines
361361 av_frame_free(&s->golden_frame.f);
362362
363363 for (i = 0; i < FF_ARRAY_ELEMS(s->coeff_vlc); i++)
364− ff_free_vlc(&s->coeff_vlc[i]);
364+ ff_vlc_free(&s->coeff_vlc[i]);
365365
366− ff_free_vlc(&s->superblock_run_length_vlc);
367− ff_free_vlc(&s->fragment_run_length_vlc);
368− ff_free_vlc(&s->mode_code_vlc);
369− ff_free_vlc(&s->motion_vector_vlc);
366+ ff_vlc_free(&s->superblock_run_length_vlc);
367+ ff_vlc_free(&s->fragment_run_length_vlc);
368+ ff_vlc_free(&s->mode_code_vlc);
369+ ff_vlc_free(&s->motion_vector_vlc);
370370
371371 for (j = 0; j < 2; j++)
372372 for (i = 0; i < 7; i++)
373− ff_free_vlc(&s->vp4_mv_vlc[j][i]);
373+ ff_vlc_free(&s->vp4_mv_vlc[j][i]);
374374
375375 for (i = 0; i < 2; i++)
376− ff_free_vlc(&s->block_pattern_vlc[i]);
376+ ff_vlc_free(&s->block_pattern_vlc[i]);
377377 return 0;
378378 }
379379
@@ -2439,7 +2439,7 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) · 2059 unmodified lines
24392439 /* init VLC tables */
24402440 bias_tabs = CONFIG_VP4_DECODER && s->version >= 2 ? vp4_bias : vp3_bias;
24412441 for (int i = 0; i < FF_ARRAY_ELEMS(s->coeff_vlc); i++) {
2442− ret = ff_init_vlc_from_lengths(&s->coeff_vlc[i], 11, 32,
2442+ ret = ff_vlc_init_from_lengths(&s->coeff_vlc[i], 11, 32,
24432443 &bias_tabs[i][0][1], 2,
24442444 &bias_tabs[i][0][0], 2, 1,
24452445 0, 0, avctx);
@@ -2450,7 +2450,7 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) · 4 unmodified lines
24502450 for (i = 0; i < FF_ARRAY_ELEMS(s->coeff_vlc); i++) {
24512451 const HuffTable *tab = &s->huffman_table[i];
24522452
2453− ret = ff_init_vlc_from_lengths(&s->coeff_vlc[i], 11, tab->nb_entries,
2453+ ret = ff_vlc_init_from_lengths(&s->coeff_vlc[i], 11, tab->nb_entries,
24542454 &tab->entries[0].len, sizeof(*tab->entries),
24552455 &tab->entries[0].sym, sizeof(*tab->entries), 1,
24562456 0, 0, avctx);
@@ -2459,25 +2459,25 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) · 2 unmodified lines
24592459 }
24602460 }
24612461
2462− ret = ff_init_vlc_from_lengths(&s->superblock_run_length_vlc, SUPERBLOCK_VLC_BITS, 34,
2462+ ret = ff_vlc_init_from_lengths(&s->superblock_run_length_vlc, SUPERBLOCK_VLC_BITS, 34,
24632463 superblock_run_length_vlc_lens, 1,
24642464 NULL, 0, 0, 1, 0, avctx);
24652465 if (ret < 0)
24662466 return ret;
24672467
2468− ret = ff_init_vlc_from_lengths(&s->fragment_run_length_vlc, 5, 30,
2468+ ret = ff_vlc_init_from_lengths(&s->fragment_run_length_vlc, 5, 30,
24692469 fragment_run_length_vlc_len, 1,
24702470 NULL, 0, 0, 0, 0, avctx);
24712471 if (ret < 0)
24722472 return ret;
24732473
2474− ret = ff_init_vlc_from_lengths(&s->mode_code_vlc, 3, 8,
2474+ ret = ff_vlc_init_from_lengths(&s->mode_code_vlc, 3, 8,
24752475 mode_code_vlc_len, 1,
24762476 NULL, 0, 0, 0, 0, avctx);
24772477 if (ret < 0)
24782478 return ret;
24792479
2480− ret = ff_init_vlc_from_lengths(&s->motion_vector_vlc, VP3_MV_VLC_BITS, 63,
2480+ ret = ff_vlc_init_from_lengths(&s->motion_vector_vlc, VP3_MV_VLC_BITS, 63,
24812481 &motion_vector_vlc_table[0][1], 2,
24822482 &motion_vector_vlc_table[0][0], 2, 1,
24832483 -31, 0, avctx);
@@ -2487,7 +2487,7 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) · 3 unmodified lines
24872487 #if CONFIG_VP4_DECODER
24882488 for (j = 0; j < 2; j++)
24892489 for (i = 0; i < 7; i++) {
2490− ret = ff_init_vlc_from_lengths(&s->vp4_mv_vlc[j][i], VP4_MV_VLC_BITS, 63,
2490+ ret = ff_vlc_init_from_lengths(&s->vp4_mv_vlc[j][i], VP4_MV_VLC_BITS, 63,
24912491 &vp4_mv_vlc[j][i][0][1], 2,
24922492 &vp4_mv_vlc[j][i][0][0], 2, 1, -31,
24932493 0, avctx);
@@ -2497,7 +2497,7 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) · 3 unmodified lines
24972497
24982498 /* version >= 2 */
24992499 for (i = 0; i < 2; i++)
2500− if ((ret = init_vlc(&s->block_pattern_vlc[i], 3, 14,
2500+ if ((ret = vlc_init(&s->block_pattern_vlc[i], 3, 14,
25012501 &vp4_block_pattern_vlc[i][0][1], 2, 1,
25022502 &vp4_block_pattern_vlc[i][0][0], 2, 1, 0)) < 0)
25032503 return ret;
libavcodec/vp6.c+4−4
@@ -279,7 +279,7 @@ static int vp6_build_huff_tree(VP56Context *s, uint8_t coeff_model[], · 278 unmodified lines
279279 nodes[map[2*i+1]].count = b + !b;
280280 }
281281
282− ff_free_vlc(vlc);
282+ ff_vlc_free(vlc);
283283 /* then build the huffman tree according to probabilities */
284284 return ff_huff_build_tree(s->avctx, vlc, size, FF_HUFFMAN_BITS,
285285 nodes, vp6_huff_cmp,
@@ -708,11 +708,11 @@ static av_cold void vp6_decode_free_context(VP56Context *s) · 422 unmodified lines
708708 ff_vp56_free_context(s);
709709
710710 for (pt=0; pt<2; pt++) {
711− ff_free_vlc(&s->dccv_vlc[pt]);
712− ff_free_vlc(&s->runv_vlc[pt]);
711+ ff_vlc_free(&s->dccv_vlc[pt]);
712+ ff_vlc_free(&s->runv_vlc[pt]);
713713 for (ct=0; ct<3; ct++)
714714 for (cg=0; cg<6; cg++)
715− ff_free_vlc(&s->ract_vlc[pt][ct][cg]);
715+ ff_vlc_free(&s->ract_vlc[pt][ct][cg]);
716716 }
717717 }
718718
libavcodec/vqcdec.c+1−1
@@ -53,7 +53,7 @@ static VLC vector_vlc; · 52 unmodified lines
5353
5454 static av_cold void vqc_init_static_data(void)
5555 {
56− INIT_VLC_STATIC_FROM_LENGTHS(&vector_vlc, VECTOR_VLC_BITS, FF_ARRAY_ELEMS(vector_nbits),
56+ VLC_INIT_STATIC_FROM_LENGTHS(&vector_vlc, VECTOR_VLC_BITS, FF_ARRAY_ELEMS(vector_nbits),
5757 vector_nbits, 1,
5858 vector_symbols, 1, 1,
5959 0, 0, 1 << VECTOR_VLC_BITS);
libavcodec/webp.c+4−4
@@ -233,7 +233,7 @@ static void image_ctx_free(ImageContext *img) · 232 unmodified lines
233233 if (img->huffman_groups) {
234234 for (i = 0; i < img->nb_huffman_groups; i++) {
235235 for (j = 0; j < HUFFMAN_CODES_PER_META_CODE; j++)
236− ff_free_vlc(&img->huffman_groups[i * HUFFMAN_CODES_PER_META_CODE + j].vlc);
236+ ff_vlc_free(&img->huffman_groups[i * HUFFMAN_CODES_PER_META_CODE + j].vlc);
237237 }
238238 av_free(img->huffman_groups);
239239 }
@@ -300,9 +300,9 @@ static int huff_reader_build_canonical(HuffReader *r, const uint8_t *code_length · 60 unmodified lines
300300 return AVERROR_INVALIDDATA;
301301 }
302302
303− ret = init_vlc(&r->vlc, 8, alphabet_size,
303+ ret = vlc_init(&r->vlc, 8, alphabet_size,
304304 code_lengths, sizeof(*code_lengths), sizeof(*code_lengths),
305− codes, sizeof(*codes), sizeof(*codes), INIT_VLC_OUTPUT_LE);
305+ codes, sizeof(*codes), sizeof(*codes), VLC_INIT_OUTPUT_LE);
306306 if (ret < 0) {
307307 av_free(codes);
308308 return ret;
@@ -415,7 +415,7 @@ static int read_huffman_code_normal(WebPContext *s, HuffReader *hc, · 106 unmodified lines
415415 ret = huff_reader_build_canonical(hc, code_lengths, alphabet_size);
416416
417417 finish:
418− ff_free_vlc(&code_len_hc.vlc);
418+ ff_vlc_free(&code_len_hc.vlc);
419419 av_free(code_lengths);
420420 return ret;
421421 }
libavcodec/wma.c+4−4
@@ -42,7 +42,7 @@ static av_cold int init_coef_vlc(VLC *vlc, uint16_t **prun_table, · 41 unmodified lines
4242 float *flevel_table;
4343 int i, l, j, k, level, ret;
4444
45− ret = init_vlc(vlc, VLCBITS, n, table_bits, 1, 1, table_codes, 4, 4, 0);
45+ ret = vlc_init(vlc, VLCBITS, n, table_bits, 1, 1, table_codes, 4, 4, 0);
4646 if (ret < 0)
4747 return ret;
4848
@@ -372,11 +372,11 @@ int ff_wma_end(AVCodecContext *avctx) · 323 unmodified lines
372372 av_tx_uninit(&s->mdct_ctx[i]);
373373
374374 if (s->use_exp_vlc)
375− ff_free_vlc(&s->exp_vlc);
375+ ff_vlc_free(&s->exp_vlc);
376376 if (s->use_noise_coding)
377− ff_free_vlc(&s->hgain_vlc);
377+ ff_vlc_free(&s->hgain_vlc);
378378 for (i = 0; i < 2; i++) {
379− ff_free_vlc(&s->coef_vlc[i]);
379+ ff_vlc_free(&s->coef_vlc[i]);
380380 av_freep(&s->run_table[i]);
381381 av_freep(&s->level_table[i]);
382382 av_freep(&s->int_table[i]);
libavcodec/wmadec.c+2−2
@@ -119,7 +119,7 @@ static av_cold int wma_decode_init(AVCodecContext *avctx) · 118 unmodified lines
119119 }
120120
121121 if (s->use_noise_coding) {
122− ret = ff_init_vlc_from_lengths(&s->hgain_vlc, HGAINVLCBITS,
122+ ret = ff_vlc_init_from_lengths(&s->hgain_vlc, HGAINVLCBITS,
123123 FF_ARRAY_ELEMS(ff_wma_hgain_hufftab),
124124 &ff_wma_hgain_hufftab[0][1], 2,
125125 &ff_wma_hgain_hufftab[0][0], 2, 1,
@@ -130,7 +130,7 @@ static av_cold int wma_decode_init(AVCodecContext *avctx) · 4 unmodified lines
130130
131131 if (s->use_exp_vlc) {
132132 // FIXME move out of context
133− ret = init_vlc(&s->exp_vlc, EXPVLCBITS, sizeof(ff_aac_scalefactor_bits),
133+ ret = vlc_init(&s->exp_vlc, EXPVLCBITS, sizeof(ff_aac_scalefactor_bits),
134134 ff_aac_scalefactor_bits, 1, 1,
135135 ff_aac_scalefactor_code, 4, 4, 0);
136136 if (ret < 0)
libavcodec/wmaprodec.c+7−7
@@ -320,25 +320,25 @@ static av_cold int get_rate(AVCodecContext *avctx) · 319 unmodified lines
320320
321321 static av_cold void decode_init_static(void)
322322 {
323− INIT_VLC_STATIC_FROM_LENGTHS(&sf_vlc, SCALEVLCBITS, HUFF_SCALE_SIZE,
323+ VLC_INIT_STATIC_FROM_LENGTHS(&sf_vlc, SCALEVLCBITS, HUFF_SCALE_SIZE,
324324 &scale_table[0][1], 2,
325325 &scale_table[0][0], 2, 1, -60, 0, 616);
326− INIT_VLC_STATIC_FROM_LENGTHS(&sf_rl_vlc, VLCBITS, HUFF_SCALE_RL_SIZE,
326+ VLC_INIT_STATIC_FROM_LENGTHS(&sf_rl_vlc, VLCBITS, HUFF_SCALE_RL_SIZE,
327327 &scale_rl_table[0][1], 2,
328328 &scale_rl_table[0][0], 2, 1, 0, 0, 1406);
329− INIT_VLC_STATIC_FROM_LENGTHS(&coef_vlc[0], VLCBITS, HUFF_COEF0_SIZE,
329+ VLC_INIT_STATIC_FROM_LENGTHS(&coef_vlc[0], VLCBITS, HUFF_COEF0_SIZE,
330330 coef0_lens, 1,
331331 coef0_syms, 2, 2, 0, 0, 2108);
332− INIT_VLC_STATIC_FROM_LENGTHS(&coef_vlc[1], VLCBITS, HUFF_COEF1_SIZE,
332+ VLC_INIT_STATIC_FROM_LENGTHS(&coef_vlc[1], VLCBITS, HUFF_COEF1_SIZE,
333333 &coef1_table[0][1], 2,
334334 &coef1_table[0][0], 2, 1, 0, 0, 3912);
335− INIT_VLC_STATIC_FROM_LENGTHS(&vec4_vlc, VLCBITS, HUFF_VEC4_SIZE,
335+ VLC_INIT_STATIC_FROM_LENGTHS(&vec4_vlc, VLCBITS, HUFF_VEC4_SIZE,
336336 vec4_lens, 1,
337337 vec4_syms, 2, 2, -1, 0, 604);
338− INIT_VLC_STATIC_FROM_LENGTHS(&vec2_vlc, VLCBITS, HUFF_VEC2_SIZE,
338+ VLC_INIT_STATIC_FROM_LENGTHS(&vec2_vlc, VLCBITS, HUFF_VEC2_SIZE,
339339 &vec2_table[0][1], 2,
340340 &vec2_table[0][0], 2, 1, -1, 0, 562);
341− INIT_VLC_STATIC_FROM_LENGTHS(&vec1_vlc, VLCBITS, HUFF_VEC1_SIZE,
341+ VLC_INIT_STATIC_FROM_LENGTHS(&vec1_vlc, VLCBITS, HUFF_VEC1_SIZE,
342342 &vec1_table[0][1], 2,
343343 &vec1_table[0][0], 2, 1, 0, 0, 562);
344344
libavcodec/wmavoice.c+1−1
@@ -320,7 +320,7 @@ static av_cold void wmavoice_init_static_data(void) · 319 unmodified lines
320320 14, 14, 14, 14
321321 };
322322
323− INIT_VLC_STATIC_FROM_LENGTHS(&frame_type_vlc, VLC_NBITS,
323+ VLC_INIT_STATIC_FROM_LENGTHS(&frame_type_vlc, VLC_NBITS,
324324 FF_ARRAY_ELEMS(bits), bits,
325325 1, NULL, 0, 0, 0, 0, 132);
326326 }
libavcodec/wnv1.c+2−2
@@ -115,10 +115,10 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *p, · 114 unmodified lines
115115
116116 static av_cold void wnv1_init_static(void)
117117 {
118− INIT_VLC_STATIC_FROM_LENGTHS(&code_vlc, CODE_VLC_BITS, 16,
118+ VLC_INIT_STATIC_FROM_LENGTHS(&code_vlc, CODE_VLC_BITS, 16,
119119 &code_tab[0][1], 2,
120120 &code_tab[0][0], 2, 1,
121− -7, INIT_VLC_OUTPUT_LE, 1 << CODE_VLC_BITS);
121+ -7, VLC_INIT_OUTPUT_LE, 1 << CODE_VLC_BITS);
122122 }
123123
124124 static av_cold int decode_init(AVCodecContext *avctx)
libavcodec/ylc.c+3−3
@@ -87,7 +87,7 @@ static int build_vlc(AVCodecContext *avctx, VLC *vlc, const uint32_t *table) · 86 unmodified lines
8787 uint8_t xlat[256];
8888 int cur_node, i, j, pos = 0;
8989
90− ff_free_vlc(vlc);
90+ ff_vlc_free(vlc);
9191
9292 for (i = 0; i < 256; i++) {
9393 nodes[i].count = table[i];
@@ -142,7 +142,7 @@ static int build_vlc(AVCodecContext *avctx, VLC *vlc, const uint32_t *table) · 48 unmodified lines
142142
143143 get_tree_codes(bits, lens, xlat, nodes, cur_node - 1, 0, 0, &pos);
144144
145− return ff_init_vlc_sparse(vlc, YLC_VLC_BITS, pos, lens, 2, 2,
145+ return ff_vlc_init_sparse(vlc, YLC_VLC_BITS, pos, lens, 2, 2,
146146 bits, 4, 4, xlat, 1, 1, 0);
147147 }
148148
@@ -438,7 +438,7 @@ static av_cold int decode_end(AVCodecContext *avctx) · 289 unmodified lines
438438 YLCContext *s = avctx->priv_data;
439439
440440 for (int i = 0; i < FF_ARRAY_ELEMS(s->vlc); i++)
441− ff_free_vlc(&s->vlc[i]);
441+ ff_vlc_free(&s->vlc[i]);
442442 av_freep(&s->buffer);
443443 s->buffer_size = 0;
444444

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t