diff mbox series

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

Message ID 20201023205454.851696-2-andreas.rheinhardt@gmail.com
State Accepted
Commit 51eda4c394f1b0c1b8aee67b90e10150ddae2f7c
Headers show
Series [FFmpeg-devel,1/4] avcodec/atrac3plus: Perform reusing of VLCs during init
Related show

Checks

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

Commit Message

Andreas Rheinhardt Oct. 23, 2020, 8:54 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/imc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Michael Niedermayer Oct. 24, 2020, 12:38 p.m. UTC | #1
On Fri, Oct 23, 2020 at 10:54:52PM +0200, Andreas Rheinhardt wrote:
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavcodec/imc.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

LGTM

thx

[...]
diff mbox series

Patch

diff --git a/libavcodec/imc.c b/libavcodec/imc.c
index 6766d53643..70ad5b1dbd 100644
--- a/libavcodec/imc.c
+++ b/libavcodec/imc.c
@@ -110,6 +110,7 @@  typedef struct IMCContext {
 
 static VLC huffman_vlc[4][4];
 
+#define IMC_VLC_BITS 9
 #define VLC_TABLES_SIZE 9512
 
 static const int vlc_offsets[17] = {
@@ -238,7 +239,7 @@  static av_cold int imc_decode_init(AVCodecContext *avctx)
         for (j = 0; j < 4; j++) {
             huffman_vlc[i][j].table = &vlc_tables[vlc_offsets[i * 4 + j]];
             huffman_vlc[i][j].table_allocated = vlc_offsets[i * 4 + j + 1] - vlc_offsets[i * 4 + j];
-            init_vlc(&huffman_vlc[i][j], 9, imc_huffman_sizes[i],
+            init_vlc(&huffman_vlc[i][j], IMC_VLC_BITS, imc_huffman_sizes[i],
                      imc_huffman_lens[i][j], 1, 1,
                      imc_huffman_bits[i][j], 2, 2, INIT_VLC_USE_NEW_STATIC);
         }
@@ -348,7 +349,7 @@  static void imc_read_level_coeffs(IMCContext *q, int stream_format_code,
         levlCoeffs[0] = get_bits(&q->gb, 7);
     for (i = start; i < BANDS; i++) {
         levlCoeffs[i] = get_vlc2(&q->gb, hufftab[cb_sel[i]]->table,
-                                 hufftab[cb_sel[i]]->bits, 2);
+                                 IMC_VLC_BITS, 2);
         if (levlCoeffs[i] == 17)
             levlCoeffs[i] += get_bits(&q->gb, 4);
     }