diff mbox series

[FFmpeg-devel,03/16] swscale: add P210/P410/P216/P416 input

Message ID 20211122205330.43546-3-rcombs@rcombs.me
State New
Headers show
Series [FFmpeg-devel,01/16] ffmpeg: remove ffmpeg_videotoolbox
Related show

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

rcombs Nov. 22, 2021, 8:53 p.m. UTC
---
 libswscale/input.c               | 16 ++++++++++++
 libswscale/utils.c               |  8 ++++++
 libswscale/version.h             |  2 +-
 tests/ref/fate/sws-pixdesc-query | 44 ++++++++++++++++++++++++++++++++
 4 files changed, 69 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libswscale/input.c b/libswscale/input.c
index 1351ea5bd4..6acc39f89f 100644
--- a/libswscale/input.c
+++ b/libswscale/input.c
@@ -1238,15 +1238,23 @@  av_cold void ff_sws_init_input_funcs(SwsContext *c)
         c->chrToYV12 = read_ayuv64le_UV_c;
         break;
     case AV_PIX_FMT_P010LE:
+    case AV_PIX_FMT_P210LE:
+    case AV_PIX_FMT_P410LE:
         c->chrToYV12 = p010LEToUV_c;
         break;
     case AV_PIX_FMT_P010BE:
+    case AV_PIX_FMT_P210BE:
+    case AV_PIX_FMT_P410BE:
         c->chrToYV12 = p010BEToUV_c;
         break;
     case AV_PIX_FMT_P016LE:
+    case AV_PIX_FMT_P216LE:
+    case AV_PIX_FMT_P416LE:
         c->chrToYV12 = p016LEToUV_c;
         break;
     case AV_PIX_FMT_P016BE:
+    case AV_PIX_FMT_P216BE:
+    case AV_PIX_FMT_P416BE:
         c->chrToYV12 = p016BEToUV_c;
         break;
     case AV_PIX_FMT_Y210LE:
@@ -1519,6 +1527,8 @@  av_cold void ff_sws_init_input_funcs(SwsContext *c)
     case AV_PIX_FMT_GRAY16LE:
 
     case AV_PIX_FMT_P016LE:
+    case AV_PIX_FMT_P216LE:
+    case AV_PIX_FMT_P416LE:
         c->lumToYV12 = bswap16Y_c;
         break;
     case AV_PIX_FMT_YUVA420P9LE:
@@ -1561,6 +1571,8 @@  av_cold void ff_sws_init_input_funcs(SwsContext *c)
     case AV_PIX_FMT_GRAY16BE:
 
     case AV_PIX_FMT_P016BE:
+    case AV_PIX_FMT_P216BE:
+    case AV_PIX_FMT_P416BE:
         c->lumToYV12 = bswap16Y_c;
         break;
     case AV_PIX_FMT_YUVA420P9BE:
@@ -1687,9 +1699,13 @@  av_cold void ff_sws_init_input_funcs(SwsContext *c)
         c->lumToYV12 = bgr64LEToY_c;
         break;
     case AV_PIX_FMT_P010LE:
+    case AV_PIX_FMT_P210LE:
+    case AV_PIX_FMT_P410LE:
         c->lumToYV12 = p010LEToY_c;
         break;
     case AV_PIX_FMT_P010BE:
+    case AV_PIX_FMT_P210BE:
+    case AV_PIX_FMT_P410BE:
         c->lumToYV12 = p010BEToY_c;
         break;
     case AV_PIX_FMT_GRAYF32LE:
diff --git a/libswscale/utils.c b/libswscale/utils.c
index c726922527..ae92ac9fbc 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -268,6 +268,14 @@  static const FormatEntry format_entries[] = {
     [AV_PIX_FMT_Y210LE]      = { 1, 0 },
     [AV_PIX_FMT_X2RGB10LE]   = { 1, 1 },
     [AV_PIX_FMT_X2BGR10LE]   = { 1, 1 },
+    [AV_PIX_FMT_P210BE]      = { 1, 0 },
+    [AV_PIX_FMT_P210LE]      = { 1, 0 },
+    [AV_PIX_FMT_P410BE]      = { 1, 0 },
+    [AV_PIX_FMT_P410LE]      = { 1, 0 },
+    [AV_PIX_FMT_P216BE]      = { 1, 0 },
+    [AV_PIX_FMT_P216LE]      = { 1, 0 },
+    [AV_PIX_FMT_P416BE]      = { 1, 0 },
+    [AV_PIX_FMT_P416LE]      = { 1, 0 },
 };
 
 int sws_isSupportedInput(enum AVPixelFormat pix_fmt)
diff --git a/libswscale/version.h b/libswscale/version.h
index 0d3b7cf363..15ad54319c 100644
--- a/libswscale/version.h
+++ b/libswscale/version.h
@@ -28,7 +28,7 @@ 
 
 #define LIBSWSCALE_VERSION_MAJOR   6
 #define LIBSWSCALE_VERSION_MINOR   1
-#define LIBSWSCALE_VERSION_MICRO 100
+#define LIBSWSCALE_VERSION_MICRO 101
 
 #define LIBSWSCALE_VERSION_INT  AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
                                                LIBSWSCALE_VERSION_MINOR, \
diff --git a/tests/ref/fate/sws-pixdesc-query b/tests/ref/fate/sws-pixdesc-query
index a74109c3d7..553c039061 100644
--- a/tests/ref/fate/sws-pixdesc-query
+++ b/tests/ref/fate/sws-pixdesc-query
@@ -13,6 +13,10 @@  is16BPS:
   gray16le
   p016be
   p016le
+  p216be
+  p216le
+  p416be
+  p416le
   rgb48be
   rgb48le
   rgba64be
@@ -57,6 +61,10 @@  isNBPS:
   nv20le
   p010be
   p010le
+  p210be
+  p210le
+  p410be
+  p410le
   x2bgr10be
   x2bgr10le
   x2rgb10be
@@ -140,6 +148,10 @@  isBE:
   nv20be
   p010be
   p016be
+  p210be
+  p216be
+  p410be
+  p416be
   rgb444be
   rgb48be
   rgb555be
@@ -193,6 +205,14 @@  isYUV:
   p010le
   p016be
   p016le
+  p210be
+  p210le
+  p216be
+  p216le
+  p410be
+  p410le
+  p416be
+  p416le
   uyvy422
   uyyvyy411
   xyz12be
@@ -287,6 +307,14 @@  isPlanarYUV:
   p010le
   p016be
   p016le
+  p210be
+  p210le
+  p216be
+  p216le
+  p410be
+  p410le
+  p416be
+  p416le
   yuv410p
   yuv411p
   yuv420p
@@ -370,6 +398,14 @@  isSemiPlanarYUV:
   p010le
   p016be
   p016le
+  p210be
+  p210le
+  p216be
+  p216le
+  p410be
+  p410le
+  p416be
+  p416le
 
 isRGB:
   0bgr
@@ -751,6 +787,14 @@  Planar:
   p010le
   p016be
   p016le
+  p210be
+  p210le
+  p216be
+  p216le
+  p410be
+  p410le
+  p416be
+  p416le
   yuv410p
   yuv411p
   yuv420p