summaryrefslogtreecommitdiff
path: root/libavutil
diff options
context:
space:
mode:
authorFei Wang <fei.w.wang@intel.com>2020-04-22 13:23:01 +0800
committerLynne <dev@lynne.ee>2020-06-12 17:56:15 +0100
commitb09fb030c15fea2a1cbddf0074c498a415f3fed2 (patch)
tree7951cc3d914caf552cd5a211619487868c625b17 /libavutil
parent38737b3d4e03e2a089083e38cd1fd6f9b4c3ddfd (diff)
lavu/pix_fmt: add new pixel format x2rgb10
The format is packed RGB with each channel 10 bits available and include 2 bits unused. Signed-off-by: Fei Wang <fei.w.wang@intel.com>
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/pixdesc.c24
-rw-r--r--libavutil/pixfmt.h3
-rw-r--r--libavutil/version.h2
3 files changed, 28 insertions, 1 deletions
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 9d61c52567..8274713226 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -252,6 +252,30 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
},
.flags = AV_PIX_FMT_FLAG_RGB,
},
+ [AV_PIX_FMT_X2RGB10LE] = {
+ .name = "x2rgb10le",
+ .nb_components= 3,
+ .log2_chroma_w= 0,
+ .log2_chroma_h= 0,
+ .comp = {
+ { 0, 4, 2, 4, 10, 3, 9, 2 }, /* R */
+ { 0, 4, 1, 2, 10, 3, 9, 3 }, /* G */
+ { 0, 4, 0, 0, 10, 3, 9, 4 }, /* B */
+ },
+ .flags = AV_PIX_FMT_FLAG_RGB,
+ },
+ [AV_PIX_FMT_X2RGB10BE] = {
+ .name = "x2rgb10be",
+ .nb_components= 3,
+ .log2_chroma_w= 0,
+ .log2_chroma_h= 0,
+ .comp = {
+ { 0, 4, 0, 4, 10, 3, 9, 2 }, /* R */
+ { 0, 4, 1, 2, 10, 3, 9, 3 }, /* G */
+ { 0, 4, 2, 0, 10, 3, 9, 4 }, /* B */
+ },
+ .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BE,
+ },
[AV_PIX_FMT_YUV422P] = {
.name = "yuv422p",
.nb_components = 3,
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index 1c625cfc8a..a46acf3c5e 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -358,6 +358,8 @@ enum AVPixelFormat {
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_X2RGB10LE, ///< packed RGB 10:10:10, 30bpp, (msb)2X 10R 10G 10B(lsb), little-endian, X=unused/undefined
+ AV_PIX_FMT_X2RGB10BE, ///< packed RGB 10:10:10, 30bpp, (msb)2X 10R 10G 10B(lsb), big-endian, X=unused/undefined
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
};
@@ -447,6 +449,7 @@ enum AVPixelFormat {
#define AV_PIX_FMT_P016 AV_PIX_FMT_NE(P016BE, P016LE)
#define AV_PIX_FMT_Y210 AV_PIX_FMT_NE(Y210BE, Y210LE)
+#define AV_PIX_FMT_X2RGB10 AV_PIX_FMT_NE(X2RGB10BE, X2RGB10LE)
/**
* Chromaticity coordinates of the source primaries.
diff --git a/libavutil/version.h b/libavutil/version.h
index 9b6adc2268..3ce9b1831e 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -79,7 +79,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 56
-#define LIBAVUTIL_VERSION_MINOR 54
+#define LIBAVUTIL_VERSION_MINOR 55
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \