aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/indeo2.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-09-24 17:28:21 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-10-31 20:47:00 +0100
commit05577d2c7694f2879a23f72617cbbc7a0b75db33 (patch)
treec542379e888b17a3c9734f0b2cda98df0fc208ce /libavcodec/indeo2.c
parent25b9ff2780fdf1fbce914aeb68e77699d47147b6 (diff)
downloadffmpeg-05577d2c7694f2879a23f72617cbbc7a0b75db33.tar.gz
avcodec/indeo2: Avoid unnecessary VLC structure
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>
Diffstat (limited to 'libavcodec/indeo2.c')
-rw-r--r--libavcodec/indeo2.c10
1 files changed, 5 insertions, 5 deletions
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)