[FFmpeg-cvslog] avcodec/qdmc: reduce insanely huge tables

Paul B Mahol git at videolan.org
Fri Aug 21 14:57:41 EEST 2020


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri Aug 21 13:53:23 2020 +0200| [d2206f0c5b77306ac6f6310fd0f02a412a6ebfe9] | committer: Paul B Mahol

avcodec/qdmc: reduce insanely huge tables

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

 libavcodec/qdmc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavcodec/qdmc.c b/libavcodec/qdmc.c
index 10ceb7aa55..ff1cc86c6b 100644
--- a/libavcodec/qdmc.c
+++ b/libavcodec/qdmc.c
@@ -214,10 +214,10 @@ static av_cold void qdmc_init_static_data(void)
     INIT_VLC_STATIC_LE(&vtable[1], 10, FF_ARRAY_ELEMS(noise_segment_length_bits),
                        noise_segment_length_bits, 1, 1, noise_segment_length_codes, 2, 2,
                        noise_segment_length_symbols, 1, 1, 1024);
-    INIT_VLC_STATIC_LE(&vtable[2], 13, FF_ARRAY_ELEMS(amplitude_bits),
-                       amplitude_bits, 1, 1, amplitude_codes, 2, 2, NULL, 0, 0, 8192);
-    INIT_VLC_STATIC_LE(&vtable[3], 18, FF_ARRAY_ELEMS(freq_diff_bits),
-                       freq_diff_bits, 1, 1, freq_diff_codes, 4, 4, NULL, 0, 0, 262144);
+    INIT_VLC_STATIC_LE(&vtable[2], 12, FF_ARRAY_ELEMS(amplitude_bits),
+                       amplitude_bits, 1, 1, amplitude_codes, 2, 2, NULL, 0, 0, 4098);
+    INIT_VLC_STATIC_LE(&vtable[3], 12, FF_ARRAY_ELEMS(freq_diff_bits),
+                       freq_diff_bits, 1, 1, freq_diff_codes, 4, 4, NULL, 0, 0, 4160);
     INIT_VLC_STATIC_LE(&vtable[4], 8, FF_ARRAY_ELEMS(amplitude_diff_bits),
                        amplitude_diff_bits, 1, 1, amplitude_diff_codes, 1, 1, NULL, 0, 0, 256);
     INIT_VLC_STATIC_LE(&vtable[5], 6, FF_ARRAY_ELEMS(phase_diff_bits),
@@ -369,7 +369,7 @@ static int qdmc_get_vlc(GetBitContext *gb, VLC *table, int flag)
 
     if (get_bits_left(gb) < 1)
         return AVERROR_INVALIDDATA;
-    v = get_vlc2(gb, table->table, table->bits, 1);
+    v = get_vlc2(gb, table->table, table->bits, 2);
     if (v < 0)
         return AVERROR_INVALIDDATA;
     if (v)



More information about the ffmpeg-cvslog mailing list