Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 0/4] swscale/input: Add support for new VAAPI formats
@ 2022-09-05  5:14 Philip Langdale
  2022-09-05  5:14 ` [FFmpeg-devel] [PATCH 1/4] swscale/input: add support for XV36LE Philip Langdale
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Philip Langdale @ 2022-09-05  5:14 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Philip Langdale

This patch set adds swscale input support for the formats used by vaapi
for high bit depth content that are not already supported:

* 12bit 4:2:0 -> P012
* 12bit 4:2:2 -> Y212
* 10bit 4:4:4 -> XV30
* 12bit 4:4:4 -> XV36

Except for P012 where the code already existed, I've only implemented
it for LE because these formats are only interesting when working with
Intel VAAPI and that will always be a little endian system.

Philip Langdale (4):
  swscale/input: add support for XV36LE
  swscale/input: add support for P012
  swscale/input: add support for XV30LE
  swscale/input: add support for Y212LE

 libswscale/input.c | 224 ++++++++++++++++++++++++++++++---------------
 libswscale/utils.c |   5 +
 2 files changed, 155 insertions(+), 74 deletions(-)

-- 
2.34.1

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

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [FFmpeg-devel] [PATCH 1/4] swscale/input: add support for XV36LE
  2022-09-05  5:14 [FFmpeg-devel] [PATCH 0/4] swscale/input: Add support for new VAAPI formats Philip Langdale
@ 2022-09-05  5:14 ` Philip Langdale
  2022-09-05  8:40   ` Xiang, Haihao
  2022-09-05  5:14 ` [FFmpeg-devel] [PATCH 2/4] swscale/input: add support for P012 Philip Langdale
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Philip Langdale @ 2022-09-05  5:14 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Philip Langdale

Signed-off-by: Philip Langdale <philipl@overt.org>
---
 libswscale/input.c | 25 +++++++++++++++++++++++++
 libswscale/utils.c |  1 +
 2 files changed, 26 insertions(+)

diff --git a/libswscale/input.c b/libswscale/input.c
index 92681c9c53..8032360907 100644
--- a/libswscale/input.c
+++ b/libswscale/input.c
@@ -685,6 +685,25 @@ static void read_vuya_A_c(uint8_t *dst, const uint8_t *src, const uint8_t *unuse
         dst[i] = src[i * 4 + 3];
 }
 
+static void read_xv36le_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_RL16(src + i * 8 + 2) >> 4);
+}
+
+
+static void read_xv36le_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_RL16(src + i * 8 + 0) >> 4);
+        AV_WN16(dstV + i * 2, AV_RL16(src + i * 8 + 4) >> 4);
+    }
+}
+
 /* This is almost identical to the previous, end exists only because
  * yuy2ToY/UV)(dst, src + 1, ...) would have 100% unaligned accesses. */
 static void uyvyToY_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2,  int width,
@@ -1381,6 +1400,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
     case AV_PIX_FMT_AYUV64LE:
         c->chrToYV12 = read_ayuv64le_UV_c;
         break;
+    case AV_PIX_FMT_XV36LE:
+        c->chrToYV12 = read_xv36le_UV_c;
+        break;
     case AV_PIX_FMT_P010LE:
     case AV_PIX_FMT_P210LE:
     case AV_PIX_FMT_P410LE:
@@ -1759,6 +1781,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
     case AV_PIX_FMT_AYUV64LE:
         c->lumToYV12 = read_ayuv64le_Y_c;
         break;
+    case AV_PIX_FMT_XV36LE:
+        c->lumToYV12 = read_xv36le_Y_c;
+        break;
     case AV_PIX_FMT_YUYV422:
     case AV_PIX_FMT_YVYU422:
     case AV_PIX_FMT_YA8:
diff --git a/libswscale/utils.c b/libswscale/utils.c
index a621a35862..a67e07b612 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -262,6 +262,7 @@ static const FormatEntry format_entries[] = {
     [AV_PIX_FMT_VUYX]        = { 1, 1 },
     [AV_PIX_FMT_RGBAF16BE]   = { 1, 0 },
     [AV_PIX_FMT_RGBAF16LE]   = { 1, 0 },
+    [AV_PIX_FMT_XV36LE]      = { 1, 0 },
 };
 
 int ff_shuffle_filter_coefficients(SwsContext *c, int *filterPos,
-- 
2.34.1

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

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [FFmpeg-devel] [PATCH 2/4] swscale/input: add support for P012
  2022-09-05  5:14 [FFmpeg-devel] [PATCH 0/4] swscale/input: Add support for new VAAPI formats Philip Langdale
  2022-09-05  5:14 ` [FFmpeg-devel] [PATCH 1/4] swscale/input: add support for XV36LE Philip Langdale
@ 2022-09-05  5:14 ` Philip Langdale
  2022-09-05  5:14 ` [FFmpeg-devel] [PATCH 3/4] swscale/input: add support for XV30LE Philip Langdale
  2022-09-05  5:14 ` [FFmpeg-devel] [PATCH 4/4] swscale/input: add support for Y212LE Philip Langdale
  3 siblings, 0 replies; 7+ messages in thread
From: Philip Langdale @ 2022-09-05  5:14 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Philip Langdale

As we now have three of these formats, I added macros to generate the
conversion functions.

Signed-off-by: Philip Langdale <philipl@overt.org>
---
 libswscale/input.c | 123 +++++++++++++++++++++++----------------------
 libswscale/utils.c |   2 +
 2 files changed, 66 insertions(+), 59 deletions(-)

diff --git a/libswscale/input.c b/libswscale/input.c
index 8032360907..babedfd541 100644
--- a/libswscale/input.c
+++ b/libswscale/input.c
@@ -749,67 +749,60 @@ static void nv21ToUV_c(uint8_t *dstU, uint8_t *dstV,
     nvXXtoUV_c(dstV, dstU, src1, width);
 }
 
-static void p010LEToY_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1,
-                        const uint8_t *unused2, int width, uint32_t *unused, void *opq)
-{
-    int i;
-    for (i = 0; i < width; i++) {
-        AV_WN16(dst + i * 2, AV_RL16(src + i * 2) >> 6);
-    }
-}
-
-static void p010BEToY_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1,
-                        const uint8_t *unused2, int width, uint32_t *unused, void *opq)
-{
-    int i;
-    for (i = 0; i < width; i++) {
-        AV_WN16(dst + i * 2, AV_RB16(src + i * 2) >> 6);
+#define p01x_uv_wrapper(bits, shift) \
+    static void p0 ## bits ## LEToUV_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)      \
+    {                                                                    \
+        int i;                                                           \
+        for (i = 0; i < width; i++) {                                    \
+            AV_WN16(dstU + i * 2, AV_RL16(src1 + i * 4 + 0) >> shift);   \
+            AV_WN16(dstV + i * 2, AV_RL16(src1 + i * 4 + 2) >> shift);   \
+        }                                                                \
+    }                                                                    \
+                                                                         \
+    static void p0 ## bits ## BEToUV_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)      \
+    {                                                                    \
+        int i;                                                           \
+        for (i = 0; i < width; i++) {                                    \
+            AV_WN16(dstU + i * 2, AV_RB16(src1 + i * 4 + 0) >> shift);   \
+            AV_WN16(dstV + i * 2, AV_RB16(src1 + i * 4 + 2) >> shift);   \
+        }                                                                \
     }
-}
 
-static void p010LEToUV_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)
-{
-    int i;
-    for (i = 0; i < width; i++) {
-        AV_WN16(dstU + i * 2, AV_RL16(src1 + i * 4 + 0) >> 6);
-        AV_WN16(dstV + i * 2, AV_RL16(src1 + i * 4 + 2) >> 6);
-    }
-}
-
-static void p010BEToUV_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)
-{
-    int i;
-    for (i = 0; i < width; i++) {
-        AV_WN16(dstU + i * 2, AV_RB16(src1 + i * 4 + 0) >> 6);
-        AV_WN16(dstV + i * 2, AV_RB16(src1 + i * 4 + 2) >> 6);
-    }
-}
-
-static void p016LEToUV_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)
-{
-    int i;
-    for (i = 0; i < width; i++) {
-        AV_WN16(dstU + i * 2, AV_RL16(src1 + i * 4 + 0));
-        AV_WN16(dstV + i * 2, AV_RL16(src1 + i * 4 + 2));
-    }
-}
-
-static void p016BEToUV_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)
-{
-    int i;
-    for (i = 0; i < width; i++) {
-        AV_WN16(dstU + i * 2, AV_RB16(src1 + i * 4 + 0));
-        AV_WN16(dstV + i * 2, AV_RB16(src1 + i * 4 + 2));
-    }
-}
+#define p01x_wrapper(bits, shift) \
+    static void p0 ## bits ## LEToY_c(uint8_t *dst, const uint8_t *src,  \
+                                      const uint8_t *unused1,            \
+                                      const uint8_t *unused2, int width, \
+                                      uint32_t *unused, void *opq)       \
+    {                                                                    \
+        int i;                                                           \
+        for (i = 0; i < width; i++) {                                    \
+            AV_WN16(dst + i * 2, AV_RL16(src + i * 2) >> shift);         \
+        }                                                                \
+    }                                                                    \
+                                                                         \
+    static void p0 ## bits ## BEToY_c(uint8_t *dst, const uint8_t *src,  \
+                                      const uint8_t *unused1,            \
+                                      const uint8_t *unused2, int width, \
+                                      uint32_t *unused, void *opq)       \
+    {                                                                    \
+        int i;                                                           \
+        for (i = 0; i < width; i++) {                                    \
+            AV_WN16(dst + i * 2, AV_RB16(src + i * 2) >> shift);         \
+        }                                                                \
+    }                                                                    \
+    p01x_uv_wrapper(bits, shift)
+
+p01x_wrapper(10, 6);
+p01x_wrapper(12, 4);
+p01x_uv_wrapper(16, 0);
 
 #define input_pixel(pos) (isBE(origin) ? AV_RB16(pos) : AV_RL16(pos))
 
@@ -1413,6 +1406,12 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
     case AV_PIX_FMT_P410BE:
         c->chrToYV12 = p010BEToUV_c;
         break;
+    case AV_PIX_FMT_P012LE:
+        c->chrToYV12 = p012LEToUV_c;
+        break;
+    case AV_PIX_FMT_P012BE:
+        c->chrToYV12 = p012BEToUV_c;
+        break;
     case AV_PIX_FMT_P016LE:
     case AV_PIX_FMT_P216LE:
     case AV_PIX_FMT_P416LE:
@@ -1893,6 +1892,12 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
     case AV_PIX_FMT_P410BE:
         c->lumToYV12 = p010BEToY_c;
         break;
+    case AV_PIX_FMT_P012LE:
+        c->lumToYV12 = p012LEToY_c;
+        break;
+    case AV_PIX_FMT_P012BE:
+        c->lumToYV12 = p012BEToY_c;
+        break;
     case AV_PIX_FMT_GRAYF32LE:
         c->lumToYV12 = grayf32leToY16_c;
         break;
diff --git a/libswscale/utils.c b/libswscale/utils.c
index a67e07b612..a7f77cd39d 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -236,6 +236,8 @@ static const FormatEntry format_entries[] = {
     [AV_PIX_FMT_AYUV64LE]    = { 1, 1},
     [AV_PIX_FMT_P010LE]      = { 1, 1 },
     [AV_PIX_FMT_P010BE]      = { 1, 1 },
+    [AV_PIX_FMT_P012LE]      = { 1, 0 },
+    [AV_PIX_FMT_P012BE]      = { 1, 0 },
     [AV_PIX_FMT_P016LE]      = { 1, 1 },
     [AV_PIX_FMT_P016BE]      = { 1, 1 },
     [AV_PIX_FMT_GRAYF32LE]   = { 1, 1 },
-- 
2.34.1

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

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [FFmpeg-devel] [PATCH 3/4] swscale/input: add support for XV30LE
  2022-09-05  5:14 [FFmpeg-devel] [PATCH 0/4] swscale/input: Add support for new VAAPI formats Philip Langdale
  2022-09-05  5:14 ` [FFmpeg-devel] [PATCH 1/4] swscale/input: add support for XV36LE Philip Langdale
  2022-09-05  5:14 ` [FFmpeg-devel] [PATCH 2/4] swscale/input: add support for P012 Philip Langdale
@ 2022-09-05  5:14 ` Philip Langdale
  2022-09-05  5:14 ` [FFmpeg-devel] [PATCH 4/4] swscale/input: add support for Y212LE Philip Langdale
  3 siblings, 0 replies; 7+ messages in thread
From: Philip Langdale @ 2022-09-05  5:14 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Philip Langdale

Signed-off-by: Philip Langdale <philipl@overt.org>
---
 libswscale/input.c | 25 +++++++++++++++++++++++++
 libswscale/utils.c |  1 +
 2 files changed, 26 insertions(+)

diff --git a/libswscale/input.c b/libswscale/input.c
index babedfd541..f4f08c8f72 100644
--- a/libswscale/input.c
+++ b/libswscale/input.c
@@ -685,6 +685,25 @@ static void read_vuya_A_c(uint8_t *dst, const uint8_t *src, const uint8_t *unuse
         dst[i] = src[i * 4 + 3];
 }
 
+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)
+{
+    int i;
+    for (i = 0; i < width; i++)
+        AV_WN16(dst + i * 2, (AV_RL32(src + i * 4) >> 10) & 0x3FFu);
+}
+
+
+static void read_xv30le_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_RL32(src + i * 4) & 0x3FFu);
+        AV_WN16(dstV + i * 2, (AV_RL32(src + i * 4) >> 20) & 0x3FFu);
+    }
+}
+
 static void read_xv36le_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
                                uint32_t *unused2, void *opq)
 {
@@ -1390,6 +1409,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
     case AV_PIX_FMT_VUYX:
         c->chrToYV12 = read_vuyx_UV_c;
         break;
+    case AV_PIX_FMT_XV30LE:
+        c->chrToYV12 = read_xv30le_UV_c;
+        break;
     case AV_PIX_FMT_AYUV64LE:
         c->chrToYV12 = read_ayuv64le_UV_c;
         break;
@@ -1777,6 +1799,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
     case AV_PIX_FMT_VUYX:
         c->lumToYV12 = read_vuyx_Y_c;
         break;
+    case AV_PIX_FMT_XV30LE:
+        c->lumToYV12 = read_xv30le_Y_c;
+        break;
     case AV_PIX_FMT_AYUV64LE:
         c->lumToYV12 = read_ayuv64le_Y_c;
         break;
diff --git a/libswscale/utils.c b/libswscale/utils.c
index a7f77cd39d..ab86037cd4 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -264,6 +264,7 @@ static const FormatEntry format_entries[] = {
     [AV_PIX_FMT_VUYX]        = { 1, 1 },
     [AV_PIX_FMT_RGBAF16BE]   = { 1, 0 },
     [AV_PIX_FMT_RGBAF16LE]   = { 1, 0 },
+    [AV_PIX_FMT_XV30LE]      = { 1, 0 },
     [AV_PIX_FMT_XV36LE]      = { 1, 0 },
 };
 
-- 
2.34.1

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

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [FFmpeg-devel] [PATCH 4/4] swscale/input: add support for Y212LE
  2022-09-05  5:14 [FFmpeg-devel] [PATCH 0/4] swscale/input: Add support for new VAAPI formats Philip Langdale
                   ` (2 preceding siblings ...)
  2022-09-05  5:14 ` [FFmpeg-devel] [PATCH 3/4] swscale/input: add support for XV30LE Philip Langdale
@ 2022-09-05  5:14 ` Philip Langdale
  3 siblings, 0 replies; 7+ messages in thread
From: Philip Langdale @ 2022-09-05  5:14 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Philip Langdale

Signed-off-by: Philip Langdale <philipl@overt.org>
---
 libswscale/input.c | 45 ++++++++++++++++++++++++++++++---------------
 libswscale/utils.c |  1 +
 2 files changed, 31 insertions(+), 15 deletions(-)

diff --git a/libswscale/input.c b/libswscale/input.c
index f4f08c8f72..be8f3940e1 100644
--- a/libswscale/input.c
+++ b/libswscale/input.c
@@ -559,23 +559,32 @@ static void yvy2ToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, con
     av_assert1(src1 == src2);
 }
 
-static void y210le_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_RL16(src + i * 8 + 2) >> 6);
-        AV_WN16(dstV + i * 2, AV_RL16(src + i * 8 + 6) >> 6);
+#define y21xle_wrapper(bits, shift) \
+    static void y2 ## bits ## le_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_RL16(src + i * 8 + 2) >> shift);    \
+            AV_WN16(dstV + i * 2, AV_RL16(src + i * 8 + 6) >> shift);    \
+        }                                                                \
+    }                                                                    \
+                                                                         \
+    static void y2 ## bits ## le_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_RL16(src + i * 4) >> shift);         \
     }
-}
 
-static void y210le_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_RL16(src + i * 4) >> 6);
-}
+y21xle_wrapper(10, 6);
+y21xle_wrapper(12, 4);
 
 static void bswap16Y_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1, const uint8_t *unused2, int width,
                        uint32_t *unused, void *opq)
@@ -1447,6 +1456,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
     case AV_PIX_FMT_Y210LE:
         c->chrToYV12 = y210le_UV_c;
         break;
+    case AV_PIX_FMT_Y212LE:
+        c->chrToYV12 = y212le_UV_c;
+        break;
     }
     if (c->chrSrcHSubSample) {
         switch (srcFormat) {
@@ -1932,6 +1944,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
     case AV_PIX_FMT_Y210LE:
         c->lumToYV12 = y210le_Y_c;
         break;
+    case AV_PIX_FMT_Y212LE:
+        c->lumToYV12 = y212le_Y_c;
+        break;
     case AV_PIX_FMT_X2RGB10LE:
         c->lumToYV12 = rgb30leToY_c;
         break;
diff --git a/libswscale/utils.c b/libswscale/utils.c
index ab86037cd4..a5a9bc589a 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -249,6 +249,7 @@ static const FormatEntry format_entries[] = {
     [AV_PIX_FMT_NV24]        = { 1, 1 },
     [AV_PIX_FMT_NV42]        = { 1, 1 },
     [AV_PIX_FMT_Y210LE]      = { 1, 0 },
+    [AV_PIX_FMT_Y212LE]      = { 1, 0 },
     [AV_PIX_FMT_X2RGB10LE]   = { 1, 1 },
     [AV_PIX_FMT_X2BGR10LE]   = { 1, 1 },
     [AV_PIX_FMT_P210BE]      = { 1, 1 },
-- 
2.34.1

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

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/4] swscale/input: add support for XV36LE
  2022-09-05  5:14 ` [FFmpeg-devel] [PATCH 1/4] swscale/input: add support for XV36LE Philip Langdale
@ 2022-09-05  8:40   ` Xiang, Haihao
  2022-09-05 18:07     ` Philip Langdale
  0 siblings, 1 reply; 7+ messages in thread
From: Xiang, Haihao @ 2022-09-05  8:40 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: philipl

On Sun, 2022-09-04 at 22:14 -0700, Philip Langdale wrote:
> Signed-off-by: Philip Langdale <philipl@overt.org>
> ---
>  libswscale/input.c | 25 +++++++++++++++++++++++++
>  libswscale/utils.c |  1 +
>  2 files changed, 26 insertions(+)
> 
> diff --git a/libswscale/input.c b/libswscale/input.c
> index 92681c9c53..8032360907 100644
> --- a/libswscale/input.c
> +++ b/libswscale/input.c
> @@ -685,6 +685,25 @@ static void read_vuya_A_c(uint8_t *dst, const uint8_t
> *src, const uint8_t *unuse
>          dst[i] = src[i * 4 + 3];
>  }
>  
> +static void read_xv36le_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_RL16(src + i * 8 + 2) >> 4);
> +}
> +
> +
> +static void read_xv36le_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_RL16(src + i * 8 + 0) >> 4);
> +        AV_WN16(dstV + i * 2, AV_RL16(src + i * 8 + 4) >> 4);
> +    }
> +}
> +
>  /* This is almost identical to the previous, end exists only because
>   * yuy2ToY/UV)(dst, src + 1, ...) would have 100% unaligned accesses. */
>  static void uyvyToY_c(uint8_t *dst, const uint8_t *src, const uint8_t
> *unused1, const uint8_t *unused2,  int width,
> @@ -1381,6 +1400,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
>      case AV_PIX_FMT_AYUV64LE:
>          c->chrToYV12 = read_ayuv64le_UV_c;
>          break;
> +    case AV_PIX_FMT_XV36LE:
> +        c->chrToYV12 = read_xv36le_UV_c;
> +        break;
>      case AV_PIX_FMT_P010LE:
>      case AV_PIX_FMT_P210LE:
>      case AV_PIX_FMT_P410LE:
> @@ -1759,6 +1781,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
>      case AV_PIX_FMT_AYUV64LE:
>          c->lumToYV12 = read_ayuv64le_Y_c;
>          break;
> +    case AV_PIX_FMT_XV36LE:
> +        c->lumToYV12 = read_xv36le_Y_c;
> +        break;
>      case AV_PIX_FMT_YUYV422:
>      case AV_PIX_FMT_YVYU422:
>      case AV_PIX_FMT_YA8:
> diff --git a/libswscale/utils.c b/libswscale/utils.c
> index a621a35862..a67e07b612 100644
> --- a/libswscale/utils.c
> +++ b/libswscale/utils.c
> @@ -262,6 +262,7 @@ static const FormatEntry format_entries[] = {
>      [AV_PIX_FMT_VUYX]        = { 1, 1 },
>      [AV_PIX_FMT_RGBAF16BE]   = { 1, 0 },
>      [AV_PIX_FMT_RGBAF16LE]   = { 1, 0 },
> +    [AV_PIX_FMT_XV36LE]      = { 1, 0 },
>  };
>  
>  int ff_shuffle_filter_coefficients(SwsContext *c, int *filterPos,

Patchset LGTM. You have another patchset for output, right?

Thanks
Haihao

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

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/4] swscale/input: add support for XV36LE
  2022-09-05  8:40   ` Xiang, Haihao
@ 2022-09-05 18:07     ` Philip Langdale
  0 siblings, 0 replies; 7+ messages in thread
From: Philip Langdale @ 2022-09-05 18:07 UTC (permalink / raw)
  To: Xiang, Haihao; +Cc: ffmpeg-devel

On Mon, 5 Sep 2022 08:40:28 +0000
"Xiang, Haihao" <haihao.xiang@intel.com> wrote:

> On Sun, 2022-09-04 at 22:14 -0700, Philip Langdale wrote:
> > Signed-off-by: Philip Langdale <philipl@overt.org>
> > ---
> >  libswscale/input.c | 25 +++++++++++++++++++++++++
> >  libswscale/utils.c |  1 +
> >  2 files changed, 26 insertions(+)
> > 
> 
> Patchset LGTM. You have another patchset for output, right?
> 
> Thanks
> Haihao
> 

Eventually. I still need to write it.

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

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-09-05 18:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-05  5:14 [FFmpeg-devel] [PATCH 0/4] swscale/input: Add support for new VAAPI formats Philip Langdale
2022-09-05  5:14 ` [FFmpeg-devel] [PATCH 1/4] swscale/input: add support for XV36LE Philip Langdale
2022-09-05  8:40   ` Xiang, Haihao
2022-09-05 18:07     ` Philip Langdale
2022-09-05  5:14 ` [FFmpeg-devel] [PATCH 2/4] swscale/input: add support for P012 Philip Langdale
2022-09-05  5:14 ` [FFmpeg-devel] [PATCH 3/4] swscale/input: add support for XV30LE Philip Langdale
2022-09-05  5:14 ` [FFmpeg-devel] [PATCH 4/4] swscale/input: add support for Y212LE Philip Langdale

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git