From bd4c778e19b94d048df793006058de18f91f1f6e Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Wed, 20 Sep 2023 18:30:13 +0200 Subject: avcodec/h264_cavlc: Avoid indirection for coefficient table VLCs Signed-off-by: Andreas Rheinhardt --- libavcodec/h264_cavlc.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'libavcodec/h264_cavlc.c') diff --git a/libavcodec/h264_cavlc.c b/libavcodec/h264_cavlc.c index 994e10dd0a..f0c90dec16 100644 --- a/libavcodec/h264_cavlc.c +++ b/libavcodec/h264_cavlc.c @@ -246,7 +246,8 @@ static int8_t cavlc_level_tab[7][1<= LUMA_DC_BLOCK_INDEX){ total_coeff= pred_non_zero_count(h, sl, (n - LUMA_DC_BLOCK_INDEX)*16); - coeff_token = get_vlc2(gb, coeff_token_vlc[coeff_token_table_index[total_coeff]], + coeff_token = get_vlc2(gb, coeff_token_vlc[total_coeff], COEFF_TOKEN_VLC_BITS, 2); total_coeff= coeff_token>>2; }else{ total_coeff= pred_non_zero_count(h, sl, n); - coeff_token = get_vlc2(gb, coeff_token_vlc[coeff_token_table_index[total_coeff]], + coeff_token = get_vlc2(gb, coeff_token_vlc[total_coeff], COEFF_TOKEN_VLC_BITS, 2); total_coeff= coeff_token>>2; } -- cgit v1.2.3