avcodec/dnxhddec: Only keep what is used from ScanTable

Namely ScanTable.permutated.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
pull/388/head
Andreas Rheinhardt 2 years ago
parent 1da5da19b1
commit b1bcff3ac0
  1. 8
      libavcodec/dnxhddec.c

@ -65,7 +65,7 @@ typedef struct DNXHDContext {
int cur_field; ///< current interlaced field int cur_field; ///< current interlaced field
VLC ac_vlc, dc_vlc, run_vlc; VLC ac_vlc, dc_vlc, run_vlc;
IDCTDSPContext idsp; IDCTDSPContext idsp;
ScanTable scantable; uint8_t permutated_scantable[64];
const CIDEntry *cid_table; const CIDEntry *cid_table;
int bit_depth; // 8, 10, 12 or 0 if not initialized at all. int bit_depth; // 8, 10, 12 or 0 if not initialized at all.
int is_444; int is_444;
@ -275,8 +275,8 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
if (ctx->bit_depth != old_bit_depth) { if (ctx->bit_depth != old_bit_depth) {
ff_blockdsp_init(&ctx->bdsp); ff_blockdsp_init(&ctx->bdsp);
ff_idctdsp_init(&ctx->idsp, ctx->avctx); ff_idctdsp_init(&ctx->idsp, ctx->avctx);
ff_init_scantable(ctx->idsp.idct_permutation, &ctx->scantable, ff_permute_scantable(ctx->permutated_scantable, ff_zigzag_direct,
ff_zigzag_direct); ctx->idsp.idct_permutation);
} }
// make sure profile size constraints are respected // make sure profile size constraints are respected
@ -436,7 +436,7 @@ static av_always_inline int dnxhd_decode_dct_block(const DNXHDContext *ctx,
break; break;
} }
j = ctx->scantable.permutated[i]; j = ctx->permutated_scantable[i];
level *= scale[i]; level *= scale[i];
level += scale[i] >> 1; level += scale[i] >> 1;
if (level_bias < 32 || weight_matrix[i] != level_bias) if (level_bias < 32 || weight_matrix[i] != level_bias)

Loading…
Cancel
Save