summaryrefslogtreecommitdiff
path: root/src/libcamera/formats.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-06-27 01:47:28 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-11-19 22:37:12 +0200
commit3b133592de9adc7654fa1dc95f69b5ee2b604a1f (patch)
treea27f13ca95091f037459256ce1f186ead2819201 /src/libcamera/formats.cpp
parent75cfd81d0b1fd8a525adea941f8ae025421c4ab8 (diff)
libcamera: Add support for MediaTek packed Bayer formats
The MediaTek MT8183 camera hardware stores 10- and 12-bit Bayer data in a vendor-specific packed format. Support it in libcamera. The 14-bit version is left out for the time being as its alignment constraints are not clear yet. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/libcamera/formats.cpp')
-rw-r--r--src/libcamera/formats.cpp104
1 files changed, 104 insertions, 0 deletions
diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp
index afcaabc5..472ec142 100644
--- a/src/libcamera/formats.cpp
+++ b/src/libcamera/formats.cpp
@@ -890,6 +890,110 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
.pixelsPerGroup = 25,
.planes = {{ { 32, 1 }, { 0, 0 }, { 0, 0 } }},
} },
+ { formats::SBGGR10_MTK, {
+ .name = "SBGGR10_MTK",
+ .format = formats::SBGGR10_MTK,
+ .v4l2Formats = {
+ .single = V4L2PixelFormat(V4L2_PIX_FMT_MTISP_SBGGR10),
+ .multi = V4L2PixelFormat(),
+ },
+ .bitsPerPixel = 10,
+ .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+ .packed = true,
+ .pixelsPerGroup = 4,
+ .planes = {{ { 5, 1 }, { 0, 0 }, { 0, 0 } }},
+ } },
+ { formats::SGBRG10_MTK, {
+ .name = "SGBRG10_MTK",
+ .format = formats::SGBRG10_MTK,
+ .v4l2Formats = {
+ .single = V4L2PixelFormat(V4L2_PIX_FMT_MTISP_SGBRG10),
+ .multi = V4L2PixelFormat(),
+ },
+ .bitsPerPixel = 10,
+ .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+ .packed = true,
+ .pixelsPerGroup = 4,
+ .planes = {{ { 5, 1 }, { 0, 0 }, { 0, 0 } }},
+ } },
+ { formats::SGRBG10_MTK, {
+ .name = "SGRBG10_MTK",
+ .format = formats::SGRBG10_MTK,
+ .v4l2Formats = {
+ .single = V4L2PixelFormat(V4L2_PIX_FMT_MTISP_SGRBG10),
+ .multi = V4L2PixelFormat(),
+ },
+ .bitsPerPixel = 10,
+ .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+ .packed = true,
+ .pixelsPerGroup = 4,
+ .planes = {{ { 5, 1 }, { 0, 0 }, { 0, 0 } }},
+ } },
+ { formats::SRGGB10_MTK, {
+ .name = "SRGGB10_MTK",
+ .format = formats::SRGGB10_MTK,
+ .v4l2Formats = {
+ .single = V4L2PixelFormat(V4L2_PIX_FMT_MTISP_SRGGB10),
+ .multi = V4L2PixelFormat(),
+ },
+ .bitsPerPixel = 10,
+ .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+ .packed = true,
+ .pixelsPerGroup = 4,
+ .planes = {{ { 5, 1 }, { 0, 0 }, { 0, 0 } }},
+ } },
+ { formats::SBGGR12_MTK, {
+ .name = "SBGGR12_MTK",
+ .format = formats::SBGGR12_MTK,
+ .v4l2Formats = {
+ .single = V4L2PixelFormat(V4L2_PIX_FMT_MTISP_SBGGR12),
+ .multi = V4L2PixelFormat(),
+ },
+ .bitsPerPixel = 12,
+ .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+ .packed = true,
+ .pixelsPerGroup = 2,
+ .planes = {{ { 3, 1 }, { 0, 0 }, { 0, 0 } }},
+ } },
+ { formats::SGBRG12_MTK, {
+ .name = "SGBRG12_MTK",
+ .format = formats::SGBRG12_MTK,
+ .v4l2Formats = {
+ .single = V4L2PixelFormat(V4L2_PIX_FMT_MTISP_SGBRG12),
+ .multi = V4L2PixelFormat(),
+ },
+ .bitsPerPixel = 12,
+ .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+ .packed = true,
+ .pixelsPerGroup = 2,
+ .planes = {{ { 3, 1 }, { 0, 0 }, { 0, 0 } }},
+ } },
+ { formats::SGRBG12_MTK, {
+ .name = "SGRBG12_MTK",
+ .format = formats::SGRBG12_MTK,
+ .v4l2Formats = {
+ .single = V4L2PixelFormat(V4L2_PIX_FMT_MTISP_SGRBG12),
+ .multi = V4L2PixelFormat(),
+ },
+ .bitsPerPixel = 12,
+ .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+ .packed = true,
+ .pixelsPerGroup = 2,
+ .planes = {{ { 3, 1 }, { 0, 0 }, { 0, 0 } }},
+ } },
+ { formats::SRGGB12_MTK, {
+ .name = "SRGGB12_MTK",
+ .format = formats::SRGGB12_MTK,
+ .v4l2Formats = {
+ .single = V4L2PixelFormat(V4L2_PIX_FMT_MTISP_SRGGB12),
+ .multi = V4L2PixelFormat(),
+ },
+ .bitsPerPixel = 12,
+ .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+ .packed = true,
+ .pixelsPerGroup = 2,
+ .planes = {{ { 3, 1 }, { 0, 0 }, { 0, 0 } }},
+ } },
/* Compressed formats. */
{ formats::MJPEG, {