diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2023-09-24 17:14:07 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2023-10-31 20:47:00 +0100 |
commit | e5dcde620d5617fbfdc1e8a699415b742245638f (patch) | |
tree | 82df00b2b2be56d05ebebb6b5240425e3970d774 /libavcodec/vc1data.c | |
parent | fd4cb6ebee1c8e1673c2e4ef11d95853fd80bc51 (diff) | |
download | ffmpeg-e5dcde620d5617fbfdc1e8a699415b742245638f.tar.gz |
avcodec/vc1: Avoid superfluous VLC structures
For all VLCs here, the number of bits of the VLC is
write-only, because it is hardcoded at the call site.
Therefore one can replace these VLC structures with
the only thing that is actually used: The pointer
to the VLCElem table. And in some cases one can even
avoid this.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/vc1data.c')
-rw-r--r-- | libavcodec/vc1data.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/libavcodec/vc1data.c b/libavcodec/vc1data.c index 5ebf20a0f0..4046ea042f 100644 --- a/libavcodec/vc1data.c +++ b/libavcodec/vc1data.c @@ -102,26 +102,26 @@ const uint8_t ff_vc1_pquant_table[3][32] = { * @todo TODO move this into the context */ //@{ -VLC ff_vc1_imode_vlc; -VLC ff_vc1_norm2_vlc; -VLC ff_vc1_norm6_vlc; +VLCElem ff_vc1_imode_vlc[1 << VC1_IMODE_VLC_BITS]; +VLCElem ff_vc1_norm2_vlc[1 << VC1_NORM2_VLC_BITS]; +VLCElem ff_vc1_norm6_vlc[556]; /* Could be optimized, one table only needs 8 bits */ -VLC ff_vc1_ttmb_vlc[3]; -VLC ff_vc1_mv_diff_vlc[4]; -VLC ff_vc1_cbpcy_p_vlc[4]; -VLC ff_vc1_icbpcy_vlc[8]; -VLC ff_vc1_4mv_block_pattern_vlc[4]; -VLC ff_vc1_2mv_block_pattern_vlc[4]; -VLC ff_vc1_ttblk_vlc[3]; -VLC ff_vc1_subblkpat_vlc[3]; -VLC ff_vc1_intfr_4mv_mbmode_vlc[4]; -VLC ff_vc1_intfr_non4mv_mbmode_vlc[4]; -VLC ff_vc1_if_mmv_mbmode_vlc[8]; -VLC ff_vc1_if_1mv_mbmode_vlc[8]; -VLC ff_vc1_1ref_mvdata_vlc[4]; -VLC ff_vc1_2ref_mvdata_vlc[8]; +const VLCElem *ff_vc1_ttmb_vlc[3]; +const VLCElem *ff_vc1_mv_diff_vlc[4]; +const VLCElem *ff_vc1_cbpcy_p_vlc[4]; +const VLCElem *ff_vc1_icbpcy_vlc[8]; +const VLCElem *ff_vc1_4mv_block_pattern_vlc[4]; +const VLCElem *ff_vc1_2mv_block_pattern_vlc[4]; +const VLCElem *ff_vc1_ttblk_vlc[3]; +const VLCElem *ff_vc1_subblkpat_vlc[3]; +const VLCElem *ff_vc1_intfr_4mv_mbmode_vlc[4]; +const VLCElem *ff_vc1_intfr_non4mv_mbmode_vlc[4]; +const VLCElem *ff_vc1_if_mmv_mbmode_vlc[8]; +const VLCElem *ff_vc1_if_1mv_mbmode_vlc[8]; +const VLCElem *ff_vc1_1ref_mvdata_vlc[4]; +const VLCElem *ff_vc1_2ref_mvdata_vlc[8]; -VLC ff_vc1_ac_coeff_table[8]; +const VLCElem *ff_vc1_ac_coeff_table[8]; //@} |