diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-09-04 21:03:21 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-09-07 00:07:45 +0200 |
commit | f050bc0506643cf2a7211634b4ba3310fa290190 (patch) | |
tree | ff421ae9b236be81551fed10e19dbdc43e409618 /libavcodec/wmaprodec.c | |
parent | af847fe000f9eb78e3aa013ee64ab2274bfd5e68 (diff) | |
download | ffmpeg-f050bc0506643cf2a7211634b4ba3310fa290190.tar.gz |
avcodec/wmaprodec: Use ff_init_vlc_from_lengths() instead of init_vlc
It allows to replace tables of big codes (uint16_t and uint32_t)
by tables of smaller symbols (mostly uint8_t).
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/wmaprodec.c')
-rw-r--r-- | libavcodec/wmaprodec.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c index 7cfd0c04be..1909ce2dad 100644 --- a/libavcodec/wmaprodec.c +++ b/libavcodec/wmaprodec.c @@ -318,27 +318,27 @@ static av_cold int get_rate(AVCodecContext *avctx) static av_cold void decode_init_static(void) { - INIT_VLC_STATIC(&sf_vlc, SCALEVLCBITS, HUFF_SCALE_SIZE, - scale_huffbits, 1, 1, - scale_huffcodes, 2, 2, 616); - INIT_VLC_STATIC(&sf_rl_vlc, VLCBITS, HUFF_SCALE_RL_SIZE, - scale_rl_huffbits, 1, 1, - scale_rl_huffcodes, 4, 4, 1406); - INIT_VLC_STATIC(&coef_vlc[0], VLCBITS, HUFF_COEF0_SIZE, - coef0_huffbits, 1, 1, - coef0_huffcodes, 4, 4, 2108); - INIT_VLC_STATIC(&coef_vlc[1], VLCBITS, HUFF_COEF1_SIZE, - coef1_huffbits, 1, 1, - coef1_huffcodes, 4, 4, 3912); - INIT_VLC_STATIC(&vec4_vlc, VLCBITS, HUFF_VEC4_SIZE, - vec4_huffbits, 1, 1, - vec4_huffcodes, 2, 2, 604); - INIT_VLC_STATIC(&vec2_vlc, VLCBITS, HUFF_VEC2_SIZE, - vec2_huffbits, 1, 1, - vec2_huffcodes, 2, 2, 562); - INIT_VLC_STATIC(&vec1_vlc, VLCBITS, HUFF_VEC1_SIZE, - vec1_huffbits, 1, 1, - vec1_huffcodes, 2, 2, 562); + INIT_VLC_STATIC_FROM_LENGTHS(&sf_vlc, SCALEVLCBITS, HUFF_SCALE_SIZE, + &scale_table[0][1], 2, + &scale_table[0][0], 2, 1, 0, 0, 616); + INIT_VLC_STATIC_FROM_LENGTHS(&sf_rl_vlc, VLCBITS, HUFF_SCALE_RL_SIZE, + &scale_rl_table[0][1], 2, + &scale_rl_table[0][0], 2, 1, 0, 0, 1406); + INIT_VLC_STATIC_FROM_LENGTHS(&coef_vlc[0], VLCBITS, HUFF_COEF0_SIZE, + coef0_lens, 1, + coef0_syms, 2, 2, 0, 0, 2108); + INIT_VLC_STATIC_FROM_LENGTHS(&coef_vlc[1], VLCBITS, HUFF_COEF1_SIZE, + &coef1_table[0][1], 2, + &coef1_table[0][0], 2, 1, 0, 0, 3912); + INIT_VLC_STATIC_FROM_LENGTHS(&vec4_vlc, VLCBITS, HUFF_VEC4_SIZE, + &vec4_table[0][1], 2, + &vec4_table[0][0], 2, 1, 0, 0, 604); + INIT_VLC_STATIC_FROM_LENGTHS(&vec2_vlc, VLCBITS, HUFF_VEC2_SIZE, + &vec2_table[0][1], 2, + &vec2_table[0][0], 2, 1, 0, 0, 562); + INIT_VLC_STATIC_FROM_LENGTHS(&vec1_vlc, VLCBITS, HUFF_VEC1_SIZE, + &vec1_table[0][1], 2, + &vec1_table[0][0], 2, 1, 0, 0, 562); /** calculate sine values for the decorrelation matrix */ for (int i = 0; i < 33; i++) |