]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/hqx: Inline constants
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sat, 7 Nov 2020 09:31:59 +0000 (10:31 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 24 Nov 2020 10:35:03 +0000 (11:35 +0100)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/hqx.c
libavcodec/hqx.h
libavcodec/hqxvlc.c

index e2b895ac40bbe7b0793441ccc5caf8b17343fae9..44c6c1883ce52e2fd619c840c23790bb639e6393 100644 (file)
@@ -197,7 +197,7 @@ static int hqx_decode_422a(HQXContext *ctx, int slice_no, int x, int y)
     int i, ret;
     int cbp;
 
-    cbp = get_vlc2(gb, ctx->cbp_vlc.table, ctx->cbp_vlc.bits, 1);
+    cbp = get_vlc2(gb, ctx->cbp_vlc.table, HQX_CBP_VLC_BITS, 1);
 
     for (i = 0; i < 12; i++)
         memset(slice->block[i], 0, sizeof(**slice->block) * 64);
@@ -283,7 +283,7 @@ static int hqx_decode_444a(HQXContext *ctx, int slice_no, int x, int y)
     int i, ret;
     int cbp;
 
-    cbp = get_vlc2(gb, ctx->cbp_vlc.table, ctx->cbp_vlc.bits, 1);
+    cbp = get_vlc2(gb, ctx->cbp_vlc.table, HQX_CBP_VLC_BITS, 1);
 
     for (i = 0; i < 16; i++)
         memset(slice->block[i], 0, sizeof(**slice->block) * 64);
index 42d382de1fecb4d94460968dbfe51b2df547bd2d..50d60f9e0346438168c3398ecd1c96c8e513f908 100644 (file)
@@ -77,6 +77,7 @@ typedef struct HQXContext {
     VLC dc_vlc[3];
 } HQXContext;
 
+#define HQX_CBP_VLC_BITS 5
 #define HQX_DC_VLC_BITS 9
 
 extern const HQXAC ff_hqx_ac[NUM_HQX_AC];
index 06a80736611190e7a7a54049b6c08c863ab82c6e..7ab24276601ee54e871d508a48439b5e7875c88b 100644 (file)
@@ -2150,7 +2150,7 @@ const HQXAC ff_hqx_ac[NUM_HQX_AC] = {
 
 av_cold int ff_hqx_init_vlcs(HQXContext *ctx)
 {
-    int ret = init_vlc(&ctx->cbp_vlc, 5, FF_ARRAY_ELEMS(cbp_vlc_lens),
+    int ret = init_vlc(&ctx->cbp_vlc, HQX_CBP_VLC_BITS, FF_ARRAY_ELEMS(cbp_vlc_lens),
                        cbp_vlc_lens, 1, 1, cbp_vlc_bits, 1, 1, 0);
     if (ret < 0)
         return ret;