[FFmpeg-cvslog] avcodec/dca_core: Don't use too big max_depth in get_vlc2()

Andreas Rheinhardt git at videolan.org
Fri Sep 16 19:42:51 EEST 2022


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Tue Sep  6 04:06:48 2022 +0200| [3652114596096a2b015972e9db063323c408c91e] | committer: Andreas Rheinhardt

avcodec/dca_core: Don't use too big max_depth in get_vlc2()

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 at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3652114596096a2b015972e9db063323c408c91e
---

 libavcodec/dca_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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)



More information about the ffmpeg-cvslog mailing list