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

James Almer git at videolan.org
Thu Oct 17 18:03:39 EEST 2024


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Tue Oct 15 14:38:22 2024 -0300| [5a699c8db95d31985bb8514e7c9038b0b610eded] | committer: James Almer

swscale/input: add AYUV64BE input support

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

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

 libswscale/input.c | 34 ++++++++++++++++++++++++++++++++++
 libswscale/utils.c |  1 +
 2 files changed, 35 insertions(+)

diff --git a/libswscale/input.c b/libswscale/input.c
index 6ac76f6752..bb5e31a428 100644
--- a/libswscale/input.c
+++ b/libswscale/input.c
@@ -665,6 +665,13 @@ static void read_ayuv64le_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *u
         AV_WN16(dst + i * 2, AV_RL16(src + i * 8 + 2));
 }
 
+static void read_ayuv64be_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_RB16(src + i * 8 + 2));
+}
 
 static void read_ayuv64le_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)
@@ -676,6 +683,16 @@ static void read_ayuv64le_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unus
     }
 }
 
+static void read_ayuv64be_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++) {
+        AV_WN16(dstU + i * 2, AV_RB16(src + i * 8 + 4));
+        AV_WN16(dstV + i * 2, AV_RB16(src + i * 8 + 6));
+    }
+}
+
 static void read_ayuv64le_A_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
                               uint32_t *unused2, void *opq)
 {
@@ -684,6 +701,14 @@ static void read_ayuv64le_A_c(uint8_t *dst, const uint8_t *src, const uint8_t *u
         AV_WN16(dst + i * 2, AV_RL16(src + i * 8));
 }
 
+static void read_ayuv64be_A_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_RB16(src + i * 8));
+}
+
 static void read_vuyx_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)
 {
@@ -1684,6 +1709,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c,
     case AV_PIX_FMT_AYUV64LE:
         *chrToYV12 = read_ayuv64le_UV_c;
         break;
+    case AV_PIX_FMT_AYUV64BE:
+        *chrToYV12 = read_ayuv64be_UV_c;
+        break;
     case AV_PIX_FMT_UYVA:
         *chrToYV12 = read_uyva_UV_c;
         break;
@@ -2116,6 +2144,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c,
     case AV_PIX_FMT_AYUV64LE:
         *lumToYV12 = read_ayuv64le_Y_c;
         break;
+    case AV_PIX_FMT_AYUV64BE:
+        *lumToYV12 = read_ayuv64be_Y_c;
+        break;
     case AV_PIX_FMT_XV36LE:
         *lumToYV12 = read_xv36le_Y_c;
         break;
@@ -2324,6 +2355,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c,
         case AV_PIX_FMT_AYUV64LE:
             *alpToYV12 = read_ayuv64le_A_c;
             break;
+        case AV_PIX_FMT_AYUV64BE:
+            *alpToYV12 = read_ayuv64be_A_c;
+            break;
         case AV_PIX_FMT_PAL8 :
             *alpToYV12 = palToA_c;
             break;
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 227550451b..09d96b2292 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -231,6 +231,7 @@ static const FormatEntry format_entries[] = {
     [AV_PIX_FMT_XYZ12BE]     = { 1, 1, 1 },
     [AV_PIX_FMT_XYZ12LE]     = { 1, 1, 1 },
     [AV_PIX_FMT_AYUV64LE]    = { 1, 1},
+    [AV_PIX_FMT_AYUV64BE]    = { 1, 0},
     [AV_PIX_FMT_P010LE]      = { 1, 1 },
     [AV_PIX_FMT_P010BE]      = { 1, 1 },
     [AV_PIX_FMT_P012LE]      = { 1, 1 },



More information about the ffmpeg-cvslog mailing list