[FFmpeg-cvslog] swscale/input: add V30X input support

James Almer git at videolan.org
Wed Oct 9 04:27:18 EEST 2024


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Mon Oct  7 13:36:19 2024 -0300| [04612351ab52ad043fa680731ae5a0f021433ffd] | committer: James Almer

swscale/input: add V30X input support

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

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

 libswscale/input.c   | 26 ++++++++++++++++++++++++++
 libswscale/utils.c   |  1 +
 libswscale/version.h |  2 +-
 3 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/libswscale/input.c b/libswscale/input.c
index 7237333e56..35c1fb771e 100644
--- a/libswscale/input.c
+++ b/libswscale/input.c
@@ -764,6 +764,26 @@ static void vyuToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, cons
     }
 }
 
+static void read_v30xle_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
+                               uint32_t *unused2, void *opq)
+{
+    int i;
+    for (i = 0; i < width; i++)
+        AV_WN16(dst + i * 2, (AV_RL32(src + i * 4) >> 12) & 0x3FFu);
+}
+
+
+static void read_v30xle_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src,
+                               const uint8_t *unused1, int width, uint32_t *unused2, void *opq)
+{
+    int i;
+    for (i = 0; i < width; i++) {
+        unsigned int uv = AV_RL32(src + i * 4);
+        AV_WN16(dstU + i * 2, (uv >>  2) & 0x3FFu);
+        AV_WN16(dstV + i * 2, (uv >> 22) & 0x3FFu);
+    }
+}
+
 static void read_xv30le_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
                                uint32_t *unused2, void *opq)
 {
@@ -1501,6 +1521,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c,
     case AV_PIX_FMT_XV30LE:
         *chrToYV12 = read_xv30le_UV_c;
         break;
+    case AV_PIX_FMT_V30XLE:
+        *chrToYV12 = read_v30xle_UV_c;
+        break;
     case AV_PIX_FMT_AYUV:
         *chrToYV12 = read_ayuv_UV_c;
         break;
@@ -1908,6 +1931,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c,
     case AV_PIX_FMT_XV30LE:
         *lumToYV12 = read_xv30le_Y_c;
         break;
+    case AV_PIX_FMT_V30XLE:
+        *lumToYV12 = read_v30xle_Y_c;
+        break;
     case AV_PIX_FMT_AYUV:
     case AV_PIX_FMT_UYVA:
         *lumToYV12 = read_ayuv_Y_c;
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 9caf392993..e2ad71a38d 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -271,6 +271,7 @@ static const FormatEntry format_entries[] = {
     [AV_PIX_FMT_AYUV]        = { 1, 0 },
     [AV_PIX_FMT_UYVA]        = { 1, 0 },
     [AV_PIX_FMT_VYU444]      = { 1, 0 },
+    [AV_PIX_FMT_V30XLE]      = { 1, 0 },
 };
 
 /**
diff --git a/libswscale/version.h b/libswscale/version.h
index 12412bd538..c13db31c43 100644
--- a/libswscale/version.h
+++ b/libswscale/version.h
@@ -28,7 +28,7 @@
 
 #include "version_major.h"
 
-#define LIBSWSCALE_VERSION_MINOR   4
+#define LIBSWSCALE_VERSION_MINOR   5
 #define LIBSWSCALE_VERSION_MICRO 100
 
 #define LIBSWSCALE_VERSION_INT  AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \



More information about the ffmpeg-cvslog mailing list