Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Gisquet <christophe.gisquet@gmail.com>2015-10-01 23:01:26 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2015-10-02 19:08:36 +0300
commitc7e14a279fa7348db10ec824bb2d67858cb1c1ca (patch)
tree3f93bffc6d66fd4d0d86bb13e42daaf8aab9acb2 /libavcodec/dnxhddec.c
parent7e4070d2e70bbd0e70dd83c06089e465a0eda704 (diff)
dnxhddec: use dequantization formula from specs
The current one, while correct, does not yield the best possible results. The specificiations suggest another formula, which results in quality gains in the decoded output from fate tests. This justifies changing said formula. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/dnxhddec.c')
-rw-r--r--libavcodec/dnxhddec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 755cf9a753..fce0fc93e5 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -357,8 +357,9 @@ static av_always_inline int dnxhd_decode_dct_block(const DNXHDContext *ctx,
j = ctx->scantable.permutated[i];
level *= scale[i];
+ level += scale[i] >> 1;
if (level_bias < 32 || weight_matrix[i] != level_bias)
- level += level_bias;
+ level += level_bias; // 1<<(level_shift-1)
level >>= level_shift;
block[j] = (level ^ sign) - sign;