summaryrefslogtreecommitdiff
path: root/libavcodec/vc1.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-10-29 23:37:55 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-11-06 17:41:25 +0100
commiteb28ddf8fca8f16bf3c4d90b220fd59c27cce446 (patch)
tree0734f7a1761b2ae3df88fdfdbcb4dfc0117c62ee /libavcodec/vc1.c
parent2e2b404a2d349def27a0436b325e5ff6769f817b (diff)
downloadffmpeg-eb28ddf8fca8f16bf3c4d90b220fd59c27cce446.tar.gz
avcodec/vc1: Don't use VLC to read bfraction
The VLC here is very simple, so that it can just be read by two get_bits(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/vc1.c')
-rw-r--r--libavcodec/vc1.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index 9b4e951baa..f6468b54c7 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -613,7 +613,10 @@ static void rotate_luts(VC1Context *v)
}
static int read_bfraction(VC1Context *v, GetBitContext* gb) {
- int bfraction_lut_index = get_vlc2(gb, ff_vc1_bfraction_vlc.table, VC1_BFRACTION_VLC_BITS, 1);
+ int bfraction_lut_index = get_bits(gb, 3);
+
+ if (bfraction_lut_index == 7)
+ bfraction_lut_index = 7 + get_bits(gb, 4);
if (bfraction_lut_index == 21) {
av_log(v->s.avctx, AV_LOG_ERROR, "bfraction invalid\n");
@@ -1582,9 +1585,6 @@ static av_cold void vc1_init_static(void)
{
static VLCElem vlc_table[32372];
- INIT_VLC_STATIC(&ff_vc1_bfraction_vlc, VC1_BFRACTION_VLC_BITS, 23,
- ff_vc1_bfraction_bits, 1, 1,
- ff_vc1_bfraction_codes, 1, 1, 1 << VC1_BFRACTION_VLC_BITS);
INIT_VLC_STATIC(&ff_vc1_norm2_vlc, VC1_NORM2_VLC_BITS, 4,
ff_vc1_norm2_bits, 1, 1,
ff_vc1_norm2_codes, 1, 1, 1 << VC1_NORM2_VLC_BITS);