Hi,

according to:
https://documentation.apple.com/en/finalcutpro/professionalformatsandworkflows/index.html#chapter=10%26section=2%26tasks=true
the "ProRes 4444" is the only profile to handle 4:4:4(:4) sources.

The patch therefore checks the chroma sampling when trying to
determine automatically the profile.

-- 
Christophe
From 36e0b104b303d2d9f3793d5734ddcc319eee3c2e Mon Sep 17 00:00:00 2001
From: Christophe Gisquet <christophe.gisq...@gmail.com>
Date: Sat, 30 Aug 2014 15:04:03 +0200
Subject: [PATCH] proresenc_ks: use chroma sampling in autoselection

If the chroma planes aren't subsampled, automatically select
the 4:4:4:4 profile.
---
 libavcodec/proresenc_kostya.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c
index ad27e16..5f432a9 100644
--- a/libavcodec/proresenc_kostya.c
+++ b/libavcodec/proresenc_kostya.c
@@ -1148,11 +1148,13 @@ static av_cold int encode_init(AVCodecContext *avctx)
         return AVERROR(EINVAL);
     }
     if (ctx->profile == PRORES_PROFILE_AUTO) {
-        ctx->profile = av_pix_fmt_desc_get(avctx->pix_fmt)->flags & AV_PIX_FMT_FLAG_ALPHA
+        const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
+        ctx->profile = (desc->flags & AV_PIX_FMT_FLAG_ALPHA ||
+                        !(desc->log2_chroma_w + desc->log2_chroma_h))
                      ? PRORES_PROFILE_4444 : PRORES_PROFILE_HQ;
         av_log(avctx, AV_LOG_INFO, "Autoselected %s. It can be overridden "
                "through -profile option.\n", ctx->profile == PRORES_PROFILE_4444
-               ? "4:4:4:4 profile because of the alpha channel"
+               ? "4:4:4:4 profile because of the used input colorspace"
                : "HQ profile to keep best quality");
     }
     if (av_pix_fmt_desc_get(avctx->pix_fmt)->flags & AV_PIX_FMT_FLAG_ALPHA) {
-- 
1.9.2.msysgit.0

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

Reply via email to