You've already forked FFmpeg
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:
@ -203,7 +203,7 @@ struct vp56_context {
|
|||||||
GetBitContext gb;
|
GetBitContext gb;
|
||||||
VLC dccv_vlc[2];
|
VLC dccv_vlc[2];
|
||||||
VLC runv_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 */
|
unsigned int nb_null[2][2]; /* number of consecutive NULL DC/AC */
|
||||||
|
|
||||||
int have_undamaged_frame;
|
int have_undamaged_frame;
|
||||||
|
@ -339,7 +339,7 @@ static int vp6_parse_coeff_models(VP56Context *s)
|
|||||||
vp6_huff_run_map, 9, &s->runv_vlc[pt]))
|
vp6_huff_run_map, 9, &s->runv_vlc[pt]))
|
||||||
return -1;
|
return -1;
|
||||||
for (ct=0; ct<3; ct++)
|
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],
|
if (vp6_build_huff_tree(s, model->coeff_ract[pt][ct][cg],
|
||||||
vp6_huff_coeff_map, 12,
|
vp6_huff_coeff_map, 12,
|
||||||
&s->ract_vlc[pt][ct][cg]))
|
&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)
|
static av_cold void vp6_decode_free_context(VP56Context *s)
|
||||||
{
|
{
|
||||||
int pt, ct, cg;
|
|
||||||
|
|
||||||
ff_vp56_free_context(s);
|
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->dccv_vlc[pt]);
|
||||||
ff_vlc_free(&s->runv_vlc[pt]);
|
ff_vlc_free(&s->runv_vlc[pt]);
|
||||||
for (ct=0; ct<3; ct++)
|
for (int ct = 0; ct < 3; ++ct)
|
||||||
for (cg=0; cg<6; cg++)
|
for (int cg = 0; cg < 4; ++cg)
|
||||||
ff_vlc_free(&s->ract_vlc[pt][ct][cg]);
|
ff_vlc_free(&s->ract_vlc[pt][ct][cg]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user