summaryrefslogtreecommitdiff
path: root/libavutil
diff options
context:
space:
mode:
authorManuel Stoeckl <code@mstoeckl.com>2021-09-23 23:22:31 -0400
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-26 16:26:10 +0200
commit0760d9153c39e95e175c434e56916e7d950a4f03 (patch)
tree9b5667d9407b9533f96f0e5483b9b86b4539ad0b /libavutil
parentca594df622abae0c59ef735d63f071db983a35f7 (diff)
lavu/pix_fmt: add pixel format for x2bgr10
The new format (given in big/little endian forms) matches the existing X2RGB10 format, except with B and R channels switched. AV_PIX_FMT_X2BGR10 data often is created by OpenGL programs whose buffers use the GL_RGB10 internal format. Signed-off-by: Manuel Stoeckl <code@mstoeckl.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
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 2346138d04..69cb198646 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -272,6 +272,30 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
},
.flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BE,
},
+ [AV_PIX_FMT_X2BGR10LE] = {
+ .name = "x2bgr10le",
+ .nb_components= 3,
+ .log2_chroma_w= 0,
+ .log2_chroma_h= 0,
+ .comp = {
+ { 0, 4, 0, 0, 10 }, /* R */
+ { 0, 4, 1, 2, 10 }, /* G */
+ { 0, 4, 2, 4, 10 }, /* B */
+ },
+ .flags = AV_PIX_FMT_FLAG_RGB,
+ },
+ [AV_PIX_FMT_X2BGR10BE] = {
+ .name = "x2bgr10be",
+ .nb_components= 3,
+ .log2_chroma_w= 0,
+ .log2_chroma_h= 0,
+ .comp = {
+ { 0, 4, 2, 0, 10 }, /* R */
+ { 0, 4, 1, 2, 10 }, /* G */
+ { 0, 4, 0, 4, 10 }, /* 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 5814f3f3da..53bdecfcb7 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -350,6 +350,8 @@ enum AVPixelFormat {
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_X2BGR10LE, ///< packed BGR 10:10:10, 30bpp, (msb)2X 10B 10G 10R(lsb), little-endian, X=unused/undefined
+ AV_PIX_FMT_X2BGR10BE, ///< packed BGR 10:10:10, 30bpp, (msb)2X 10B 10G 10R(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
};
@@ -440,6 +442,7 @@ enum AVPixelFormat {
#define AV_PIX_FMT_Y210 AV_PIX_FMT_NE(Y210BE, Y210LE)
#define AV_PIX_FMT_X2RGB10 AV_PIX_FMT_NE(X2RGB10BE, X2RGB10LE)
+#define AV_PIX_FMT_X2BGR10 AV_PIX_FMT_NE(X2BGR10BE, X2BGR10LE)
/**
* Chromaticity coordinates of the source primaries.
diff --git a/libavutil/version.h b/libavutil/version.h
index a62f73639b..896e348d80 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -79,7 +79,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 57
-#define LIBAVUTIL_VERSION_MINOR 6
+#define LIBAVUTIL_VERSION_MINOR 7
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \