summaryrefslogtreecommitdiff
path: root/libavcodec/dnxhddec.c
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2011-07-22 00:13:27 +0100
committerMans Rullgard <mans@mansr.com>2011-07-22 23:39:31 +0100
commitb4cfb8254eeeb2fc0aa2c0c36a5ede208af47a79 (patch)
tree4999eea6118df069146f8f4adfdbd2387b5b9d7c /libavcodec/dnxhddec.c
parent406fbd24dc62db4853cb24b24f40caf3e70ee2e8 (diff)
dnxhddec: avoid a branch in 10-bit decode_dct_block()
The minimum weight value is 32 so this test can be skipped for the 10-bit case. Overall speedup 3-4%. Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavcodec/dnxhddec.c')
-rw-r--r--libavcodec/dnxhddec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 426be2e985..63ccd08b48 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -239,7 +239,7 @@ static av_always_inline void dnxhd_decode_dct_block(DNXHDContext *ctx,
//av_log(ctx->avctx, AV_LOG_DEBUG, "j %d\n", j);
//av_log(ctx->avctx, AV_LOG_DEBUG, "level %d, weight %d\n", level, weight_matrix[i]);
level = (2*level+1) * qscale * weight_matrix[i];
- if (weight_matrix[i] != level_bias)
+ if (level_bias < 32 || weight_matrix[i] != level_bias)
level += level_bias;
level >>= level_shift;