2015-09-25 23:25 GMT+02:00 Christophe Gisquet <christophe.gisq...@gmail.com>:
[SNIP]

I have reordered the patches so that they don't rely on the slice threading one.
Therefore this one should apply cleanly. (And also not using git
send-email for replies)
From d9601c7b74b5dea0f0be9989cc657fad90c1be7d Mon Sep 17 00:00:00 2001
From: Christophe Gisquet <christophe.gisq...@gmail.com>
Date: Fri, 25 Sep 2015 17:07:38 +0200
Subject: [PATCH 2/5] dnxhddec: parse and print adaptive color transform

Indicates a YCbCr->RGB transform at the block level. Although nothing
explicitly states it, this would assume the actual content is planar
RGB.

Currently unsupported, but the one sequence I found using it flagged
every mb that way, actually meaning the content was YCbCr, and thus
best left to the output format to decide what to do of it.
---
 libavcodec/dnxhddec.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index e5c5f07..22d8c0b 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -51,6 +51,7 @@ typedef struct DNXHDContext {
     int bit_depth; // 8, 10 or 0 if not initialized at all.
     int is_444;
     int mbaff;
+    int act;
     void (*decode_dct_block)(struct DNXHDContext *ctx, int16_t *block,
                              int n, int qscale);
     int last_qscale;
@@ -189,6 +190,11 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
         av_log(ctx->avctx, AV_LOG_WARNING,
                "Adaptive MB interlace flag in an unsupported profile.\n");
 
+    ctx->act = buf[0x2C] & 7;
+    if (ctx->act && ctx->cid_table->cid != 1256)
+        av_log(ctx->avctx, AV_LOG_WARNING,
+               "Adaptive color transform in an unsupported profile.\n");
+
     // make sure profile size constraints are respected
     // DNx100 allows 1920->1440 and 1280->960 subsampling
     if (ctx->width != ctx->cid_table->width) {
@@ -354,7 +360,7 @@ static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame,
     int dct_linesize_chroma = frame->linesize[1];
     uint8_t *dest_y, *dest_u, *dest_v;
     int dct_y_offset, dct_x_offset;
-    int qscale, i;
+    int qscale, i, act;
     int interlaced_mb = 0;
 
     if (ctx->mbaff) {
@@ -362,7 +368,15 @@ static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame,
         qscale = get_bits(&ctx->gb, 10);
     } else
     qscale = get_bits(&ctx->gb, 11);
-    skip_bits1(&ctx->gb);
+    act = get_bits1(&ctx->gb);
+    if (act) {
+        static int warned = 0;
+        if (!warned) {
+            warned = 1;
+            av_log(ctx->avctx, AV_LOG_ERROR,
+                   "Unsupported adaptive color transform, patch welcome.\n");
+        }
+    }
 
     if (qscale != ctx->last_qscale) {
         for (i = 0; i < 64; i++) {
-- 
2.5.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to