{"id":8521,"url":"https://patchwork.libcamera.org/api/patches/8521/?format=json","web_url":"https://patchwork.libcamera.org/patch/8521/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20200630145808.2976956-3-paul.elder@ideasonboard.com>","date":"2020-06-30T14:58:04","name":"[libcamera-devel,v2,2/6] libcamera: formats: Add fields to info ease calculating stride","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"395ca6554925e20275eb7fd9b03b22e8a5fdb0c3","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/?format=json","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"delegate":{"id":17,"url":"https://patchwork.libcamera.org/api/users/17/?format=json","username":"epaul","first_name":"Paul","last_name":"Elder","email":"paul.elder@ideasonboard.com"},"mbox":"https://patchwork.libcamera.org/patch/8521/mbox/","series":[{"id":1064,"url":"https://patchwork.libcamera.org/api/series/1064/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1064","date":"2020-06-30T14:58:02","name":"Move formats from v4l2-compat into libcamera","version":2,"mbox":"https://patchwork.libcamera.org/series/1064/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/8521/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/8521/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 97EA5BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 Jun 2020 14:58:28 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 63C3060C5D;\n\tTue, 30 Jun 2020 16:58:28 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4E215609C5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Jun 2020 16:58:27 +0200 (CEST)","from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id CA84629F;\n\tTue, 30 Jun 2020 16:58:25 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"G4s9cIKB\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1593529107;\n\tbh=EpVFsCs5asu3rKfqYsgmtgQU6x9Dji3d9jsxyxxfkuc=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=G4s9cIKBwv1qL6Ud9NMPvvvBKHK2T7lJxXV64fr8As92g69FEDjAO5f2m4OXkQ/ru\n\tdpK9Xa0rI8g67yu+BNCjfMgc2NjFxkpTqhiktY9HvJvnL3iGAvxWe0qnm5YsQvcRQV\n\typ37JucLbQvZbXMohwU1kFP8NtdLvF/IhOJcp3vs=","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 30 Jun 2020 23:58:04 +0900","Message-Id":"<20200630145808.2976956-3-paul.elder@ideasonboard.com>","X-Mailer":"git-send-email 2.27.0","In-Reply-To":"<20200630145808.2976956-1-paul.elder@ideasonboard.com>","References":"<20200630145808.2976956-1-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v2 2/6] libcamera: formats: Add fields to\n\tinfo ease calculating stride","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Packed formats make it difficult to calculate stride as well as\nframe size with the fields that PixelFormatInfo currently has.\nbitsPerPixel is defined as the average number of bits per pixel, and\nonly counts effective bits, so it is not useful for calculating\nstride and frame size.\n\nTo fix this, we introduce a concept of a \"pixel group\". The size of this\ngroup is defined as the minimum number of pixels (including padding)\nnecessary in a row when the image has only one column of effective\npixels. The pixel group has one more attribute, that is the \"bytes per\ngroup\". This determines how many bytes one pixel group consumes. These\nare the fields pixelsPerGroup and bytesPerGroup that are defined in this\npatch. Defining these two values makes it really simple to calculate\nbytes-per-line, as ceil(width / pixelsPerGroup) * bytesPerGroup, where\nwidth is measured in number of pixels. The ceiling accounts for padding.\n\nFor example, for something simple like BGR888, it is self-explanatory:\nthe pixel group size is 1, and the bytes necessary is 3. For YUYV, the\nCbCr pair is shared between two pixels, so even if you have only one\npixel, you would still need a padded second Y, therefore the pixel\ngroup size is 2, and bytes necessary is 4 (as opposed to 1 and 2). NV12\nseems like it shold be 6 bytes with 4 pixels, since there is\ndownsampling in the Y axis as well, however, the pixel group is only\nin terms of rows, so it is half of that, at 2 pixels and 3 bytes. The\nIPU3 formats are also self-explanatory, coming from a comment in the\ndriver, a pixel group is 50, and it consumes 64 bytes.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n\n---\nChanges in v2:\n- add documentation for bytesPerGroup pixelsPerGroup\n- fix wording in commit message\n  - bytes-per-line -> stride\n  - buffer size -> frame size\n- changed MJPEG todo to allowing pipeline handlers to set parameters of\n  format infos\n---\n include/libcamera/internal/formats.h |   4 +-\n src/libcamera/formats.cpp            | 111 ++++++++++++++++++++++++++-\n 2 files changed, 113 insertions(+), 2 deletions(-)","diff":"diff --git a/include/libcamera/internal/formats.h b/include/libcamera/internal/formats.h\nindex f59ac8f..dc19492 100644\n--- a/include/libcamera/internal/formats.h\n+++ b/include/libcamera/internal/formats.h\n@@ -45,13 +45,15 @@ public:\n \n \tstatic const PixelFormatInfo &info(const PixelFormat &format);\n \n-\t/* \\todo Add support for non-contiguous memory planes */\n \tconst char *name;\n \tPixelFormat format;\n \tV4L2PixelFormat v4l2Format;\n \tunsigned int bitsPerPixel;\n \tenum ColourEncoding colourEncoding;\n \tbool packed;\n+\n+\tunsigned int bytesPerGroup;\n+\tunsigned int pixelsPerGroup;\n };\n \n } /* namespace libcamera */\ndiff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp\nindex d3b722c..8076c39 100644\n--- a/src/libcamera/formats.cpp\n+++ b/src/libcamera/formats.cpp\n@@ -152,6 +152,26 @@ const std::map<unsigned int, std::vector<SizeRange>> &ImageFormats::data() const\n  * bytes. For instance, 12-bit Bayer data with two pixels stored in three bytes\n  * is packed, while the same data stored with 4 bits of padding in two bytes\n  * per pixel is not packed.\n+ *\n+ * \\var PixelFormatInfo::bytesPerGroup\n+ * \\brief The number of bytes that a pixel group consumes\n+ *\n+ * \\sa pixelsPerGroup\n+ *\n+ * \\var PixelFormatInfo::pixelsPerGroup\n+ * \\brief The number of pixels in a pixel group\n+ *\n+ * The minimum number of pixels (including padding) necessary in a row\n+ * when the frame has only one column of effective pixels\n+ *\n+ * A pixel group is defined as the minimum number of pixels (including padding)\n+ * necessary in a row when the image has only one column of effective pixels.\n+ * pixelsPerGroup refers to this value. bytesPerGroup, then, refers to the\n+ * number of bytes that a pixel group consumes. This definition of a pixel\n+ * group allows simple calculation of stride, as\n+ * ceil(width / pixelsPerGroup) * bytesPerGroup. These values are determined\n+ * only in terms of a row, and include bytes that are used in all planes (for\n+ * multiplanar formats).\n  */\n \n /**\n@@ -179,6 +199,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 24,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 3,\n+\t\t.pixelsPerGroup = 1,\n \t} },\n \t{ formats::RGB888, {\n \t\t.name = \"RGB888\",\n@@ -187,6 +209,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 24,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 3,\n+\t\t.pixelsPerGroup = 1,\n \t} },\n \t{ formats::ABGR8888, {\n \t\t.name = \"ABGR8888\",\n@@ -195,6 +219,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 32,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 4,\n+\t\t.pixelsPerGroup = 1,\n \t} },\n \t{ formats::ARGB8888, {\n \t\t.name = \"ARGB8888\",\n@@ -203,6 +229,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 32,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 4,\n+\t\t.pixelsPerGroup = 1,\n \t} },\n \t{ formats::BGRA8888, {\n \t\t.name = \"BGRA8888\",\n@@ -211,6 +239,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 32,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 4,\n+\t\t.pixelsPerGroup = 1,\n \t} },\n \t{ formats::RGBA8888, {\n \t\t.name = \"RGBA8888\",\n@@ -219,6 +249,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 32,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 4,\n+\t\t.pixelsPerGroup = 1,\n \t} },\n \n \t/* YUV packed formats. */\n@@ -229,6 +261,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 16,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 4,\n+\t\t.pixelsPerGroup = 2,\n \t} },\n \t{ formats::YVYU, {\n \t\t.name = \"YVYU\",\n@@ -237,6 +271,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 16,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 4,\n+\t\t.pixelsPerGroup = 2,\n \t} },\n \t{ formats::UYVY, {\n \t\t.name = \"UYVY\",\n@@ -245,6 +281,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 16,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 4,\n+\t\t.pixelsPerGroup = 2,\n \t} },\n \t{ formats::VYUY, {\n \t\t.name = \"VYUY\",\n@@ -253,6 +291,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 16,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 4,\n+\t\t.pixelsPerGroup = 2,\n \t} },\n \n \t/* YUV planar formats. */\n@@ -263,6 +303,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 12,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 3,\n+\t\t.pixelsPerGroup = 2,\n \t} },\n \t{ formats::NV21, {\n \t\t.name = \"NV21\",\n@@ -271,6 +313,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 12,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 3,\n+\t\t.pixelsPerGroup = 2,\n \t} },\n \t{ formats::NV16, {\n \t\t.name = \"NV16\",\n@@ -279,6 +323,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 16,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 4,\n+\t\t.pixelsPerGroup = 2,\n \t} },\n \t{ formats::NV61, {\n \t\t.name = \"NV61\",\n@@ -287,6 +333,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 16,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 4,\n+\t\t.pixelsPerGroup = 2,\n \t} },\n \t{ formats::NV24, {\n \t\t.name = \"NV24\",\n@@ -295,6 +343,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 24,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 3,\n+\t\t.pixelsPerGroup = 1,\n \t} },\n \t{ formats::NV42, {\n \t\t.name = \"NV42\",\n@@ -303,6 +353,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 24,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 3,\n+\t\t.pixelsPerGroup = 1,\n \t} },\n \t{ formats::YUV420, {\n \t\t.name = \"YUV420\",\n@@ -311,6 +363,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 12,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 3,\n+\t\t.pixelsPerGroup = 2,\n \t} },\n \t{ formats::YUV422, {\n \t\t.name = \"YUV422\",\n@@ -319,6 +373,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 16,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 4,\n+\t\t.pixelsPerGroup = 2,\n \t} },\n \n \t/* Greyscale formats. */\n@@ -329,6 +385,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 8,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 1,\n+\t\t.pixelsPerGroup = 1,\n \t} },\n \n \t/* Bayer formats. */\n@@ -339,6 +397,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 8,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 2,\n+\t\t.pixelsPerGroup = 2,\n \t} },\n \t{ formats::SGBRG8, {\n \t\t.name = \"SGBRG8\",\n@@ -347,6 +407,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 8,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 2,\n+\t\t.pixelsPerGroup = 2,\n \t} },\n \t{ formats::SGRBG8, {\n \t\t.name = \"SGRBG8\",\n@@ -355,6 +417,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 8,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 2,\n+\t\t.pixelsPerGroup = 2,\n \t} },\n \t{ formats::SRGGB8, {\n \t\t.name = \"SRGGB8\",\n@@ -363,6 +427,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 8,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 2,\n+\t\t.pixelsPerGroup = 2,\n \t} },\n \t{ formats::SBGGR10, {\n \t\t.name = \"SBGGR10\",\n@@ -371,6 +437,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 10,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 4,\n+\t\t.pixelsPerGroup = 2,\n \t} },\n \t{ formats::SGBRG10, {\n \t\t.name = \"SGBRG10\",\n@@ -379,6 +447,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 10,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 4,\n+\t\t.pixelsPerGroup = 2,\n \t} },\n \t{ formats::SGRBG10, {\n \t\t.name = \"SGRBG10\",\n@@ -387,6 +457,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 10,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 4,\n+\t\t.pixelsPerGroup = 2,\n \t} },\n \t{ formats::SRGGB10, {\n \t\t.name = \"SRGGB10\",\n@@ -395,6 +467,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 10,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 4,\n+\t\t.pixelsPerGroup = 2,\n \t} },\n \t{ formats::SBGGR10_CSI2P, {\n \t\t.name = \"SBGGR10_CSI2P\",\n@@ -403,6 +477,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 10,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = true,\n+\t\t.bytesPerGroup = 5,\n+\t\t.pixelsPerGroup = 4,\n \t} },\n \t{ formats::SGBRG10_CSI2P, {\n \t\t.name = \"SGBRG10_CSI2P\",\n@@ -411,6 +487,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 10,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = true,\n+\t\t.bytesPerGroup = 5,\n+\t\t.pixelsPerGroup = 4,\n \t} },\n \t{ formats::SGRBG10_CSI2P, {\n \t\t.name = \"SGRBG10_CSI2P\",\n@@ -419,6 +497,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 10,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = true,\n+\t\t.bytesPerGroup = 5,\n+\t\t.pixelsPerGroup = 4,\n \t} },\n \t{ formats::SRGGB10_CSI2P, {\n \t\t.name = \"SRGGB10_CSI2P\",\n@@ -427,6 +507,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 10,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = true,\n+\t\t.bytesPerGroup = 5,\n+\t\t.pixelsPerGroup = 4,\n \t} },\n \t{ formats::SBGGR12, {\n \t\t.name = \"SBGGR12\",\n@@ -435,6 +517,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 12,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 4,\n+\t\t.pixelsPerGroup = 2,\n \t} },\n \t{ formats::SGBRG12, {\n \t\t.name = \"SGBRG12\",\n@@ -443,6 +527,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 12,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 4,\n+\t\t.pixelsPerGroup = 2,\n \t} },\n \t{ formats::SGRBG12, {\n \t\t.name = \"SGRBG12\",\n@@ -451,6 +537,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 12,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 4,\n+\t\t.pixelsPerGroup = 2,\n \t} },\n \t{ formats::SRGGB12, {\n \t\t.name = \"SRGGB12\",\n@@ -459,6 +547,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 12,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 4,\n+\t\t.pixelsPerGroup = 2,\n \t} },\n \t{ formats::SBGGR12_CSI2P, {\n \t\t.name = \"SBGGR12_CSI2P\",\n@@ -467,6 +557,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 12,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = true,\n+\t\t.bytesPerGroup = 3,\n+\t\t.pixelsPerGroup = 2,\n \t} },\n \t{ formats::SGBRG12_CSI2P, {\n \t\t.name = \"SGBRG12_CSI2P\",\n@@ -475,6 +567,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 12,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = true,\n+\t\t.bytesPerGroup = 3,\n+\t\t.pixelsPerGroup = 2,\n \t} },\n \t{ formats::SGRBG12_CSI2P, {\n \t\t.name = \"SGRBG12_CSI2P\",\n@@ -483,6 +577,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 12,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = true,\n+\t\t.bytesPerGroup = 3,\n+\t\t.pixelsPerGroup = 2,\n \t} },\n \t{ formats::SRGGB12_CSI2P, {\n \t\t.name = \"SRGGB12_CSI2P\",\n@@ -491,6 +587,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 12,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = true,\n+\t\t.bytesPerGroup = 3,\n+\t\t.pixelsPerGroup = 2,\n \t} },\n \t{ formats::SBGGR10_IPU3, {\n \t\t.name = \"SBGGR10_IPU3\",\n@@ -499,6 +597,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 10,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = true,\n+\t\t.bytesPerGroup = 64,\n+\t\t.pixelsPerGroup = 50,\n \t} },\n \t{ formats::SGBRG10_IPU3, {\n \t\t.name = \"SGBRG10_IPU3\",\n@@ -507,6 +607,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 10,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = true,\n+\t\t.bytesPerGroup = 64,\n+\t\t.pixelsPerGroup = 50,\n \t} },\n \t{ formats::SGRBG10_IPU3, {\n \t\t.name = \"SGRBG10_IPU3\",\n@@ -515,6 +617,8 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 10,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = true,\n+\t\t.bytesPerGroup = 64,\n+\t\t.pixelsPerGroup = 50,\n \t} },\n \t{ formats::SRGGB10_IPU3, {\n \t\t.name = \"SRGGB10_IPU3\",\n@@ -523,16 +627,21 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.bitsPerPixel = 10,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n \t\t.packed = true,\n+\t\t.bytesPerGroup = 64,\n+\t\t.pixelsPerGroup = 50,\n \t} },\n \n \t/* Compressed formats. */\n+\t/* \\todo Allow pipeline handlers to fill in parameters of formats. */\n \t{ formats::MJPEG, {\n \t\t.name = \"MJPEG\",\n \t\t.format = formats::MJPEG,\n \t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_MJPEG),\n-\t\t.bitsPerPixel = 0,\n+\t\t.bitsPerPixel = 16,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n \t\t.packed = false,\n+\t\t.bytesPerGroup = 4,\n+\t\t.pixelsPerGroup = 2,\n \t} },\n };\n \n","prefixes":["libcamera-devel","v2","2/6"]}