aboutsummaryrefslogtreecommitdiff
path: root/libavcodec/dnxhddec.c
diff options
context:
space:
mode:
authorChristophe Gisquet2015-10-14 19:20:49 +0200
committerMichael Niedermayer2015-10-15 02:46:29 +0200
commit96b165fae24b84a703728a8d34ef1ecb944471ab (patch)
tree15f2ced4434f8465c56fd8a214db5db27bc5751a /libavcodec/dnxhddec.c
parent2c2d1624a2e70693045868b8b841a24a9b711507 (diff)
dnxhd: interleave AC levels and flags
This allows more efficient access to the array as the level and flags are contiguous. Around 4% faster coefficient decoding. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/dnxhddec.c')
-rw-r--r--libavcodec/dnxhddec.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 3b1fbdb0c9..2eb07ec5d8 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -327,8 +327,7 @@ static av_always_inline int dnxhd_decode_dct_block(const DNXHDContext *ctx,
int level, component, sign;
const int *scale;
const uint8_t *weight_matrix;
- const uint8_t *ac_level = ctx->cid_table->ac_level;
- const uint8_t *ac_flags = ctx->cid_table->ac_flags;
+ const uint8_t *ac_info = ctx->cid_table->ac_info;
int16_t *block = row->blocks[n];
const int eob_index = ctx->cid_table->eob_index;
int ret = 0;
@@ -375,8 +374,8 @@ static av_always_inline int dnxhd_decode_dct_block(const DNXHDContext *ctx,
DNXHD_VLC_BITS, 2);
while (index1 != eob_index) {
- level = ac_level[index1];
- flags = ac_flags[index1];
+ level = ac_info[2*index1+0];
+ flags = ac_info[2*index1+1];
sign = SHOW_SBITS(bs, &row->gb, 1);
SKIP_BITS(bs, &row->gb, 1);