[FFmpeg-devel] avutil - swscale : add YUVA444P12 and YUVA422P12

Michael Niedermayer michael at niedermayer.cc
Sun Nov 18 02:07:01 EET 2018


On Sat, Nov 17, 2018 at 04:41:26PM +0100, Martin Vignali wrote:
> Hello,
> 
> Patch in attach add new pix fmt YUVA444P12 and YUVA422P12
> 
> In order to add 12b decoding for prores
> 
> 
> Martin

>  libavutil/pixdesc.c              |   52 +++++++++++++++++++++++++++++++++++++++
>  libavutil/pixfmt.h               |    7 +++++
>  libavutil/version.h              |    2 -
>  tests/ref/fate/sws-pixdesc-query |   22 ++++++++++++++++
>  4 files changed, 82 insertions(+), 1 deletion(-)
> 779ef6c966151c1007e56f8b170c36386f3e7a5c  0001-avutil-add-YUVA444P12-and-YUVA422P12.patch
> From f2fea009730a0ddd5351e14fe21598fec863393c Mon Sep 17 00:00:00 2001
> From: Martin Vignali <martin.vignali at gmail.com>
> Date: Sat, 17 Nov 2018 16:27:30 +0100
> Subject: [PATCH 1/2] avutil : add YUVA444P12 and YUVA422P12
> 
> ---
>  libavutil/pixdesc.c              | 52 ++++++++++++++++++++++++++++++++++++++++
>  libavutil/pixfmt.h               |  7 ++++++
>  libavutil/version.h              |  2 +-
>  tests/ref/fate/sws-pixdesc-query | 22 +++++++++++++++++
>  4 files changed, 82 insertions(+), 1 deletion(-)
> 
> diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
> index 1c36577289..fe38344d73 100644
> --- a/libavutil/pixdesc.c
> +++ b/libavutil/pixdesc.c
> @@ -2268,6 +2268,58 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
>          .flags = AV_PIX_FMT_FLAG_FLOAT,
>          .alias = "yf32le",
>      },
> +    [AV_PIX_FMT_YUVA422P12BE] = {
> +        .name = "yuva422p12be",
> +        .nb_components = 4,
> +        .log2_chroma_w = 1,
> +        .log2_chroma_h = 0,
> +        .comp = {
> +            { 0, 2, 0, 0, 12, 1, 11, 1 },        /* Y */
> +            { 1, 2, 0, 0, 12, 1, 11, 1 },        /* U */
> +            { 2, 2, 0, 0, 12, 1, 11, 1 },        /* V */
> +            { 3, 2, 0, 0, 12, 1, 11, 1 },        /* A */
> +        },
> +        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
> +    },
> +    [AV_PIX_FMT_YUVA422P12LE] = {
> +        .name = "yuva422p12le",
> +        .nb_components = 4,
> +        .log2_chroma_w = 1,
> +        .log2_chroma_h = 0,
> +        .comp = {
> +            { 0, 2, 0, 0, 12, 1, 11, 1 },        /* Y */
> +            { 1, 2, 0, 0, 12, 1, 11, 1 },        /* U */
> +            { 2, 2, 0, 0, 12, 1, 11, 1 },        /* V */
> +            { 3, 2, 0, 0, 12, 1, 11, 1 },        /* A */
> +        },
> +        .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
> +    },
> +    [AV_PIX_FMT_YUVA444P12BE] = {
> +        .name = "yuva444p12be",
> +        .nb_components = 4,
> +        .log2_chroma_w = 0,
> +        .log2_chroma_h = 0,
> +        .comp = {
> +            { 0, 2, 0, 0, 12, 1, 11, 1 },        /* Y */
> +            { 1, 2, 0, 0, 12, 1, 11, 1 },        /* U */
> +            { 2, 2, 0, 0, 12, 1, 11, 1 },        /* V */
> +            { 3, 2, 0, 0, 12, 1, 11, 1 },        /* A */
> +        },
> +        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
> +    },
> +    [AV_PIX_FMT_YUVA444P12LE] = {
> +        .name = "yuva444p12le",
> +        .nb_components = 4,
> +        .log2_chroma_w = 0,
> +        .log2_chroma_h = 0,
> +        .comp = {
> +            { 0, 2, 0, 0, 12, 1, 11, 1 },        /* Y */
> +            { 1, 2, 0, 0, 12, 1, 11, 1 },        /* U */
> +            { 2, 2, 0, 0, 12, 1, 11, 1 },        /* V */
> +            { 3, 2, 0, 0, 12, 1, 11, 1 },        /* A */
> +        },
> +        .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
> +    },
>  };
>  #if FF_API_PLUS1_MINUS1
>  FF_ENABLE_DEPRECATION_WARNINGS
> diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
> index 6815f8dc7b..bcc344a4ea 100644
> --- a/libavutil/pixfmt.h
> +++ b/libavutil/pixfmt.h
> @@ -340,6 +340,11 @@ enum AVPixelFormat {
>      AV_PIX_FMT_GRAYF32BE,  ///< IEEE-754 single precision Y, 32bpp, big-endian
>      AV_PIX_FMT_GRAYF32LE,  ///< IEEE-754 single precision Y, 32bpp, little-endian
>  

> +    AV_PIX_FMT_YUVA422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), 12b alpha, big-endian
> +    AV_PIX_FMT_YUVA422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), 12b alpha,  little-endian
> +    AV_PIX_FMT_YUVA444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), 12b alpha,  big-endian
> +    AV_PIX_FMT_YUVA444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), 12b alpha,  little-endian

vertical align


[...]
>  libswscale/input.c                         |    8 ++++++++
>  libswscale/utils.c                         |    4 ++++
>  tests/ref/fate/filter-pixdesc-yuva422p12be |    1 +
>  tests/ref/fate/filter-pixdesc-yuva422p12le |    1 +
>  tests/ref/fate/filter-pixdesc-yuva444p12be |    1 +
>  tests/ref/fate/filter-pixdesc-yuva444p12le |    1 +
>  tests/ref/fate/filter-pixfmts-copy         |    4 ++++
>  tests/ref/fate/filter-pixfmts-crop         |    4 ++++
>  tests/ref/fate/filter-pixfmts-field        |    4 ++++
>  tests/ref/fate/filter-pixfmts-fieldorder   |    4 ++++
>  tests/ref/fate/filter-pixfmts-hflip        |    4 ++++
>  tests/ref/fate/filter-pixfmts-il           |    4 ++++
>  tests/ref/fate/filter-pixfmts-null         |    4 ++++
>  tests/ref/fate/filter-pixfmts-pad          |    2 ++
>  tests/ref/fate/filter-pixfmts-scale        |    4 ++++
>  tests/ref/fate/filter-pixfmts-swapuv       |    4 ++++
>  tests/ref/fate/filter-pixfmts-transpose    |    2 ++
>  tests/ref/fate/filter-pixfmts-vflip        |    4 ++++
>  18 files changed, 60 insertions(+)
> 97cac8062163245bc2fce983d5dc2c67d3c0eed4  0002-swscale-add-support-for-YUVA444p12-and-YUVA422P12.patch
> From e18f4931fdb9b3e4548534f141272d2c47b66c25 Mon Sep 17 00:00:00 2001
> From: Martin Vignali <martin.vignali at gmail.com>
> Date: Sat, 17 Nov 2018 16:38:53 +0100

> Subject: [PATCH 2/2] swscale : add support for YUVA444p12 and YUVA422P12
                                                        ^
typo

besides these, if you checked that the output is vissually looking correct
then the patchset should be ok

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20181118/f5eed389/attachment.sig>


More information about the ffmpeg-devel mailing list