This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 868426814a4744ae3f27300bb12d56e2a8bf70ff
Author:     Niklas Haas <[email protected]>
AuthorDate: Thu Dec 4 19:32:16 2025 +0100
Commit:     Niklas Haas <[email protected]>
CommitDate: Mon Dec 8 16:58:53 2025 +0000

    swscale/format: handle YA format swizzles more robustly
    
    This code was previously broken; since YAF32BE/LE were not included as
    part of the format enumeration. However, since we *always* know the correct
    swizzle for YA formats, we can just special-case this by the number of
    components instead.
---
 libswscale/format.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libswscale/format.c b/libswscale/format.c
index 2ae6d50523..5ac0418266 100644
--- a/libswscale/format.c
+++ b/libswscale/format.c
@@ -630,6 +630,10 @@ static SwsPixelType fmt_pixel_type(enum AVPixelFormat fmt)
 
 static SwsSwizzleOp fmt_swizzle(enum AVPixelFormat fmt)
 {
+    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(fmt);
+    if (desc->nb_components == 2) /* YA formats */
+        return (SwsSwizzleOp) {{ .x = 0, 3, 1, 2 }};
+
     switch (fmt) {
     case AV_PIX_FMT_ARGB:
     case AV_PIX_FMT_0RGB:
@@ -663,10 +667,6 @@ static SwsSwizzleOp fmt_swizzle(enum AVPixelFormat fmt)
     case AV_PIX_FMT_X2BGR10LE:
     case AV_PIX_FMT_X2BGR10BE:
         return (SwsSwizzleOp) {{ .x = 3, 2, 1, 0 }};
-    case AV_PIX_FMT_YA8:
-    case AV_PIX_FMT_YA16BE:
-    case AV_PIX_FMT_YA16LE:
-        return (SwsSwizzleOp) {{ .x = 0, 3, 1, 2 }};
     case AV_PIX_FMT_XV30BE:
     case AV_PIX_FMT_XV30LE:
         return (SwsSwizzleOp) {{ .x = 3, 2, 0, 1 }};

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to