ffmpeg | branch: master | James Almer <jamr...@gmail.com> | Thu Mar  6 13:57:03 
2025 -0300| [228713ef5dc74b86dea91f55c3743fb075d86399] | committer: James Almer

swscale/input: add support for UYYVYY411

Signed-off-by: James Almer <jamr...@gmail.com>

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

 libswscale/input.c   | 23 +++++++++++++++++++++++
 libswscale/utils.c   |  2 +-
 libswscale/version.h |  2 +-
 3 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/libswscale/input.c b/libswscale/input.c
index 9633df5d19..cab8de6d3f 100644
--- a/libswscale/input.c
+++ b/libswscale/input.c
@@ -904,6 +904,23 @@ static void uyvyToUV_c(uint8_t *dstU, uint8_t *dstV, const 
uint8_t *unused0, con
     av_assert1(src1 == src2);
 }
 
+static void uyyvyyToY_c(uint8_t *dst, const uint8_t *src, const uint8_t 
*unused1, const uint8_t *unused2,
+                        int width, uint32_t *unused, void *opq)
+{
+    for (int i = 0; i < width; i++)
+        dst[i]  = src[3 * (i >> 1) + 1 + (i & 1)];
+}
+
+static void uyyvyyToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, 
const uint8_t *src1,
+                         const uint8_t *src2, int width, uint32_t *unused, 
void *opq)
+{
+    for (int i = 0; i < width; i++) {
+        dstU[i] = src1[6 * i + 0];
+        dstV[i] = src1[6 * i + 3];
+    }
+    av_assert1(src1 == src2);
+}
+
 static av_always_inline void nvXXtoUV_c(uint8_t *dst1, uint8_t *dst2,
                                         const uint8_t *src, int width)
 {
@@ -1714,6 +1731,9 @@ av_cold void ff_sws_init_input_funcs(SwsInternal *c,
     case AV_PIX_FMT_UYVY422:
         *chrToYV12 = uyvyToUV_c;
         break;
+    case AV_PIX_FMT_UYYVYY411:
+        *chrToYV12 = uyyvyyToUV_c;
+        break;
     case AV_PIX_FMT_VYU444:
         *chrToYV12 = vyuToUV_c;
         break;
@@ -2351,6 +2371,9 @@ av_cold void ff_sws_init_input_funcs(SwsInternal *c,
     case AV_PIX_FMT_UYVY422:
         *lumToYV12 = uyvyToY_c;
         break;
+    case AV_PIX_FMT_UYYVYY411:
+        *lumToYV12 = uyyvyyToY_c;
+        break;
     case AV_PIX_FMT_VYU444:
         *lumToYV12 = vyuToY_c;
         break;
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 953bf015e4..389efd7c68 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -91,7 +91,7 @@ static const FormatEntry format_entries[] = {
     [AV_PIX_FMT_YUVJ444P]    = { 1, 1 },
     [AV_PIX_FMT_YVYU422]     = { 1, 1 },
     [AV_PIX_FMT_UYVY422]     = { 1, 1 },
-    [AV_PIX_FMT_UYYVYY411]   = { 0, 0 },
+    [AV_PIX_FMT_UYYVYY411]   = { 1, 0 },
     [AV_PIX_FMT_BGR8]        = { 1, 1 },
     [AV_PIX_FMT_BGR4]        = { 0, 1 },
     [AV_PIX_FMT_BGR4_BYTE]   = { 1, 1 },
diff --git a/libswscale/version.h b/libswscale/version.h
index c0f1f0fadc..7b0c323e23 100644
--- a/libswscale/version.h
+++ b/libswscale/version.h
@@ -29,7 +29,7 @@
 #include "version_major.h"
 
 #define LIBSWSCALE_VERSION_MINOR  13
-#define LIBSWSCALE_VERSION_MICRO 101
+#define LIBSWSCALE_VERSION_MICRO 102
 
 #define LIBSWSCALE_VERSION_INT  AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
                                                LIBSWSCALE_VERSION_MINOR, \

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to