Patch Detail
Show a patch.
GET /api/1.1/patches/14138/?format=api
{ "id": 14138, "url": "https://patchwork.libcamera.org/api/1.1/patches/14138/?format=api", "web_url": "https://patchwork.libcamera.org/patch/14138/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20211014174208.50509-3-jacopo@jmondi.org>", "date": "2021-10-14T17:41:54", "name": "[libcamera-devel,v4,02/16] libcamera: ipu3: Centralize ImgU sizes definition", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "97eed84265ac958c97d4c95e6de5ea5453675dc7", "submitter": { "id": 3, "url": "https://patchwork.libcamera.org/api/1.1/people/3/?format=api", "name": "Jacopo Mondi", "email": "jacopo@jmondi.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/14138/mbox/", "series": [ { "id": 2628, "url": "https://patchwork.libcamera.org/api/1.1/series/2628/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2628", "date": "2021-10-14T17:41:52", "name": "IPU3 control info update and HAL frame durations", "version": 4, "mbox": "https://patchwork.libcamera.org/series/2628/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/14138/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/14138/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 B4779C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 14 Oct 2021 17:41:27 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B516968F59;\n\tThu, 14 Oct 2021 19:41:26 +0200 (CEST)", "from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net\n\t[217.70.183.199])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DF22E68F4D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 14 Oct 2021 19:41:25 +0200 (CEST)", "(Authenticated sender: jacopo@jmondi.org)\n\tby relay9-d.mail.gandi.net (Postfix) with ESMTPSA id C5AEBFF80B;\n\tThu, 14 Oct 2021 17:41:24 +0000 (UTC)" ], "From": "Jacopo Mondi <jacopo@jmondi.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 14 Oct 2021 19:41:54 +0200", "Message-Id": "<20211014174208.50509-3-jacopo@jmondi.org>", "X-Mailer": "git-send-email 2.33.0", "In-Reply-To": "<20211014174208.50509-1-jacopo@jmondi.org>", "References": "<20211014174208.50509-1-jacopo@jmondi.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v4 02/16] libcamera: ipu3: Centralize ImgU\n\tsizes definition", "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>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "The definition of several constants that describe the ImgU\ncharacteristics are spread between two files: ipu3.cpp and imgu.cpp.\n\nAs the ipu3.cpp uses definitions from the imgu.cpp file, in order to\nremove the usage of magic numbers, it is required to move the\ndefinitions to a common header file where they are accessible to the\nother .cpp modules.\n\nMove all the definitions of the ImgU sizes and alignments to the\nImgUDevice class as static constexpr and update their users accordingly.\n\nCosmetic changes, no functional changes intended.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\nReviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/pipeline/ipu3/imgu.cpp | 86 +++++++++++-----------------\n src/libcamera/pipeline/ipu3/imgu.h | 23 ++++++++\n src/libcamera/pipeline/ipu3/ipu3.cpp | 48 +++++++---------\n 3 files changed, 80 insertions(+), 77 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/ipu3/imgu.cpp b/src/libcamera/pipeline/ipu3/imgu.cpp\nindex 3e1ef645ec93..3ef0ef144301 100644\n--- a/src/libcamera/pipeline/ipu3/imgu.cpp\n+++ b/src/libcamera/pipeline/ipu3/imgu.cpp\n@@ -34,22 +34,6 @@ namespace {\n * at revision: 243d13446e44 (\"Fix some bug for some resolutions\")\n */\n \n-static constexpr unsigned int FILTER_W = 4;\n-static constexpr unsigned int FILTER_H = 4;\n-\n-static constexpr unsigned int IF_ALIGN_W = 2;\n-static constexpr unsigned int IF_ALIGN_H = 4;\n-\n-static constexpr unsigned int BDS_ALIGN_W = 2;\n-static constexpr unsigned int BDS_ALIGN_H = 4;\n-\n-static constexpr unsigned int IF_CROP_MAX_W = 40;\n-static constexpr unsigned int IF_CROP_MAX_H = 540;\n-\n-static constexpr float BDS_SF_MAX = 2.5;\n-static constexpr float BDS_SF_MIN = 1.0;\n-static constexpr float BDS_SF_STEP = 0.03125;\n-\n /* BSD scaling factors: min=1, max=2.5, step=1/32 */\n const std::vector<float> bdsScalingFactors = {\n \t1, 1.03125, 1.0625, 1.09375, 1.125, 1.15625, 1.1875, 1.21875, 1.25,\n@@ -124,8 +108,8 @@ bool isSameRatio(const Size &in, const Size &out)\n void calculateBDSHeight(ImgUDevice::Pipe *pipe, const Size &iif, const Size &gdc,\n \t\t\tunsigned int bdsWidth, float bdsSF)\n {\n-\tunsigned int minIFHeight = iif.height - IF_CROP_MAX_H;\n-\tunsigned int minBDSHeight = gdc.height + FILTER_H * 2;\n+\tunsigned int minIFHeight = iif.height - ImgUDevice::kIFMaxCropHeight;\n+\tunsigned int minBDSHeight = gdc.height + ImgUDevice::kFilterHeight * 2;\n \tunsigned int ifHeight;\n \tfloat bdsHeight;\n \n@@ -135,7 +119,7 @@ void calculateBDSHeight(ImgUDevice::Pipe *pipe, const Size &iif, const Size &gdc\n \t\t\t\t static_cast<float>(gdc.width);\n \t\testIFHeight = std::clamp<float>(estIFHeight, minIFHeight, iif.height);\n \n-\t\tifHeight = utils::alignUp(estIFHeight, IF_ALIGN_H);\n+\t\tifHeight = utils::alignUp(estIFHeight, ImgUDevice::kIFAlignHeight);\n \t\twhile (ifHeight >= minIFHeight && ifHeight <= iif.height &&\n \t\t ifHeight / bdsSF >= minBDSHeight) {\n \n@@ -143,17 +127,17 @@ void calculateBDSHeight(ImgUDevice::Pipe *pipe, const Size &iif, const Size &gdc\n \t\t\tif (std::fmod(height, 1.0) == 0) {\n \t\t\t\tunsigned int bdsIntHeight = static_cast<unsigned int>(height);\n \n-\t\t\t\tif (!(bdsIntHeight % BDS_ALIGN_H)) {\n+\t\t\t\tif (!(bdsIntHeight % ImgUDevice::kBDSAlignHeight)) {\n \t\t\t\t\tfoundIfHeight = ifHeight;\n \t\t\t\t\tbdsHeight = height;\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t}\n \n-\t\t\tifHeight -= IF_ALIGN_H;\n+\t\t\tifHeight -= ImgUDevice::kIFAlignHeight;\n \t\t}\n \n-\t\tifHeight = utils::alignUp(estIFHeight, IF_ALIGN_H);\n+\t\tifHeight = utils::alignUp(estIFHeight, ImgUDevice::kIFAlignHeight);\n \t\twhile (ifHeight >= minIFHeight && ifHeight <= iif.height &&\n \t\t ifHeight / bdsSF >= minBDSHeight) {\n \n@@ -161,14 +145,14 @@ void calculateBDSHeight(ImgUDevice::Pipe *pipe, const Size &iif, const Size &gdc\n \t\t\tif (std::fmod(height, 1.0) == 0) {\n \t\t\t\tunsigned int bdsIntHeight = static_cast<unsigned int>(height);\n \n-\t\t\t\tif (!(bdsIntHeight % BDS_ALIGN_H)) {\n+\t\t\t\tif (!(bdsIntHeight % ImgUDevice::kBDSAlignHeight)) {\n \t\t\t\t\tfoundIfHeight = ifHeight;\n \t\t\t\t\tbdsHeight = height;\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t}\n \n-\t\t\tifHeight += IF_ALIGN_H;\n+\t\t\tifHeight += ImgUDevice::kIFAlignHeight;\n \t\t}\n \n \t\tif (foundIfHeight) {\n@@ -179,32 +163,32 @@ void calculateBDSHeight(ImgUDevice::Pipe *pipe, const Size &iif, const Size &gdc\n \t\t\treturn;\n \t\t}\n \t} else {\n-\t\tifHeight = utils::alignUp(iif.height, IF_ALIGN_H);\n+\t\tifHeight = utils::alignUp(iif.height, ImgUDevice::kIFAlignHeight);\n \t\twhile (ifHeight >= minIFHeight && ifHeight / bdsSF >= minBDSHeight) {\n \n \t\t\tbdsHeight = ifHeight / bdsSF;\n \t\t\tif (std::fmod(ifHeight, 1.0) == 0 && std::fmod(bdsHeight, 1.0) == 0) {\n \t\t\t\tunsigned int bdsIntHeight = static_cast<unsigned int>(bdsHeight);\n \n-\t\t\t\tif (!(ifHeight % IF_ALIGN_H) &&\n-\t\t\t\t !(bdsIntHeight % BDS_ALIGN_H)) {\n+\t\t\t\tif (!(ifHeight % ImgUDevice::kIFAlignHeight) &&\n+\t\t\t\t !(bdsIntHeight % ImgUDevice::kBDSAlignHeight)) {\n \t\t\t\t\tpipeConfigs.push_back({ bdsSF, { iif.width, ifHeight },\n \t\t\t\t\t\t\t\t{ bdsWidth, bdsIntHeight }, gdc });\n \t\t\t\t}\n \t\t\t}\n \n-\t\t\tifHeight -= IF_ALIGN_H;\n+\t\t\tifHeight -= ImgUDevice::kIFAlignHeight;\n \t\t}\n \t}\n }\n \n void calculateBDS(ImgUDevice::Pipe *pipe, const Size &iif, const Size &gdc, float bdsSF)\n {\n-\tunsigned int minBDSWidth = gdc.width + FILTER_W * 2;\n-\tunsigned int minBDSHeight = gdc.height + FILTER_H * 2;\n+\tunsigned int minBDSWidth = gdc.width + ImgUDevice::kFilterWidth * 2;\n+\tunsigned int minBDSHeight = gdc.height + ImgUDevice::kFilterHeight * 2;\n \n \tfloat sf = bdsSF;\n-\twhile (sf <= BDS_SF_MAX && sf >= BDS_SF_MIN) {\n+\twhile (sf <= ImgUDevice::kBDSSfMax && sf >= ImgUDevice::kBDSSfMin) {\n \t\tfloat bdsWidth = static_cast<float>(iif.width) / sf;\n \t\tfloat bdsHeight = static_cast<float>(iif.height) / sf;\n \n@@ -212,16 +196,16 @@ void calculateBDS(ImgUDevice::Pipe *pipe, const Size &iif, const Size &gdc, floa\n \t\t std::fmod(bdsHeight, 1.0) == 0) {\n \t\t\tunsigned int bdsIntWidth = static_cast<unsigned int>(bdsWidth);\n \t\t\tunsigned int bdsIntHeight = static_cast<unsigned int>(bdsHeight);\n-\t\t\tif (!(bdsIntWidth % BDS_ALIGN_W) && bdsWidth >= minBDSWidth &&\n-\t\t\t !(bdsIntHeight % BDS_ALIGN_H) && bdsHeight >= minBDSHeight)\n+\t\t\tif (!(bdsIntWidth % ImgUDevice::kBDSAlignWidth) && bdsWidth >= minBDSWidth &&\n+\t\t\t !(bdsIntHeight % ImgUDevice::kBDSAlignHeight) && bdsHeight >= minBDSHeight)\n \t\t\t\tcalculateBDSHeight(pipe, iif, gdc, bdsIntWidth, sf);\n \t\t}\n \n-\t\tsf += BDS_SF_STEP;\n+\t\tsf += ImgUDevice::kBDSSfStep;\n \t}\n \n \tsf = bdsSF;\n-\twhile (sf <= BDS_SF_MAX && sf >= BDS_SF_MIN) {\n+\twhile (sf <= ImgUDevice::kBDSSfMax && sf >= ImgUDevice::kBDSSfMin) {\n \t\tfloat bdsWidth = static_cast<float>(iif.width) / sf;\n \t\tfloat bdsHeight = static_cast<float>(iif.height) / sf;\n \n@@ -229,12 +213,12 @@ void calculateBDS(ImgUDevice::Pipe *pipe, const Size &iif, const Size &gdc, floa\n \t\t std::fmod(bdsHeight, 1.0) == 0) {\n \t\t\tunsigned int bdsIntWidth = static_cast<unsigned int>(bdsWidth);\n \t\t\tunsigned int bdsIntHeight = static_cast<unsigned int>(bdsHeight);\n-\t\t\tif (!(bdsIntWidth % BDS_ALIGN_W) && bdsWidth >= minBDSWidth &&\n-\t\t\t !(bdsIntHeight % BDS_ALIGN_H) && bdsHeight >= minBDSHeight)\n+\t\t\tif (!(bdsIntWidth % ImgUDevice::kBDSAlignWidth) && bdsWidth >= minBDSWidth &&\n+\t\t\t !(bdsIntHeight % ImgUDevice::kBDSAlignHeight) && bdsHeight >= minBDSHeight)\n \t\t\t\tcalculateBDSHeight(pipe, iif, gdc, bdsIntWidth, sf);\n \t\t}\n \n-\t\tsf -= BDS_SF_STEP;\n+\t\tsf -= ImgUDevice::kBDSSfStep;\n \t}\n }\n \n@@ -412,7 +396,7 @@ ImgUDevice::PipeConfig ImgUDevice::calculatePipeConfig(Pipe *pipe)\n \t * \\todo Filter out all resolutions < IF_CROP_MAX.\n \t * See https://bugs.libcamera.org/show_bug.cgi?id=32\n \t */\n-\tif (in.width < IF_CROP_MAX_W || in.height < IF_CROP_MAX_H) {\n+\tif (in.width < ImgUDevice::kIFMaxCropWidth || in.height < ImgUDevice::kIFMaxCropHeight) {\n \t\tLOG(IPU3, Error) << \"Input resolution \" << in.toString()\n \t\t\t\t << \" not supported\";\n \t\treturn {};\n@@ -424,25 +408,25 @@ ImgUDevice::PipeConfig ImgUDevice::calculatePipeConfig(Pipe *pipe)\n \tfloat sf = findScaleFactor(bdsSF, bdsScalingFactors, true);\n \n \t/* Populate the configurations vector by scaling width and height. */\n-\tunsigned int ifWidth = utils::alignUp(in.width, IF_ALIGN_W);\n-\tunsigned int ifHeight = utils::alignUp(in.height, IF_ALIGN_H);\n-\tunsigned int minIfWidth = in.width - IF_CROP_MAX_W;\n-\tunsigned int minIfHeight = in.height - IF_CROP_MAX_H;\n+\tunsigned int ifWidth = utils::alignUp(in.width, ImgUDevice::kIFAlignWidth);\n+\tunsigned int ifHeight = utils::alignUp(in.height, ImgUDevice::kIFAlignHeight);\n+\tunsigned int minIfWidth = in.width - ImgUDevice::kIFMaxCropWidth;\n+\tunsigned int minIfHeight = in.height - ImgUDevice::kIFMaxCropHeight;\n \twhile (ifWidth >= minIfWidth) {\n \t\twhile (ifHeight >= minIfHeight) {\n \t\t\tSize iif{ ifWidth, ifHeight };\n \t\t\tcalculateBDS(pipe, iif, gdc, sf);\n-\t\t\tifHeight -= IF_ALIGN_H;\n+\t\t\tifHeight -= ImgUDevice::kIFAlignHeight;\n \t\t}\n \n-\t\tifWidth -= IF_ALIGN_W;\n+\t\tifWidth -= ImgUDevice::kIFAlignWidth;\n \t}\n \n \t/* Repeat search by scaling width first. */\n-\tifWidth = utils::alignUp(in.width, IF_ALIGN_W);\n-\tifHeight = utils::alignUp(in.height, IF_ALIGN_H);\n-\tminIfWidth = in.width - IF_CROP_MAX_W;\n-\tminIfHeight = in.height - IF_CROP_MAX_H;\n+\tifWidth = utils::alignUp(in.width, ImgUDevice::kIFAlignWidth);\n+\tifHeight = utils::alignUp(in.height, ImgUDevice::kIFAlignHeight);\n+\tminIfWidth = in.width - ImgUDevice::kIFMaxCropWidth;\n+\tminIfHeight = in.height - ImgUDevice::kIFMaxCropHeight;\n \twhile (ifHeight >= minIfHeight) {\n \t\t/*\n \t\t * \\todo This procedure is probably broken:\n@@ -451,10 +435,10 @@ ImgUDevice::PipeConfig ImgUDevice::calculatePipeConfig(Pipe *pipe)\n \t\twhile (ifWidth >= minIfWidth) {\n \t\t\tSize iif{ ifWidth, ifHeight };\n \t\t\tcalculateBDS(pipe, iif, gdc, sf);\n-\t\t\tifWidth -= IF_ALIGN_W;\n+\t\t\tifWidth -= ImgUDevice::kIFAlignWidth;\n \t\t}\n \n-\t\tifHeight -= IF_ALIGN_H;\n+\t\tifHeight -= ImgUDevice::kIFAlignHeight;\n \t}\n \n \tif (pipeConfigs.size() == 0) {\ndiff --git a/src/libcamera/pipeline/ipu3/imgu.h b/src/libcamera/pipeline/ipu3/imgu.h\nindex 9d4915116087..2b28d912676a 100644\n--- a/src/libcamera/pipeline/ipu3/imgu.h\n+++ b/src/libcamera/pipeline/ipu3/imgu.h\n@@ -23,6 +23,29 @@ struct StreamConfiguration;\n class ImgUDevice\n {\n public:\n+\tstatic constexpr unsigned int kFilterWidth = 4;\n+\tstatic constexpr unsigned int kFilterHeight = 4;\n+\n+\tstatic constexpr unsigned int kIFAlignWidth = 2;\n+\tstatic constexpr unsigned int kIFAlignHeight = 4;\n+\n+\tstatic constexpr unsigned int kIFMaxCropWidth = 40;\n+\tstatic constexpr unsigned int kIFMaxCropHeight = 540;\n+\n+\tstatic constexpr unsigned int kBDSAlignWidth = 2;\n+\tstatic constexpr unsigned int kBDSAlignHeight = 4;\n+\n+\tstatic constexpr float kBDSSfMax = 2.5;\n+\tstatic constexpr float kBDSSfMin = 1.0;\n+\tstatic constexpr float kBDSSfStep = 0.03125;\n+\n+\tstatic constexpr Size kOutputMinSize = { 2, 2 };\n+\tstatic constexpr Size kOutputMaxSize = { 4480, 34004 };\n+\tstatic constexpr unsigned int kOutputAlignWidth = 64;\n+\tstatic constexpr unsigned int kOutputAlignHeight = 4;\n+\tstatic constexpr unsigned int kOutputMarginWidth = 64;\n+\tstatic constexpr unsigned int kOutputMarginHeight = 32;\n+\n \tstruct PipeConfig {\n \t\tfloat bds_sf;\n \t\tSize iif;\ndiff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 8aab5041b3ea..76fe9edb7dbc 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -41,12 +41,6 @@ LOG_DEFINE_CATEGORY(IPU3)\n \n static constexpr unsigned int IPU3_BUFFER_COUNT = 4;\n static constexpr unsigned int IPU3_MAX_STREAMS = 3;\n-static const Size IMGU_OUTPUT_MIN_SIZE = { 2, 2 };\n-static const Size IMGU_OUTPUT_MAX_SIZE = { 4480, 34004 };\n-static constexpr unsigned int IMGU_OUTPUT_WIDTH_ALIGN = 64;\n-static constexpr unsigned int IMGU_OUTPUT_HEIGHT_ALIGN = 4;\n-static constexpr unsigned int IMGU_OUTPUT_WIDTH_MARGIN = 64;\n-static constexpr unsigned int IMGU_OUTPUT_HEIGHT_MARGIN = 32;\n static constexpr Size IPU3ViewfinderSize(1280, 720);\n \n static const ControlInfoMap::Map IPU3Controls = {\n@@ -287,10 +281,12 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()\n \t * https://bugs.libcamera.org/show_bug.cgi?id=32\n \t */\n \tif (rawSize.isNull())\n-\t\trawSize = maxYuvSize.expandedTo({40, 540})\n-\t\t\t\t .grownBy({ IMGU_OUTPUT_WIDTH_MARGIN,\n-\t\t\t\t\t IMGU_OUTPUT_HEIGHT_MARGIN })\n+\t\trawSize = maxYuvSize.expandedTo({ ImgUDevice::kIFMaxCropWidth,\n+\t\t\t\t\t\t ImgUDevice::kIFMaxCropHeight })\n+\t\t\t\t .grownBy({ ImgUDevice::kOutputMarginWidth,\n+\t\t\t\t\t ImgUDevice::kOutputMarginHeight })\n \t\t\t\t .boundedTo(data_->cio2_.sensor()->resolution());\n+\n \tcio2Configuration_ = data_->cio2_.generateConfiguration(rawSize);\n \tif (!cio2Configuration_.pixelFormat.isValid())\n \t\treturn Invalid;\n@@ -345,19 +341,19 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()\n \t\t\t */\n \t\t\tunsigned int limit;\n \t\t\tlimit = utils::alignDown(cio2Configuration_.size.width - 1,\n-\t\t\t\t\t\t IMGU_OUTPUT_WIDTH_MARGIN);\n+\t\t\t\t\t\t ImgUDevice::kOutputMarginWidth);\n \t\t\tcfg->size.width = std::clamp(cfg->size.width,\n-\t\t\t\t\t\t IMGU_OUTPUT_MIN_SIZE.width,\n+\t\t\t\t\t\t ImgUDevice::kOutputMinSize.width,\n \t\t\t\t\t\t limit);\n \n \t\t\tlimit = utils::alignDown(cio2Configuration_.size.height - 1,\n-\t\t\t\t\t\t IMGU_OUTPUT_HEIGHT_MARGIN);\n+\t\t\t\t\t\t ImgUDevice::kOutputMarginHeight);\n \t\t\tcfg->size.height = std::clamp(cfg->size.height,\n-\t\t\t\t\t\t IMGU_OUTPUT_MIN_SIZE.height,\n+\t\t\t\t\t\t ImgUDevice::kOutputMinSize.height,\n \t\t\t\t\t\t limit);\n \n-\t\t\tcfg->size.alignDownTo(IMGU_OUTPUT_WIDTH_ALIGN,\n-\t\t\t\t\t IMGU_OUTPUT_HEIGHT_ALIGN);\n+\t\t\tcfg->size.alignDownTo(ImgUDevice::kOutputAlignWidth,\n+\t\t\t\t\t ImgUDevice::kOutputAlignHeight);\n \n \t\t\tcfg->pixelFormat = formats::NV12;\n \t\t\tcfg->bufferCount = IPU3_BUFFER_COUNT;\n@@ -443,13 +439,13 @@ CameraConfiguration *PipelineHandlerIPU3::generateConfiguration(Camera *camera,\n \t\t\t * \\todo Clarify the alignment constraints as explained\n \t\t\t * in validate()\n \t\t\t */\n-\t\t\tsize = sensorResolution.boundedTo(IMGU_OUTPUT_MAX_SIZE)\n+\t\t\tsize = sensorResolution.boundedTo(ImgUDevice::kOutputMaxSize)\n \t\t\t\t.shrunkBy({ 1, 1 })\n-\t\t\t\t.alignedDownTo(IMGU_OUTPUT_WIDTH_MARGIN,\n-\t\t\t\t\t IMGU_OUTPUT_HEIGHT_MARGIN);\n+\t\t\t\t.alignedDownTo(ImgUDevice::kOutputMarginWidth,\n+\t\t\t\t\t ImgUDevice::kOutputMarginHeight);\n \t\t\tpixelFormat = formats::NV12;\n \t\t\tbufferCount = IPU3_BUFFER_COUNT;\n-\t\t\tstreamFormats[pixelFormat] = { { IMGU_OUTPUT_MIN_SIZE, size } };\n+\t\t\tstreamFormats[pixelFormat] = { { ImgUDevice::kOutputMinSize, size } };\n \n \t\t\tbreak;\n \n@@ -474,11 +470,11 @@ CameraConfiguration *PipelineHandlerIPU3::generateConfiguration(Camera *camera,\n \t\t\t * to the ImgU output constraints.\n \t\t\t */\n \t\t\tsize = sensorResolution.boundedTo(IPU3ViewfinderSize)\n-\t\t\t\t\t .alignedDownTo(IMGU_OUTPUT_WIDTH_ALIGN,\n-\t\t\t\t\t\t\t IMGU_OUTPUT_HEIGHT_ALIGN);\n+\t\t\t\t\t .alignedDownTo(ImgUDevice::kOutputAlignWidth,\n+\t\t\t\t\t\t\t ImgUDevice::kOutputAlignHeight);\n \t\t\tpixelFormat = formats::NV12;\n \t\t\tbufferCount = IPU3_BUFFER_COUNT;\n-\t\t\tstreamFormats[pixelFormat] = { { IMGU_OUTPUT_MIN_SIZE, size } };\n+\t\t\tstreamFormats[pixelFormat] = { { ImgUDevice::kOutputMinSize, size } };\n \n \t\t\tbreak;\n \t\t}\n@@ -1001,16 +997,16 @@ int PipelineHandlerIPU3::initControls(IPU3CameraData *data)\n \n \t/* The strictly smaller size than the sensor resolution, aligned to margins. */\n \tSize minSize = sensor->resolution().shrunkBy({ 1, 1 })\n-\t\t .alignedDownTo(IMGU_OUTPUT_WIDTH_MARGIN,\n-\t\t\t\t IMGU_OUTPUT_HEIGHT_MARGIN);\n+\t\t .alignedDownTo(ImgUDevice::kOutputMarginWidth,\n+\t\t\t\t ImgUDevice::kOutputMarginHeight);\n \n \t/*\n \t * Either the smallest margin-aligned size larger than the viewfinder\n \t * size or the adjusted sensor resolution.\n \t */\n \tminSize = IPU3ViewfinderSize.grownBy({ 1, 1 })\n-\t\t .alignedUpTo(IMGU_OUTPUT_WIDTH_MARGIN,\n-\t\t\t IMGU_OUTPUT_HEIGHT_MARGIN)\n+\t\t .alignedUpTo(ImgUDevice::kOutputMarginWidth,\n+\t\t\t ImgUDevice::kOutputMarginHeight)\n \t\t .boundedTo(minSize);\n \n \t/*\n", "prefixes": [ "libcamera-devel", "v4", "02/16" ] }