From 3946e6e690b2fa35b53da8c71c3578d60bb77ecd Mon Sep 17 00:00:00 2001 From: dlin2 Date: Tue, 25 Dec 2018 15:06:55 +0800 Subject: [PATCH] libavutil: add RGBP pixel format Change-Id: I43027a299e3259e2c7dbd9aabbf51de9a6d58195 --- libavutil/hwcontext_vaapi.c | 1 + libavutil/pixdesc.c | 12 ++++++++++++ libavutil/pixfmt.h | 1 + tests/ref/fate/sws-pixdesc-query | 4 ++++ 4 files changed, 18 insertions(+) diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c index 8624369..96111f5 100644 --- a/libavutil/hwcontext_vaapi.c +++ b/libavutil/hwcontext_vaapi.c @@ -119,6 +119,7 @@ static const VAAPIFormatDescriptor vaapi_format_map[] = { MAP(422V, YUV422, YUV440P, 0), MAP(444P, YUV444, YUV444P, 0), MAP(Y800, YUV400, GRAY8, 0), + MAP(RGBP, RGBP, RGBP, 0), #ifdef VA_FOURCC_P010 MAP(P010, YUV420_10BPP, P010, 0), #endif diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index 1c36577..e5cdcdb 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -229,6 +229,18 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { }, .flags = AV_PIX_FMT_FLAG_RGB, }, + [AV_PIX_FMT_RGBP] = { + .name = "rgbp", + .nb_components = 3, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 0, 1, 0, 0, 8, 0, 7, 1 }, /* R */ + { 1, 1, 0, 0, 8, 0, 7, 1 }, /* G */ + { 2, 1, 0, 0, 8, 0, 7, 1 }, /* B */ + }, + .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PLANAR, + }, [AV_PIX_FMT_YUV422P] = { .name = "yuv422p", .nb_components = 3, diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h index 6815f8d..affb5c3 100644 --- a/libavutil/pixfmt.h +++ b/libavutil/pixfmt.h @@ -89,6 +89,7 @@ enum AVPixelFormat { AV_PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 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_NV21, ///< as above, but U and V bytes are swapped + AV_PIX_FMT_RGBP, ///< planar RGB 4:4:4 24bpp, 3 plane for R/G/B components AV_PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB... AV_PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA... AV_PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR... diff --git a/tests/ref/fate/sws-pixdesc-query b/tests/ref/fate/sws-pixdesc-query index 451c7d8..eb6e83a 100644 --- a/tests/ref/fate/sws-pixdesc-query +++ b/tests/ref/fate/sws-pixdesc-query @@ -400,6 +400,7 @@ isRGB: rgb8 rgba64be rgba64le + rgbp Gray: gray @@ -546,6 +547,7 @@ AnyRGB: rgb8 rgba64be rgba64le + rgbp ALPHA: ayuv64be @@ -689,6 +691,7 @@ Planar: p010le p016be p016le + rgbp yuv410p yuv411p yuv420p @@ -829,6 +832,7 @@ PlanarRGB: gbrp9le gbrpf32be gbrpf32le + rgbp usePal: bgr4_byte -- 2.7.4