diff options
author | Christophe Gisquet <christophe.gisquet@gmail.com> | 2015-10-12 19:37:42 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-10-13 00:01:39 +0200 |
commit | 9f3bfe30dd99b093a469e566dbd95448b32f80e9 (patch) | |
tree | 71aba6a09f800c415c0917a4f32cc1186cc67460 /libavcodec/dnxhdenc.c | |
parent | 97437bd17a8c5d4135b2f3b1b299bd7bb72ce02c (diff) | |
download | ffmpeg-9f3bfe30dd99b093a469e566dbd95448b32f80e9.tar.gz |
mpegvideo: dnxhdenc: permute 10bits content
Dequant or encoding were trying to reverse a scan that hadn't been
applied...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/dnxhdenc.c')
-rw-r--r-- | libavcodec/dnxhdenc.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c index 7d96cd4f78..1e14b8cb1f 100644 --- a/libavcodec/dnxhdenc.c +++ b/libavcodec/dnxhdenc.c @@ -128,6 +128,11 @@ static int dnxhd_10bit_dct_quantize(MpegEncContext *ctx, int16_t *block, last_non_zero = i; } + /* we need this permutation so that we correct the IDCT, we only permute the !=0 elements */ + if (ctx->idsp.perm_type != FF_IDCT_PERM_NONE) + ff_block_permute(block, ctx->idsp.idct_permutation, + scantable, last_non_zero); + return last_non_zero; } @@ -241,7 +246,7 @@ static av_cold int dnxhd_init_qmat(DNXHDEncContext *ctx, int lbias, int cbias) // 10-bit for (qscale = 1; qscale <= ctx->m.avctx->qmax; qscale++) { for (i = 1; i < 64; i++) { - int j = ctx->m.idsp.idct_permutation[ff_zigzag_direct[i]]; + int j = ff_zigzag_direct[i]; /* The quantization formula from the VC-3 standard is: * quantized = sign(block[i]) * floor(abs(block[i]/s) * p / |