diff options
author | Mans Rullgard <mans@mansr.com> | 2011-07-23 00:05:54 +0100 |
---|---|---|
committer | Mans Rullgard <mans@mansr.com> | 2011-07-24 22:29:22 +0100 |
commit | 9dfd89b831f7c5a11b6406164e0d6d65c0392d24 (patch) | |
tree | 767df43d2f2439ac574ad43b265395a6a1d40fe7 /libavcodec/dnxhddec.c | |
parent | 185a2c08c5f5a97b5d36f040651a31d52b6c1e79 (diff) | |
download | ffmpeg-9dfd89b831f7c5a11b6406164e0d6d65c0392d24.tar.gz |
dnxhddec: merge ac_{index,run}_flags
These tables contain only a 1-bit flag each. Combining them reduces
the data size and saves some instructions in the block decode loop.
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavcodec/dnxhddec.c')
-rw-r--r-- | libavcodec/dnxhddec.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c index 9bf1972833..d8fb076bd4 100644 --- a/libavcodec/dnxhddec.c +++ b/libavcodec/dnxhddec.c @@ -179,10 +179,11 @@ static av_always_inline void dnxhd_decode_dct_block(DNXHDContext *ctx, int level_bias, int level_shift) { - int i, j, index1, index2, len; + int i, j, index1, index2, len, flags; int level, component, sign; 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 int eob_index = ctx->cid_table->eob_index; OPEN_READER(bs, &ctx->gb); @@ -214,16 +215,17 @@ static av_always_inline void dnxhd_decode_dct_block(DNXHDContext *ctx, while (index1 != eob_index) { level = ac_level[index1]; + flags = ac_flags[index1]; sign = SHOW_SBITS(bs, &ctx->gb, 1); SKIP_BITS(bs, &ctx->gb, 1); - if (ctx->cid_table->ac_index_flag[index1]) { + if (flags & 1) { level += SHOW_UBITS(bs, &ctx->gb, index_bits) << 7; SKIP_BITS(bs, &ctx->gb, index_bits); } - if (ctx->cid_table->ac_run_flag[index1]) { + if (flags & 2) { UPDATE_CACHE(bs, &ctx->gb); GET_VLC(index2, bs, &ctx->gb, ctx->run_vlc.table, DNXHD_VLC_BITS, 2); |