Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-10-29 19:59:14 +0300
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-12-08 19:51:44 +0300
commite127af3c2b591dacd0c4c678a82d60bcce69755f (patch)
tree34cb03738e44d837be46af602bbd81ffcb33b13e /libavcodec/tscc2.c
parentd2e55e3aa1a1c204dc93c09018779265ac017971 (diff)
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 <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/tscc2.c')
-rw-r--r--libavcodec/tscc2.c8
1 files changed, 6 insertions, 2 deletions
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;