[FFmpeg-cvslog] avcodec/hqx: Inline constants

Andreas Rheinhardt git at videolan.org
Tue Nov 24 12:49:22 EET 2020


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Sat Nov  7 10:31:59 2020 +0100| [a03caa384f8f8c7bb2ba30b1bd0e60fa77f25db6] | committer: Andreas Rheinhardt

avcodec/hqx: Inline constants

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>

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

 libavcodec/hqx.c    | 4 ++--
 libavcodec/hqx.h    | 1 +
 libavcodec/hqxvlc.c | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavcodec/hqx.c b/libavcodec/hqx.c
index e2b895ac40..44c6c1883c 100644
--- a/libavcodec/hqx.c
+++ b/libavcodec/hqx.c
@@ -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);
diff --git a/libavcodec/hqx.h b/libavcodec/hqx.h
index 42d382de1f..50d60f9e03 100644
--- a/libavcodec/hqx.h
+++ b/libavcodec/hqx.h
@@ -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];
diff --git a/libavcodec/hqxvlc.c b/libavcodec/hqxvlc.c
index 06a8073661..7ab2427660 100644
--- a/libavcodec/hqxvlc.c
+++ b/libavcodec/hqxvlc.c
@@ -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;



More information about the ffmpeg-cvslog mailing list