[FFmpeg-cvslog] avcodec/videotoolbox: choose AYUV pixel format when ideal

James Almer git at videolan.org
Sat Oct 12 18:02:14 EEST 2024


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Sun Oct  6 15:00:33 2024 -0300| [de923595fd1c3ad4f01c700c40ef8ccce133d6ad] | committer: James Almer

avcodec/videotoolbox: choose AYUV pixel format when ideal

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=de923595fd1c3ad4f01c700c40ef8ccce133d6ad
---

 libavcodec/videotoolbox.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
index 90c1fbfb10..a606c29ded 100644
--- a/libavcodec/videotoolbox.c
+++ b/libavcodec/videotoolbox.c
@@ -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)



More information about the ffmpeg-cvslog mailing list