[FFmpeg-devel] [PATCH] dnxhdenc: fix usage of discording scans

Christophe Gisquet christophe.gisquet at gmail.com
Fri Oct 2 20:57:14 CEST 2015


Forward and inverse DCTs may not have the same permutation table,
resulting in a bitstream where the AC coefficients are encoded in
an unexpected order.
---
 libavcodec/dnxhdenc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index 7d96cd4..adfdbf3 100644
--- a/libavcodec/dnxhdenc.c
+++ b/libavcodec/dnxhdenc.c
@@ -471,7 +471,7 @@ void dnxhd_encode_block(DNXHDEncContext *ctx, int16_t *block,
     ctx->m.last_dc[n] = block[0];
 
     for (i = 1; i <= last_index; i++) {
-        j = ctx->m.intra_scantable.permutated[i];
+        j = ctx->m.intra_scantable.scantable[i];
         slevel = block[j];
         if (slevel) {
             int run_level = i - last_non_zero - 1;
@@ -498,7 +498,7 @@ void dnxhd_unquantize_c(DNXHDEncContext *ctx, int16_t *block, int n,
                             : ctx->cid_table->luma_weight;
 
     for (i = 1; i <= last_index; i++) {
-        int j = ctx->m.intra_scantable.permutated[i];
+        int j = ctx->m.intra_scantable.scantable[i];
         level = block[j];
         if (level) {
             if (level < 0) {
@@ -546,7 +546,7 @@ int dnxhd_calc_ac_bits(DNXHDEncContext *ctx, int16_t *block, int last_index)
     int bits = 0;
     int i, j, level;
     for (i = 1; i <= last_index; i++) {
-        j = ctx->m.intra_scantable.permutated[i];
+        j = ctx->m.intra_scantable.scantable[i];
         level = block[j];
         if (level) {
             int run_level = i - last_non_zero - 1;
-- 
2.5.2



More information about the ffmpeg-devel mailing list