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-25 16:04:59 +0300
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-12-08 19:51:44 +0300
commit2935d29e8e0c737dfb82c2b62ebeb1521200caa9 (patch)
treed886b954647c32c4d2079c9638516a7c779e12b0 /libavcodec/on2avc.c
parent71753c5235d7a3461404847aeaf3df9fae8bacf1 (diff)
avcodec/on2avcdata: Combine tables for codebooks
Using one big table for the codebook 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/on2avc.c')
-rw-r--r--libavcodec/on2avc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/on2avc.c b/libavcodec/on2avc.c
index 2db42e2bf2..64480c0701 100644
--- a/libavcodec/on2avc.c
+++ b/libavcodec/on2avc.c
@@ -906,6 +906,8 @@ static av_cold void on2avc_free_vlcs(On2AVCContext *c)
static av_cold int on2avc_decode_init(AVCodecContext *avctx)
{
On2AVCContext *c = avctx->priv_data;
+ const uint8_t *lens = ff_on2avc_cb_lens;
+ const uint16_t *syms = ff_on2avc_cb_syms;
int i, ret;
if (avctx->channels > 2U) {
@@ -964,10 +966,12 @@ static av_cold int on2avc_decode_init(AVCodecContext *avctx)
for (i = 1; i < 16; i++) {
int idx = i - 1;
ret = ff_init_vlc_from_lengths(&c->cb_vlc[i], 9, ff_on2avc_cb_elems[idx],
- ff_on2avc_cb_bits[idx], 1,
- ff_on2avc_cb_syms[idx], 2, 2, 0, 0, avctx);
+ lens, 1,
+ syms, 2, 2, 0, 0, avctx);
if (ret < 0)
goto vlc_fail;
+ lens += ff_on2avc_cb_elems[idx];
+ syms += ff_on2avc_cb_elems[idx];
}
return 0;