diff mbox series

[FFmpeg-devel,2/2] avcodec/mimic: Inline constants

Message ID 20201029145830.444147-2-andreas.rheinhardt@gmail.com
State Accepted
Commit 33fbc907359fb1e69a61072929a919bd5dfa8100
Headers show
Series [FFmpeg-devel,1/2] avcodec/tscc2: Don't check for errors for complete VLCs
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Oct. 29, 2020, 2:58 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/mimic.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c
index 2563a49d53..0f8103ef85 100644
--- a/libavcodec/mimic.c
+++ b/libavcodec/mimic.c
@@ -34,6 +34,7 @@ 
 #include "thread.h"
 
 #define MIMIC_HEADER_SIZE   20
+#define MIMIC_VLC_BITS      11
 
 typedef struct MimicContext {
     AVCodecContext *avctx;
@@ -141,7 +142,7 @@  static av_cold int mimic_decode_init(AVCodecContext *avctx)
     ctx->prev_index = 0;
     ctx->cur_index  = 15;
 
-    if ((ret = init_vlc(&ctx->vlc, 11, FF_ARRAY_ELEMS(huffbits),
+    if ((ret = init_vlc(&ctx->vlc, MIMIC_VLC_BITS, FF_ARRAY_ELEMS(huffbits),
                         huffbits, 1, 1, huffcodes, 4, 4, 0)) < 0) {
         av_log(avctx, AV_LOG_ERROR, "error initializing vlc table\n");
         return ret;
@@ -239,7 +240,7 @@  static int vlc_decode_block(MimicContext *ctx, int num_coeffs, int qscale)
         int value;
         int coeff;
 
-        vlc = get_vlc2(&ctx->gb, ctx->vlc.table, ctx->vlc.bits, 3);
+        vlc = get_vlc2(&ctx->gb, ctx->vlc.table, MIMIC_VLC_BITS, 3);
         if (!vlc) /* end-of-block code */
             return 0;
         if (vlc == -1)