diff mbox series

[FFmpeg-devel,36/61] avcodec/indeo2: Avoid unnecessary VLC structure

Message ID GV1P250MB07370AE5BD158293E4A5D5E28FC3A@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 05577d2c7694f2879a23f72617cbbc7a0b75db33
Headers show
Series [FFmpeg-devel,01/61] avcodec/vlc: Add functions to init static VLCElem[] without VLC | expand

Commit Message

Andreas Rheinhardt Sept. 26, 2023, 10:17 p.m. UTC
Everything besides VLC.table is basically write-only
and even VLC.table can be removed by accessing the
underlying table directly.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/indeo2.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c
index 2f64320682..6878ab7cb6 100644
--- a/libavcodec/indeo2.c
+++ b/libavcodec/indeo2.c
@@ -42,12 +42,12 @@  typedef struct Ir2Context{
 } Ir2Context;
 
 #define CODE_VLC_BITS 14
-static VLC ir2_vlc;
+static VLCElem ir2_vlc[1 << CODE_VLC_BITS];
 
 /* Indeo 2 codes are in range 0x01..0x7F and 0x81..0x90 */
 static inline int ir2_get_code(GetBitContext *gb)
 {
-    return get_vlc2(gb, ir2_vlc.table, CODE_VLC_BITS, 1);
+    return get_vlc2(gb, ir2_vlc, CODE_VLC_BITS, 1);
 }
 
 static int ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst,
@@ -226,9 +226,9 @@  static int ir2_decode_frame(AVCodecContext *avctx, AVFrame *picture,
 
 static av_cold void ir2_init_static(void)
 {
-    VLC_INIT_STATIC_FROM_LENGTHS(&ir2_vlc, CODE_VLC_BITS, IR2_CODES,
-                                 &ir2_tab[0][1], 2, &ir2_tab[0][0], 2, 1,
-                                 0, VLC_INIT_OUTPUT_LE, 1 << CODE_VLC_BITS);
+    VLC_INIT_STATIC_TABLE_FROM_LENGTHS(ir2_vlc, CODE_VLC_BITS, IR2_CODES,
+                                       &ir2_tab[0][1], 2, &ir2_tab[0][0], 2, 1,
+                                       0, VLC_INIT_OUTPUT_LE);
 }
 
 static av_cold int ir2_decode_init(AVCodecContext *avctx)