[FFmpeg-devel] [PATCH 1/2] lavu/pixfmt: add AYUV pixel format
Linjie Fu
linjie.fu at intel.com
Wed Aug 28 09:22:14 EEST 2019
Add support for packed 4:4:4 pixel format AYUV.
It is the format that VAAPI/QSV uses when coping with 4:4:4
surfaces. Alpha channel will be set to default value for HEVC REXT
hw decode.
Signed-off-by: Linjie Fu <linjie.fu at intel.com>
---
libavutil/pixdesc.c | 13 +++++++++++++
libavutil/pixfmt.h | 2 ++
libavutil/tests/pixfmt_best.c | 1 +
libavutil/version.h | 2 +-
4 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index b97b066..d217000 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -205,6 +205,19 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{ 0, 4, 1, 0, 8, 3, 7, 2 }, /* V */
},
},
+ [AV_PIX_FMT_AYUV] = {
+ .name = "ayuv",
+ .nb_components = 4,
+ .log2_chroma_w = 0,
+ .log2_chroma_h = 0,
+ .comp = {
+ { 0, 4, 1, 0, 8, 3, 7, 2 }, /* Y */
+ { 0, 4, 2, 0, 8, 3, 7, 3 }, /* U */
+ { 0, 4, 3, 0, 8, 3, 7, 4 }, /* V */
+ { 0, 4, 0, 0, 8, 3, 7, 1 }, /* A */
+ },
+ .flags = AV_PIX_FMT_FLAG_ALPHA,
+ },
[AV_PIX_FMT_RGB24] = {
.name = "rgb24",
.nb_components = 3,
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index 8b54c94..adbaec8 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -348,6 +348,8 @@ enum AVPixelFormat {
AV_PIX_FMT_NV24, ///< planar YUV 4:4:4, 24bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V)
AV_PIX_FMT_NV42, ///< as above, but U and V bytes are swapped
+ AV_PIX_FMT_AYUV, ///< packed YUV 4:4:4, 32bpp, A Y Cb Cr,
+
AV_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/libavutil/tests/pixfmt_best.c b/libavutil/tests/pixfmt_best.c
index 53f7264..2939e48 100644
--- a/libavutil/tests/pixfmt_best.c
+++ b/libavutil/tests/pixfmt_best.c
@@ -91,6 +91,7 @@ int main(void)
TEST(AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P);
TEST(AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P);
TEST(AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P);
+ TEST(AV_PIX_FMT_AYUV, AV_PIX_FMT_YUV444P);
TEST(AV_PIX_FMT_AYUV64, AV_PIX_FMT_YUV444P16);
TEST(AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB24);
TEST(AV_PIX_FMT_ABGR, AV_PIX_FMT_RGB24);
diff --git a/libavutil/version.h b/libavutil/version.h
index ecc6a7c..658a508 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -79,7 +79,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 56
-#define LIBAVUTIL_VERSION_MINOR 33
+#define LIBAVUTIL_VERSION_MINOR 34
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
--
2.7.4
More information about the ffmpeg-devel
mailing list