avcodec/videotoolbox: choose AYUV pixel format when ideal

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2024-10-06 15:00:33 -03:00
parent d41e5b0fc7
commit de923595fd
1 changed files with 2 additions and 3 deletions

View File

@ -1180,11 +1180,10 @@ static enum AVPixelFormat videotoolbox_best_pixel_format(AVCodecContext *avctx)
if (!descriptor)
return AV_PIX_FMT_NV12; // same as av_videotoolbox_alloc_context()
depth = descriptor->comp[0].depth;
if (descriptor->flags & AV_PIX_FMT_FLAG_ALPHA)
return AV_PIX_FMT_AYUV64;
depth = descriptor->comp[0].depth;
return (depth > 8) ? AV_PIX_FMT_AYUV64 : AV_PIX_FMT_AYUV;
#if HAVE_KCVPIXELFORMATTYPE_444YPCBCR16BIPLANARVIDEORANGE
if (depth > 10)