diff options
author | Christophe Gisquet <christophe.gisquet@gmail.com> | 2014-08-30 15:04:03 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-10-11 16:47:19 +0200 |
commit | 140f535517e93409b4718b25094528d2a367737e (patch) | |
tree | d95c641d957749d15b8f4322c375b698cfe96f1c | |
parent | c44d8d9552f976b02dab45bd2a77a8efba38f38b (diff) | |
download | ffmpeg-140f535517e93409b4718b25094528d2a367737e.tar.gz |
proresenc_ks: use chroma sampling in autoselection
If the chroma planes aren't subsampled, automatically select
the 4:4:4:4 profile.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/proresenc_kostya.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c index ad27e16150..5f432a97cd 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) { |