[FFmpeg-devel] [PATCH 9/9] dnxhdenc: fix scan used for bitstream generation

Christophe Gisquet christophe.gisquet at gmail.com
Sat Oct 3 18:59:22 CEST 2015


The functions related to bitstream reading must use the natural zigzag
order, and not the one permuted for use in the iDCT.

This resulted in a bitstream where the AC coefficients were encoded in
an unexpected order.
---
 libavcodec/dnxhdenc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index 7d96cd4..6eb5e1e 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;
@@ -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