summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-07-24 10:37:42 +0200
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-07-27 17:46:17 +0200
commit3437067e9bd923ee4dce857d83d7bce0f791537d (patch)
tree36e1decdfbb3a39dd51fae470115027f62b9235b
parent90c793c6989fe6913faec920649062ad64b43ff0 (diff)
libcamera: Add support for 16-bit Bayer formats
Add support for 16-bit Bayer formats. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r--src/libcamera/formats.cpp40
-rw-r--r--src/libcamera/formats.yaml9
-rw-r--r--src/libcamera/v4l2_pixelformat.cpp4
3 files changed, 53 insertions, 0 deletions
diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp
index 11774b0c..cd63c15c 100644
--- a/src/libcamera/formats.cpp
+++ b/src/libcamera/formats.cpp
@@ -563,6 +563,46 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
.pixelsPerGroup = 2,
.planes = {{ { 3, 1 }, { 0, 0 }, { 0, 0 } }},
} },
+ { formats::SBGGR16, {
+ .name = "SBGGR16",
+ .format = formats::SBGGR16,
+ .v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_SBGGR16),
+ .bitsPerPixel = 16,
+ .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+ .packed = false,
+ .pixelsPerGroup = 2,
+ .planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }},
+ } },
+ { formats::SGBRG16, {
+ .name = "SGBRG16",
+ .format = formats::SGBRG16,
+ .v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_SGBRG16),
+ .bitsPerPixel = 16,
+ .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+ .packed = false,
+ .pixelsPerGroup = 2,
+ .planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }},
+ } },
+ { formats::SGRBG16, {
+ .name = "SGRBG16",
+ .format = formats::SGRBG16,
+ .v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_SGRBG16),
+ .bitsPerPixel = 16,
+ .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+ .packed = false,
+ .pixelsPerGroup = 2,
+ .planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }},
+ } },
+ { formats::SRGGB16, {
+ .name = "SRGGB16",
+ .format = formats::SRGGB16,
+ .v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_SRGGB16),
+ .bitsPerPixel = 16,
+ .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+ .packed = false,
+ .pixelsPerGroup = 2,
+ .planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }},
+ } },
{ formats::SBGGR10_IPU3, {
.name = "SBGGR10_IPU3",
.format = formats::SBGGR10_IPU3,
diff --git a/src/libcamera/formats.yaml b/src/libcamera/formats.yaml
index 3a69c05f..6a2fb721 100644
--- a/src/libcamera/formats.yaml
+++ b/src/libcamera/formats.yaml
@@ -93,6 +93,15 @@ formats:
- SBGGR12:
fourcc: DRM_FORMAT_SBGGR12
+ - SRGGB16:
+ fourcc: DRM_FORMAT_SRGGB16
+ - SGRBG16:
+ fourcc: DRM_FORMAT_SGRBG16
+ - SGBRG16:
+ fourcc: DRM_FORMAT_SGBRG16
+ - SBGGR16:
+ fourcc: DRM_FORMAT_SBGGR16
+
- SRGGB10_CSI2P:
fourcc: DRM_FORMAT_SRGGB10
mod: MIPI_FORMAT_MOD_CSI2_PACKED
diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp
index c8f69ee9..8391ec48 100644
--- a/src/libcamera/v4l2_pixelformat.cpp
+++ b/src/libcamera/v4l2_pixelformat.cpp
@@ -92,6 +92,10 @@ const std::map<V4L2PixelFormat, PixelFormat> vpf2pf{
{ V4L2PixelFormat(V4L2_PIX_FMT_SGBRG12P), formats::SGBRG12_CSI2P },
{ V4L2PixelFormat(V4L2_PIX_FMT_SGRBG12P), formats::SGRBG12_CSI2P },
{ V4L2PixelFormat(V4L2_PIX_FMT_SRGGB12P), formats::SRGGB12_CSI2P },
+ { V4L2PixelFormat(V4L2_PIX_FMT_SBGGR16), formats::SBGGR16 },
+ { V4L2PixelFormat(V4L2_PIX_FMT_SGBRG16), formats::SGBRG16 },
+ { V4L2PixelFormat(V4L2_PIX_FMT_SGRBG16), formats::SGRBG16 },
+ { V4L2PixelFormat(V4L2_PIX_FMT_SRGGB16), formats::SRGGB16 },
/* Compressed formats. */
{ V4L2PixelFormat(V4L2_PIX_FMT_MJPEG), formats::MJPEG },