aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinjie Fu <linjie.fu@intel.com>2020-01-15 14:58:38 +0800
committerMark Thompson <sw@jkqxz.net>2020-02-24 00:09:51 +0000
commit1c37cad084041c74c6f21505e24670611e6f28a5 (patch)
tree412febe560f3055edeb524e625d40093238e7bb6
parent4627a56d46a07dd2384c92310147cabac98b4539 (diff)
downloadffmpeg-1c37cad084041c74c6f21505e24670611e6f28a5.tar.gz
lavu/pix_fmt: add new pixel format y210
Add some packed 4:2:2 10-bit pixel formats for hardware decode support in VAAPI and QSV. Signed-off-by: Linjie Fu <linjie.fu@intel.com>
-rw-r--r--libavutil/pixdesc.c23
-rw-r--r--libavutil/pixfmt.h5
-rw-r--r--libavutil/version.h2
-rw-r--r--tests/ref/fate/sws-pixdesc-query7
4 files changed, 36 insertions, 1 deletions
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 64178b7d56..9d61c52567 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -205,6 +205,29 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{ 0, 4, 1, 0, 8, 3, 7, 2 }, /* V */
},
},
+ [AV_PIX_FMT_Y210LE] = {
+ .name = "y210le",
+ .nb_components = 3,
+ .log2_chroma_w = 1,
+ .log2_chroma_h = 0,
+ .comp = {
+ { 0, 4, 0, 6, 10, 3, 9, 1 }, /* Y */
+ { 0, 8, 2, 6, 10, 7, 9, 3 }, /* U */
+ { 0, 8, 6, 6, 10, 7, 9, 7 }, /* V */
+ },
+ },
+ [AV_PIX_FMT_Y210BE] = {
+ .name = "y210be",
+ .nb_components = 3,
+ .log2_chroma_w = 1,
+ .log2_chroma_h = 0,
+ .comp = {
+ { 0, 4, 0, 6, 10, 3, 9, 1 }, /* Y */
+ { 0, 8, 2, 6, 10, 7, 9, 3 }, /* U */
+ { 0, 8, 6, 6, 10, 7, 9, 7 }, /* V */
+ },
+ .flags = AV_PIX_FMT_FLAG_BE,
+ },
[AV_PIX_FMT_RGB24] = {
.name = "rgb24",
.nb_components = 3,
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index e1a511758b..1c625cfc8a 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -355,6 +355,9 @@ enum AVPixelFormat {
*/
AV_PIX_FMT_VULKAN,
+ AV_PIX_FMT_Y210BE, ///< packed YUV 4:2:2 like YUYV422, 20bpp, data in the high bits, big-endian
+ AV_PIX_FMT_Y210LE, ///< packed YUV 4:2:2 like YUYV422, 20bpp, data in the high bits, little-endian
+
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
};
@@ -443,6 +446,8 @@ enum AVPixelFormat {
#define AV_PIX_FMT_P010 AV_PIX_FMT_NE(P010BE, P010LE)
#define AV_PIX_FMT_P016 AV_PIX_FMT_NE(P016BE, P016LE)
+#define AV_PIX_FMT_Y210 AV_PIX_FMT_NE(Y210BE, Y210LE)
+
/**
* Chromaticity coordinates of the source primaries.
* These values match the ones defined by ISO/IEC 23001-8_2013 ยง 7.1.
diff --git a/libavutil/version.h b/libavutil/version.h
index 90cc55b9ac..8c4f91bb8f 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -79,7 +79,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 56
-#define LIBAVUTIL_VERSION_MINOR 41
+#define LIBAVUTIL_VERSION_MINOR 42
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
diff --git a/tests/ref/fate/sws-pixdesc-query b/tests/ref/fate/sws-pixdesc-query
index e23492293e..bc9a0d874d 100644
--- a/tests/ref/fate/sws-pixdesc-query
+++ b/tests/ref/fate/sws-pixdesc-query
@@ -59,6 +59,8 @@ isNBPS:
p010le
xyz12be
xyz12le
+ y210be
+ y210le
yuv420p10be
yuv420p10le
yuv420p12be
@@ -140,6 +142,7 @@ isBE:
rgb565be
rgba64be
xyz12be
+ y210be
ya16be
yuv420p10be
yuv420p12be
@@ -188,6 +191,8 @@ isYUV:
uyyvyy411
xyz12be
xyz12le
+ y210be
+ y210le
ya16be
ya16le
ya8
@@ -686,6 +691,8 @@ Packed:
uyyvyy411
xyz12be
xyz12le
+ y210be
+ y210le
ya16be
ya16le
ya8