diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-11-23 05:09:57 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-12-08 17:51:48 +0100 |
commit | e5b416daddd0435571c3483621c6953c56e7cf9a (patch) | |
tree | aa3752eb50790f4213df795db7a4f47f95105ba5 /libavcodec/wmadec.c | |
parent | 14be39e44a7dd5f378e93a9fea0e1ca1e6eba9d6 (diff) |
avcodec/wmadec: Reduce the size of tables used to initialize VLC
By switching from ff_init_vlc_sparse() to ff_init_vlc_from_lengths() one
can replace a table of codes of type uint16_t by a table of symbols of
type uint8_t, saving space.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/wmadec.c')
-rw-r--r-- | libavcodec/wmadec.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c index 8504d8d6c4..2b9499eba7 100644 --- a/libavcodec/wmadec.c +++ b/libavcodec/wmadec.c @@ -110,9 +110,9 @@ static av_cold int wma_decode_init(AVCodecContext *avctx) ff_mdct_init(&s->mdct_ctx[i], s->frame_len_bits - i + 1, 1, 1.0 / 32768.0); if (s->use_noise_coding) { - init_vlc(&s->hgain_vlc, HGAINVLCBITS, sizeof(ff_wma_hgain_huffbits), - ff_wma_hgain_huffbits, 1, 1, - ff_wma_hgain_huffcodes, 2, 2, 0); + ff_init_vlc_from_lengths(&s->hgain_vlc, HGAINVLCBITS, FF_ARRAY_ELEMS(ff_wma_hgain_hufftab), + &ff_wma_hgain_hufftab[0][1], 2, + &ff_wma_hgain_hufftab[0][0], 2, 1, 0, 0, avctx); } if (s->use_exp_vlc) |