diff mbox series

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

Message ID 20211113210916.49167-2-rcombs@rcombs.me
State New
Headers show
Series [FFmpeg-devel,01/15] lavu/pixfmt: add high-bit-depth semi-planar 4:2:2/4:4:4 formats | expand

Checks

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

Commit Message

rcombs Nov. 13, 2021, 9:09 p.m. UTC
---
 libswscale/input.c | 14 ++++++++++++++
 libswscale/utils.c |  6 ++++++
 2 files changed, 20 insertions(+)

Comments

James Almer Nov. 14, 2021, 2:35 p.m. UTC | #1
On 11/13/2021 6:09 PM, rcombs wrote:
> ---
>   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)

This and the previous patch both probably change the output of some FATE 
test, and they will need to be updated.
diff mbox series

Patch

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)