]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/msmpeg4dec: Don't initialize unused RL VLCs
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 8 Dec 2020 22:08:56 +0000 (23:08 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 25 Jan 2021 13:51:53 +0000 (14:51 +0100)
For the RLTables ff_rl_table[0..2] only the very first VLC is only ever
used, so it makes no sense to create 32 of them. This saves 285200B from
the .bss segment; this amount of memory is actually saved when this
decoder is used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/msmpeg4dec.c

index 49df06a9d7eb54b7ad5ecbe05ab9021ebfff4608..882dd22dbdd151c471779ac86fcf74f37b0458ad 100644 (file)
@@ -317,9 +317,9 @@ av_cold int ff_msmpeg4_decode_init(AVCodecContext *avctx)
         for(i=0;i<NB_RL_TABLES;i++) {
             ff_rl_init(&ff_rl_table[i], ff_static_rl_table_store[i]);
         }
-        INIT_VLC_RL(ff_rl_table[0], 642);
-        INIT_VLC_RL(ff_rl_table[1], 1104);
-        INIT_VLC_RL(ff_rl_table[2], 554);
+        INIT_FIRST_VLC_RL(ff_rl_table[0], 642);
+        INIT_FIRST_VLC_RL(ff_rl_table[1], 1104);
+        INIT_FIRST_VLC_RL(ff_rl_table[2], 554);
         INIT_VLC_RL(ff_rl_table[3], 940);
         INIT_VLC_RL(ff_rl_table[4], 962);
         INIT_VLC_RL(ff_rl_table[5], 554);