diff mbox series

[FFmpeg-devel,10/13] avcodec/dca_core: Don't use too big max_depth in get_vlc2()

Message ID GV1P250MB07377E6221A1611C15E9D0388F479@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 3652114596096a2b015972e9db063323c408c91e
Headers show
Series [FFmpeg-devel,01/13] avcodec/dolby_e_parser: Remove unnecessary headers | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 13, 2022, 11:33 a.m. UTC
Most of the VLCs used here have a max_depth of two;
some have a max_depth of one. Therefore one can just use two
and avoid the runtime check for whether one should
perform another round of LUT lookup in case the first read
did not read a complete codeword.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/dca_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/dca_core.c b/libavcodec/dca_core.c
index 7dff6633df..7b23a40df4 100644
--- a/libavcodec/dca_core.c
+++ b/libavcodec/dca_core.c
@@ -69,7 +69,7 @@  static const uint8_t block_code_nbits[7] = {
 
 static int dca_get_vlc(GetBitContext *s, DCAVLC *v, int i)
 {
-    return get_vlc2(s, v->vlc[i].table, v->vlc[i].bits, v->max_depth);
+    return get_vlc2(s, v->vlc[i].table, v->vlc[i].bits, 2);
 }
 
 static void get_array(GetBitContext *s, int32_t *array, int size, int n)