[libav-devel] [PATCH] avutil: add yuva444p10 pixel format

2012-10-01 Thread Luca Barbato
From: Paul B Mahol one...@gmail.com

Signed-off-by: Luca Barbato lu_z...@gentoo.org
---
 libavutil/pixdesc.c   | 26 ++
 libavutil/pixfmt.h|  3 ++-
 libswscale/utils.c|  2 ++
 tests/ref/lavfi/pixdesc   |  2 ++
 tests/ref/lavfi/pixfmts_copy  |  2 ++
 tests/ref/lavfi/pixfmts_null  |  2 ++
 tests/ref/lavfi/pixfmts_scale |  2 ++
 tests/ref/lavfi/pixfmts_vflip |  2 ++
 8 files changed, 40 insertions(+), 1 deletion(-)

diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index d0d5de0..04801a7 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -553,6 +553,32 @@ const AVPixFmtDescriptor 
av_pix_fmt_descriptors[PIX_FMT_NB] = {
 },
 .flags = PIX_FMT_PLANAR,
 },
+[PIX_FMT_YUVA444P10LE] = {
+.name = yuva444p10le,
+.nb_components = 4,
+.log2_chroma_w = 0,
+.log2_chroma_h = 0,
+.comp = {
+{ 0, 1, 1, 0, 9 },/* Y */
+{ 1, 1, 1, 0, 9 },/* U */
+{ 2, 1, 1, 0, 9 },/* V */
+{ 3, 1, 1, 0, 9 },/* A */
+},
+.flags = PIX_FMT_PLANAR,
+},
+[PIX_FMT_YUVA444P10BE] = {
+.name = yuva444p10be,
+.nb_components = 4,
+.log2_chroma_w = 0,
+.log2_chroma_h = 0,
+.comp = {
+{ 0, 1, 1, 0, 9 },/* Y */
+{ 1, 1, 1, 0, 9 },/* U */
+{ 2, 1, 1, 0, 9 },/* V */
+{ 3, 1, 1, 0, 9 },/* A */
+},
+.flags = PIX_FMT_BE | PIX_FMT_PLANAR,
+},
 [PIX_FMT_VDPAU_H264] = {
 .name = vdpau_h264,
 .log2_chroma_w = 1,
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index f3c504a..d3f10ee 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -159,7 +159,8 @@ enum PixelFormat {
 PIX_FMT_GBRP16LE,  /// planar GBR 4:4:4 48bpp, little endian
 PIX_FMT_YUVA422P,  /// planar YUV 4:2:2 24bpp, (1 Cr  Cb sample per 2x1 
Y  A samples)
 PIX_FMT_YUVA444P,  /// planar YUV 4:4:4 32bpp, (1 Cr  Cb sample per 1x1 
Y  A samples)
-
+PIX_FMT_YUVA444P10BE, /// planar YUV 4:4:4 40bpp, (1 Cr  Cb sample per 
1x1 Y  A samples)
+PIX_FMT_YUVA444P10LE, /// planar YUV 4:4:4 40bpp, (1 Cr  Cb sample per 
1x1 Y  A samples)
 PIX_FMT_NB,/// number of pixel formats, DO NOT USE THIS if you 
want to link with shared libav* because the number of formats might differ 
between versions
 };
 
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 2f78e87..7d9c120 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -110,6 +110,8 @@ static const FormatEntry format_entries[PIX_FMT_NB] = {
 [PIX_FMT_YUVA420P]= { 1, 1 },
 [PIX_FMT_YUVA422P]= { 1, 1 },
 [PIX_FMT_YUVA444P]= { 1, 1 },
+[PIX_FMT_YUVA444P10BE]= { 1, 1 },
+[PIX_FMT_YUVA444P10LE]= { 1, 1 },
 [PIX_FMT_RGB48BE] = { 1, 1 },
 [PIX_FMT_RGB48LE] = { 1, 1 },
 [PIX_FMT_RGB565BE]= { 1, 1 },
diff --git a/tests/ref/lavfi/pixdesc b/tests/ref/lavfi/pixdesc
index dc1b857..2e437c1 100644
--- a/tests/ref/lavfi/pixdesc
+++ b/tests/ref/lavfi/pixdesc
@@ -59,6 +59,8 @@ yuv444p9le  f0606604a5c08becab6ba500124c4b7c
 yuva420pa29884f3f3dfe1e00b961bc17bef3d47
 yuva422p92b6815f465297284cdb843711682cee
 yuva444pc523716e4900cfe515eaab1d7124fdd9
+yuva444p10be8feac3ae2a8b97580051a8c9ae761875
+yuva444p10le8c2e1a12c53541bb63fa5f4e3bbc4824
 yuvj420p32eec78ba51857b16ce9b813a49b7189
 yuvj422p0dfa0ed434f73be51428758c69e082cb
 yuvj440p657501a28004e27a592757a7509f5189
diff --git a/tests/ref/lavfi/pixfmts_copy b/tests/ref/lavfi/pixfmts_copy
index dc1b857..5bc31bf 100644
--- a/tests/ref/lavfi/pixfmts_copy
+++ b/tests/ref/lavfi/pixfmts_copy
@@ -59,6 +59,8 @@ yuv444p9le  f0606604a5c08becab6ba500124c4b7c
 yuva420pa29884f3f3dfe1e00b961bc17bef3d47
 yuva422p92b6815f465297284cdb843711682cee
 yuva444pc523716e4900cfe515eaab1d7124fdd9
+yuva444p10be5b511e1df30f12b4f9183043c80db189
+yuva444p10le47e2c61bab822a619172e54053026b09
 yuvj420p32eec78ba51857b16ce9b813a49b7189
 yuvj422p0dfa0ed434f73be51428758c69e082cb
 yuvj440p657501a28004e27a592757a7509f5189
diff --git a/tests/ref/lavfi/pixfmts_null b/tests/ref/lavfi/pixfmts_null
index dc1b857..5bc31bf 100644
--- a/tests/ref/lavfi/pixfmts_null
+++ b/tests/ref/lavfi/pixfmts_null
@@ -59,6 +59,8 @@ yuv444p9le  f0606604a5c08becab6ba500124c4b7c
 yuva420pa29884f3f3dfe1e00b961bc17bef3d47
 yuva422p92b6815f465297284cdb843711682cee
 yuva444pc523716e4900cfe515eaab1d7124fdd9
+yuva444p10be5b511e1df30f12b4f9183043c80db189
+yuva444p10le47e2c61bab822a619172e54053026b09
 yuvj420p32eec78ba51857b16ce9b813a49b7189
 yuvj422p0dfa0ed434f73be51428758c69e082cb
 yuvj440p657501a28004e27a592757a7509f5189

Re: [libav-devel] [PATCH] avutil: add yuva444p10 pixel format

2012-10-01 Thread Ronald S. Bultje
Hi,

On Mon, Oct 1, 2012 at 5:03 AM, Luca Barbato lu_z...@gentoo.org wrote:
 From: Paul B Mahol one...@gmail.com

 Signed-off-by: Luca Barbato lu_z...@gentoo.org
 ---
  libavutil/pixdesc.c   | 26 ++
  libavutil/pixfmt.h|  3 ++-
  libswscale/utils.c|  2 ++
  tests/ref/lavfi/pixdesc   |  2 ++
  tests/ref/lavfi/pixfmts_copy  |  2 ++
  tests/ref/lavfi/pixfmts_null  |  2 ++
  tests/ref/lavfi/pixfmts_scale |  2 ++
  tests/ref/lavfi/pixfmts_vflip |  2 ++
  8 files changed, 40 insertions(+), 1 deletion(-)

 diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
 index d0d5de0..04801a7 100644
 --- a/libavutil/pixdesc.c
 +++ b/libavutil/pixdesc.c
 @@ -553,6 +553,32 @@ const AVPixFmtDescriptor 
 av_pix_fmt_descriptors[PIX_FMT_NB] = {
  },
  .flags = PIX_FMT_PLANAR,
  },
 +[PIX_FMT_YUVA444P10LE] = {
 +.name = yuva444p10le,
 +.nb_components = 4,
 +.log2_chroma_w = 0,
 +.log2_chroma_h = 0,
 +.comp = {
 +{ 0, 1, 1, 0, 9 },/* Y */
 +{ 1, 1, 1, 0, 9 },/* U */
 +{ 2, 1, 1, 0, 9 },/* V */
 +{ 3, 1, 1, 0, 9 },/* A */
 +},
 +.flags = PIX_FMT_PLANAR,
 +},
 +[PIX_FMT_YUVA444P10BE] = {
 +.name = yuva444p10be,
 +.nb_components = 4,
 +.log2_chroma_w = 0,
 +.log2_chroma_h = 0,
 +.comp = {
 +{ 0, 1, 1, 0, 9 },/* Y */
 +{ 1, 1, 1, 0, 9 },/* U */
 +{ 2, 1, 1, 0, 9 },/* V */
 +{ 3, 1, 1, 0, 9 },/* A */
 +},
 +.flags = PIX_FMT_BE | PIX_FMT_PLANAR,
 +},
  [PIX_FMT_VDPAU_H264] = {
  .name = vdpau_h264,
  .log2_chroma_w = 1,
 diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
 index f3c504a..d3f10ee 100644
 --- a/libavutil/pixfmt.h
 +++ b/libavutil/pixfmt.h
 @@ -159,7 +159,8 @@ enum PixelFormat {
  PIX_FMT_GBRP16LE,  /// planar GBR 4:4:4 48bpp, little endian
  PIX_FMT_YUVA422P,  /// planar YUV 4:2:2 24bpp, (1 Cr  Cb sample per 
 2x1 Y  A samples)
  PIX_FMT_YUVA444P,  /// planar YUV 4:4:4 32bpp, (1 Cr  Cb sample per 
 1x1 Y  A samples)
 -
 +PIX_FMT_YUVA444P10BE, /// planar YUV 4:4:4 40bpp, (1 Cr  Cb sample per 
 1x1 Y  A samples)
 +PIX_FMT_YUVA444P10LE, /// planar YUV 4:4:4 40bpp, (1 Cr  Cb sample per 
 1x1 Y  A samples)
  PIX_FMT_NB,/// number of pixel formats, DO NOT USE THIS if you 
 want to link with shared libav* because the number of formats might differ 
 between versions
  };

 diff --git a/libswscale/utils.c b/libswscale/utils.c
 index 2f78e87..7d9c120 100644
 --- a/libswscale/utils.c
 +++ b/libswscale/utils.c
 @@ -110,6 +110,8 @@ static const FormatEntry format_entries[PIX_FMT_NB] = {
  [PIX_FMT_YUVA420P]= { 1, 1 },
  [PIX_FMT_YUVA422P]= { 1, 1 },
  [PIX_FMT_YUVA444P]= { 1, 1 },
 +[PIX_FMT_YUVA444P10BE]= { 1, 1 },
 +[PIX_FMT_YUVA444P10LE]= { 1, 1 },
  [PIX_FMT_RGB48BE] = { 1, 1 },
  [PIX_FMT_RGB48LE] = { 1, 1 },
  [PIX_FMT_RGB565BE]= { 1, 1 },


Why not add support for yuva{420,422}p10{be,le} also? And while at it,
Why not add yuva{420,422,444}p9{be.le} at the same time?

Ronald
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] avutil: add yuva444p10 pixel format

2012-10-01 Thread Luca Barbato
On 10/01/2012 05:23 PM, Ronald S. Bultje wrote:
 Hi,

 Why not add support for yuva{420,422}p10{be,le} also? And while at it,
 Why not add yuva{420,422,444}p9{be.le} at the same time?

I started with 2 pixel formats I spotted in the question regarding
ffv1.3 that I deemed interesting, nothing prevents to add all of them
beside doublechecking that the alpha codepath actually works.

(I forgot to check about this problem...)

lu

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel