[FFmpeg-devel] [PATCH 02/15] swscale: add P216/P410/P416 input

rcombs rcombs at rcombs.me
Sat Nov 13 23:09:03 EET 2021


---
 libswscale/input.c | 14 ++++++++++++++
 libswscale/utils.c |  6 ++++++
 2 files changed, 20 insertions(+)

diff --git a/libswscale/input.c b/libswscale/input.c
index 336f957c8c..5c8a28c665 100644
--- a/libswscale/input.c
+++ b/libswscale/input.c
@@ -1244,15 +1244,21 @@ 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_P410LE:
         c->chrToYV12 = p010LEToUV_c;
         break;
     case AV_PIX_FMT_P010BE:
+    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:
@@ -1525,6 +1531,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:
@@ -1567,6 +1575,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:
@@ -1693,9 +1703,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_NV20LE:
+    case AV_PIX_FMT_P410LE:
         c->lumToYV12 = p010LEToY_c;
         break;
     case AV_PIX_FMT_P010BE:
+    case AV_PIX_FMT_NV20BE:
+    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..b00acc8447 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -268,6 +268,12 @@ 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_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)
-- 
2.33.1



More information about the ffmpeg-devel mailing list