X-Git-Url: https://git.piment-noir.org/?p=deb_ffmpeg.git;a=blobdiff_plain;f=ffmpeg%2Flibavcodec%2Fproresenc_kostya.c;h=5f432a97cd48269abfb24a95696dfe1d51ec9f2a;hp=9f7c03efca4fecc2c525b427c776eab5403a5e2d;hb=f6fa7814ccfe3e76514b36cf04f5cd3cb657c8cf;hpb=2ba45a602cbfa7b771effba9b11bb4245c21bc00 diff --git a/ffmpeg/libavcodec/proresenc_kostya.c b/ffmpeg/libavcodec/proresenc_kostya.c index 9f7c03e..5f432a9 100644 --- a/ffmpeg/libavcodec/proresenc_kostya.c +++ b/ffmpeg/libavcodec/proresenc_kostya.c @@ -1101,7 +1101,7 @@ static av_cold int encode_close(AVCodecContext *avctx) if (ctx->tdata) { for (i = 0; i < avctx->thread_count; i++) - av_free(ctx->tdata[i].nodes); + av_freep(&ctx->tdata[i].nodes); } av_freep(&ctx->tdata); av_freep(&ctx->slice_q); @@ -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) {