avcodec/videotoolbox: choose AYUV pixel format when ideal

Signed-off-by: James Almer <jamrial@gmail.com>
pull/153/merge
James Almer 5 months ago
parent d41e5b0fc7
commit de923595fd
  1. 5
      libavcodec/videotoolbox.c

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

Loading…
Cancel
Save