From e127af3c2b591dacd0c4c678a82d60bcce69755f Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Thu, 29 Oct 2020 17:59:14 +0100 Subject: avcodec/tscc2: Combine tables for initializing VLCs Using one big table for the symbols and lengths makes it possible to remove the pointers to the individual tables. Signed-off-by: Andreas Rheinhardt --- libavcodec/tscc2.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'libavcodec/tscc2.c') diff --git a/libavcodec/tscc2.c b/libavcodec/tscc2.c index c4d275bb23..17eb2c854f 100644 --- a/libavcodec/tscc2.c +++ b/libavcodec/tscc2.c @@ -60,6 +60,8 @@ static av_cold void free_vlcs(TSCC2Context *c) static av_cold int init_vlcs(TSCC2Context *c) { + const uint16_t *ac_vlc_syms = tscc2_ac_vlc_syms; + const uint8_t *ac_vlc_lens = tscc2_ac_vlc_lens; int i, ret; ret = ff_init_vlc_from_lengths(&c->dc_vlc, 9, DC_VLC_COUNT, @@ -77,11 +79,13 @@ static av_cold int init_vlcs(TSCC2Context *c) if (ret) return ret; ret = ff_init_vlc_from_lengths(c->ac_vlc + i, 9, tscc2_ac_vlc_sizes[i], - tscc2_ac_vlc_bits[i], 1, - tscc2_ac_vlc_syms[i], 2, 2, + ac_vlc_lens, 1, + ac_vlc_syms, 2, 2, 0, INIT_VLC_OUTPUT_LE, c->avctx); if (ret) return ret; + ac_vlc_lens += tscc2_ac_vlc_sizes[i]; + ac_vlc_syms += tscc2_ac_vlc_sizes[i]; } return 0; -- cgit v1.2.3