[FFmpeg-cvslog] dnxhddec: proper rule for interlaced mb flag
Christophe Gisquet
git at videolan.org
Sat Sep 26 16:44:02 CEST 2015
ffmpeg | branch: master | Christophe Gisquet <christophe.gisquet at gmail.com> | Sat Sep 26 14:31:55 2015 +0200| [e4b7c3a9f21b9be84fe3ba9aed953c60720c6459] | committer: Michael Niedermayer
dnxhddec: proper rule for interlaced mb flag
It currently only applies to CID 1260, but this flag is dependent on
a higher-level flag located in the header.
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e4b7c3a9f21b9be84fe3ba9aed953c60720c6459
---
libavcodec/dnxhddec.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 044e479..e5c5f07 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -50,6 +50,7 @@ typedef struct DNXHDContext {
const CIDEntry *cid_table;
int bit_depth; // 8, 10 or 0 if not initialized at all.
int is_444;
+ int mbaff;
void (*decode_dct_block)(struct DNXHDContext *ctx, int16_t *block,
int n, int qscale);
int last_qscale;
@@ -144,6 +145,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
} else {
ctx->cur_field = 0;
}
+ ctx->mbaff = buf[0x6] & 32;
ctx->height = AV_RB16(buf + 0x18);
ctx->width = AV_RB16(buf + 0x1a);
@@ -183,6 +185,9 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
if ((ret = dnxhd_init_vlc(ctx, cid)) < 0)
return ret;
+ if (ctx->mbaff && ctx->cid_table->cid != 1260)
+ av_log(ctx->avctx, AV_LOG_WARNING,
+ "Adaptive MB interlace flag in an unsupported profile.\n");
// make sure profile size constraints are respected
// DNx100 allows 1920->1440 and 1280->960 subsampling
@@ -352,7 +357,7 @@ static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame,
int qscale, i;
int interlaced_mb = 0;
- if (ctx->cid_table->cid == 1260) {
+ if (ctx->mbaff) {
interlaced_mb = get_bits1(&ctx->gb);
qscale = get_bits(&ctx->gb, 10);
} else
More information about the ffmpeg-cvslog
mailing list