1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avcodec/vp6: Don't initialize unused VLC tables

There are only 2*3*4 VLC trees for decoding Huffman encoded
AC coefficients; see section 13.3.2 of the spec.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2025-04-17 19:41:05 +02:00
parent 3e21df2353
commit 57b7783c22
2 changed files with 5 additions and 7 deletions

View File

@ -203,7 +203,7 @@ struct vp56_context {
GetBitContext gb;
VLC dccv_vlc[2];
VLC runv_vlc[2];
VLC ract_vlc[2][3][6];
VLC ract_vlc[2][3][4];
unsigned int nb_null[2][2]; /* number of consecutive NULL DC/AC */
int have_undamaged_frame;

View File

@ -339,7 +339,7 @@ static int vp6_parse_coeff_models(VP56Context *s)
vp6_huff_run_map, 9, &s->runv_vlc[pt]))
return -1;
for (ct=0; ct<3; ct++)
for (cg = 0; cg < 6; cg++)
for (int cg = 0; cg < 4; cg++)
if (vp6_build_huff_tree(s, model->coeff_ract[pt][ct][cg],
vp6_huff_coeff_map, 12,
&s->ract_vlc[pt][ct][cg]))
@ -704,15 +704,13 @@ static av_cold int vp6_decode_free(AVCodecContext *avctx)
static av_cold void vp6_decode_free_context(VP56Context *s)
{
int pt, ct, cg;
ff_vp56_free_context(s);
for (pt=0; pt<2; pt++) {
for (int pt = 0; pt < 2; ++pt) {
ff_vlc_free(&s->dccv_vlc[pt]);
ff_vlc_free(&s->runv_vlc[pt]);
for (ct=0; ct<3; ct++)
for (cg=0; cg<6; cg++)
for (int ct = 0; ct < 3; ++ct)
for (int cg = 0; cg < 4; ++cg)
ff_vlc_free(&s->ract_vlc[pt][ct][cg]);
}
}