From 1a07df31128da3a0020b66502399989b91770d44 Mon Sep 17 00:00:00 2001 From: Vittorio Giovara Date: Tue, 27 Jan 2015 20:56:20 +0000 Subject: DNxHD: Add support for id 1258 (DNx100 960x720@8) Signed-off-by: Vittorio Giovara --- libavcodec/dnxhddec.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libavcodec/dnxhddec.c') diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c index 9b1e48158d..eb00e86af3 100644 --- a/libavcodec/dnxhddec.c +++ b/libavcodec/dnxhddec.c @@ -165,6 +165,15 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, if ((ret = dnxhd_init_vlc(ctx, cid)) < 0) return ret; + // make sure profile size constraints are respected + // DNx100 allows 1920->1440 and 1280->960 subsampling + if (ctx->width != ctx->cid_table->width) { + av_reduce(&ctx->avctx->sample_aspect_ratio.num, + &ctx->avctx->sample_aspect_ratio.den, + ctx->width, ctx->cid_table->width, 255); + ctx->width = ctx->cid_table->width; + } + if (buf_size < ctx->cid_table->coding_unit_size) { av_log(ctx->avctx, AV_LOG_ERROR, "incorrect frame size (%d < %d).\n", buf_size, ctx->cid_table->coding_unit_size); -- cgit v1.2.3