Patch Detail
Show a patch.
GET /api/1.1/patches/14086/?format=api
{ "id": 14086, "url": "https://patchwork.libcamera.org/api/1.1/patches/14086/?format=api", "web_url": "https://patchwork.libcamera.org/patch/14086/", "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": "<20211011151154.72856-3-jacopo@jmondi.org>", "date": "2021-10-11T15:11:40", "name": "[libcamera-devel,v3,02/16] libcamera: ipu3: Centralize ImgU sizes definition", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "f9faf32ea1dfcb9e1c2556c4a818e9de8e61f171", "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/14086/mbox/", "series": [ { "id": 2613, "url": "https://patchwork.libcamera.org/api/1.1/series/2613/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2613", "date": "2021-10-11T15:11:38", "name": "IPU3 control info update and HAL frame durations", "version": 3, "mbox": "https://patchwork.libcamera.org/series/2613/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/14086/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/14086/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 292B0C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 11 Oct 2021 15:11:15 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 951D868F57;\n\tMon, 11 Oct 2021 17:11:14 +0200 (CEST)", "from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net\n\t[217.70.183.196])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 295676012B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 11 Oct 2021 17:11:12 +0200 (CEST)", "(Authenticated sender: jacopo@jmondi.org)\n\tby relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 51563E0007;\n\tMon, 11 Oct 2021 15:11:11 +0000 (UTC)" ], "From": "Jacopo Mondi <jacopo@jmondi.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 11 Oct 2021 17:11:40 +0200", "Message-Id": "<20211011151154.72856-3-jacopo@jmondi.org>", "X-Mailer": "git-send-email 2.33.0", "In-Reply-To": "<20211011151154.72856-1-jacopo@jmondi.org>", "References": "<20211011151154.72856-1-jacopo@jmondi.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v3 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>\n---\n src/libcamera/pipeline/ipu3/imgu.cpp | 86 +++++++++++-----------------\n src/libcamera/pipeline/ipu3/imgu.h | 23 ++++++++\n src/libcamera/pipeline/ipu3/ipu3.cpp | 47 +++++++--------\n 3 files changed, 79 insertions(+), 77 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/ipu3/imgu.cpp b/src/libcamera/pipeline/ipu3/imgu.cpp\nindex 3e1ef645ec93..f326886bf3da 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::kAlignHeight);\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::kAlignHeight;\n \t\t}\n \n-\t\tifHeight = utils::alignUp(estIFHeight, IF_ALIGN_H);\n+\t\tifHeight = utils::alignUp(estIFHeight, ImgUDevice::kAlignHeight);\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::kAlignHeight;\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::kAlignHeight);\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::kAlignHeight) &&\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::kAlignHeight;\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::kAlignWidth);\n+\tunsigned int ifHeight = utils::alignUp(in.height, ImgUDevice::kAlignHeight);\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::kAlignHeight;\n \t\t}\n \n-\t\tifWidth -= IF_ALIGN_W;\n+\t\tifWidth -= ImgUDevice::kAlignWidth;\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::kAlignWidth);\n+\tifHeight = utils::alignUp(in.height, ImgUDevice::kAlignHeight);\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::kAlignWidth;\n \t\t}\n \n-\t\tifHeight -= IF_ALIGN_H;\n+\t\tifHeight -= ImgUDevice::kAlignHeight;\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..690a22e67d47 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 kAlignWidth = 2;\n+\tstatic constexpr unsigned int kAlignHeight = 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 5b2ab2ee6825..bb3826eee422 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,9 +281,10 @@ 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 .alignedUpTo(IMGU_OUTPUT_WIDTH_MARGIN,\n-\t\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 .alignedUpTo(ImgUDevice::kOutputMarginWidth,\n+\t\t\t\t\t\t ImgUDevice::kOutputMarginHeight)\n \t\t\t\t .boundedTo(data_->cio2_.sensor()->resolution());\n \tcio2Configuration_ = data_->cio2_.generateConfiguration(rawSize);\n \tif (!cio2Configuration_.pixelFormat.isValid())\n@@ -345,19 +340,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,14 +438,14 @@ 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\tsize.width = utils::alignDown(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\tsize.height = utils::alignDown(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\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@@ -475,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@@ -1003,8 +998,8 @@ int PipelineHandlerIPU3::initControls(IPU3CameraData *data)\n \t/* The strictly smaller size than the sensor resolution, aligned to margins. */\n \tSize minSize = Size(sensor->resolution().width - 1,\n \t\t\t sensor->resolution().height - 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@@ -1012,8 +1007,8 @@ int PipelineHandlerIPU3::initControls(IPU3CameraData *data)\n \t */\n \tminSize = Size(IPU3ViewfinderSize.width + 1,\n \t\t IPU3ViewfinderSize.height + 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", "v3", "02/16" ] }