diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2025-04-17 19:41:05 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2025-04-25 23:01:37 +0200 |
commit | 57b7783c22ce33387e312a9a1038708e39c857f9 (patch) | |
tree | a3579be37f3f90b1b53a64febbe4b8d0e5b2b006 | |
parent | 3e21df2353ac5f0d2880bf0f6fbd64c19fcd5e49 (diff) | |
download | ffmpeg-57b7783c22ce33387e312a9a1038708e39c857f9.tar.gz |
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>
-rw-r--r-- | libavcodec/vp56.h | 2 | ||||
-rw-r--r-- | libavcodec/vp6.c | 10 |
2 files changed, 5 insertions, 7 deletions
diff --git a/libavcodec/vp56.h b/libavcodec/vp56.h index 87b7e06e0b..e922a13c5e 100644 --- a/libavcodec/vp56.h +++ b/libavcodec/vp56.h @@ -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; diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c index 73d117c871..926694ae11 100644 --- a/libavcodec/vp6.c +++ b/libavcodec/vp6.c @@ -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]); } } |