diff options
author | Christophe Gisquet <christophe.gisquet@gmail.com> | 2015-10-01 23:01:26 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-10-02 19:08:36 +0300 |
commit | c7e14a279fa7348db10ec824bb2d67858cb1c1ca (patch) | |
tree | 3f93bffc6d66fd4d0d86bb13e42daaf8aab9acb2 /libavcodec/dnxhddec.c | |
parent | 7e4070d2e70bbd0e70dd83c06089e465a0eda704 (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.c | 3 |
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; |