Show a patch.

GET /api/1.1/patches/9697/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 9697,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/9697/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/9697/",
    "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": "<20200922095018.68434-5-naush@raspberrypi.com>",
    "date": "2020-09-22T09:50:18",
    "name": "[libcamera-devel,4/4] ipa: raspberrypi: Tidy up variable names to be consistent",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "a82892ad7d2575ad21b9ea0282d528a094c0d71a",
    "submitter": {
        "id": 34,
        "url": "https://patchwork.libcamera.org/api/1.1/people/34/?format=api",
        "name": "Naushir Patuck",
        "email": "naush@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/9697/mbox/",
    "series": [
        {
            "id": 1307,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1307/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1307",
            "date": "2020-09-22T09:50:14",
            "name": "Code tidy-ups",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1307/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/9697/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/9697/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 81EF3C3B5B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 22 Sep 2020 09:50:38 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3CC6062FD2;\n\tTue, 22 Sep 2020 11:50:38 +0200 (CEST)",
            "from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com\n\t[IPv6:2a00:1450:4864:20::42a])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3089262FAD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 22 Sep 2020 11:50:35 +0200 (CEST)",
            "by mail-wr1-x42a.google.com with SMTP id c18so16322928wrm.9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 22 Sep 2020 02:50:35 -0700 (PDT)",
            "from naushir-VirtualBox.pitowers.org\n\t([2a00:1098:3142:14:a00:27ff:fe4d:f6a2])\n\tby smtp.gmail.com with ESMTPSA id\n\th204sm3776187wmf.35.2020.09.22.02.50.33\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 22 Sep 2020 02:50:33 -0700 (PDT)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"n75ciYk2\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=2kvmZTp1lcP7EVgB+p8ftux8nQarryqK5aJ+Qp0MEN0=;\n\tb=n75ciYk2wljI78QOVZaHBiLpzJy/JBtcmUv/SOSl0tx7ipn7g3NAetkNP2W6H2nnmL\n\t0kNDg4Zq5ukn40e4pYpLMwCcD/IdwN1COFotMH61SnWZzYVDhWJV0A9n7priRTIItGub\n\tJ5AMAUd1eQmtx9TUvdjl2FtUo9U+EB8STcX+5M2gL3o72JcH82Zg4FuYGAJQ0ZhpZx3d\n\txoAoeP2G+ZeQBtUTDOp+Dz3E49DISfVoyJLhwnWLwp/1zVyEbQNVHvs3IpKSeSvYwzcP\n\tDj7xVNET08KY/wxjye+T1OdxFNY0Hgi2aQq5IiEOE0p3hs5r3unb7xrFcTptSNa3UbDs\n\tXMzg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=2kvmZTp1lcP7EVgB+p8ftux8nQarryqK5aJ+Qp0MEN0=;\n\tb=lve8QgvIQeMC676WIodfbJODAzSGnT//Gzeyd19HCWz7rDxpE6H4WzabScYJ75/uof\n\tgUljR7kH/evEF9NeB9lE/jRCTXf3F7AMnsPH5UfqfHHwK9xN9cB1YZFQFanf3HaaWwlN\n\t2X0/0BxwZzWViSG0RPjgs0CfZUiftf7TxZeSf6TRq4zqjSuUExO/mTs8drvkmP6BAdOC\n\tjHQdLslWML8rVrqM2G8XVpq24OClWuqI9NRmShFBXVsLH5844JKExkji5VjOaABX1xYf\n\tCggnFBpqxfbdmdI/JHz6K9EUy/0TDg+bS6S0q/7TmypAoSumIG/YYnO7tO1Q/L11snNE\n\tOHOA==",
        "X-Gm-Message-State": "AOAM5308fveO8ojjjhuIvsFOg4ELFVivxeP31OpB+DewcLEgaaPUVl38\n\tB+47sn8DUna7aprtiQVGyAQtt9nELTGUeQ==",
        "X-Google-Smtp-Source": "ABdhPJzkW8ue7pCGHpAtiTA0fwi3p0t5rruFJnTUKS7sLZWkhpTakcY9m4ge76S51y5xL57m+gs44A==",
        "X-Received": "by 2002:a5d:5602:: with SMTP id l2mr4646289wrv.410.1600768234317;\n\tTue, 22 Sep 2020 02:50:34 -0700 (PDT)",
        "From": "Naushir Patuck <naush@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue, 22 Sep 2020 10:50:18 +0100",
        "Message-Id": "<20200922095018.68434-5-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20200922095018.68434-1-naush@raspberrypi.com>",
        "References": "<20200922095018.68434-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH 4/4] ipa: raspberrypi: Tidy up variable\n\tnames to be consistent",
        "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": "Change variable names to camel case to be consistent with the rest of\nthe source files. Remove #define consts and replace with constexpr.\n\nThere are no functional changes in this commit.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n include/libcamera/ipa/raspberrypi.h           |   2 +-\n src/ipa/raspberrypi/raspberrypi.cpp           | 178 +++++++++---------\n .../pipeline/raspberrypi/raspberrypi.cpp      |   2 +-\n 3 files changed, 91 insertions(+), 91 deletions(-)",
    "diff": "diff --git a/include/libcamera/ipa/raspberrypi.h b/include/libcamera/ipa/raspberrypi.h\nindex c9d4aa81..b3041591 100644\n--- a/include/libcamera/ipa/raspberrypi.h\n+++ b/include/libcamera/ipa/raspberrypi.h\n@@ -41,7 +41,7 @@ enum BufferMask {\n };\n \n /* Size of the LS grid allocation. */\n-#define MAX_LS_GRID_SIZE (32 << 10)\n+static constexpr unsigned int MaxLsGridSize = 32 << 10;\n \n /* List of controls handled by the Raspberry Pi IPA */\n static const ControlInfoMap Controls = {\ndiff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex 0c0dc743..c240eae8 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -55,8 +55,8 @@\n namespace libcamera {\n \n /* Configure the sensor with these values initially. */\n-#define DEFAULT_ANALOGUE_GAIN 1.0\n-#define DEFAULT_EXPOSURE_TIME 20000\n+constexpr unsigned int DefaultAnalogueGain = 1.0;\n+constexpr unsigned int DefaultExposureTime = 20000;\n \n LOG_DEFINE_CATEGORY(IPARPI)\n \n@@ -65,7 +65,7 @@ class IPARPi : public IPAInterface\n public:\n \tIPARPi()\n \t\t: lastMode_({}), controller_(), controllerInit_(false),\n-\t\t  frame_count_(0), check_count_(0), mistrust_count_(0),\n+\t\t  frameCount_(0), checkCount_(0), mistrustCount_(0),\n \t\t  lsTable_(nullptr)\n \t{\n \t}\n@@ -73,7 +73,7 @@ public:\n \t~IPARPi()\n \t{\n \t\tif (lsTable_)\n-\t\t\tmunmap(lsTable_, MAX_LS_GRID_SIZE);\n+\t\t\tmunmap(lsTable_, RPi::MaxLsGridSize);\n \t}\n \n \tint init(const IPASettings &settings) override;\n@@ -108,13 +108,13 @@ private:\n \tvoid applySharpen(const struct SharpenStatus *sharpenStatus, ControlList &ctrls);\n \tvoid applyDPC(const struct DpcStatus *dpcStatus, ControlList &ctrls);\n \tvoid applyLS(const struct AlscStatus *lsStatus, ControlList &ctrls);\n-\tvoid resampleTable(uint16_t dest[], double const src[12][16], int dest_w, int dest_h);\n+\tvoid resampleTable(uint16_t dest[], double const src[12][16], int destW, int destH);\n \n \tstd::map<unsigned int, FrameBuffer> buffers_;\n \tstd::map<unsigned int, void *> buffersMemory_;\n \n-\tControlInfoMap unicam_ctrls_;\n-\tControlInfoMap isp_ctrls_;\n+\tControlInfoMap unicamCtrls_;\n+\tControlInfoMap ispCtrls_;\n \tControlList libcameraMetadata_;\n \n \t/* IPA configuration. */\n@@ -134,11 +134,11 @@ private:\n \t * We count frames to decide if the frame must be hidden (e.g. from\n \t * display) or mistrusted (i.e. not given to the control algos).\n \t */\n-\tuint64_t frame_count_;\n+\tuint64_t frameCount_;\n \t/* For checking the sequencing of Prepare/Process calls. */\n-\tuint64_t check_count_;\n+\tuint64_t checkCount_;\n \t/* How many frames we should avoid running control algos on. */\n-\tunsigned int mistrust_count_;\n+\tunsigned int mistrustCount_;\n \t/* LS table allocation passed in from the pipeline handler. */\n \tFileDescriptor lsTableHandle_;\n \tvoid *lsTable_;\n@@ -199,8 +199,8 @@ void IPARPi::configure(const CameraSensorInfo &sensorInfo,\n \n \tresult->operation = 0;\n \n-\tunicam_ctrls_ = entityControls.at(0);\n-\tisp_ctrls_ = entityControls.at(1);\n+\tunicamCtrls_ = entityControls.at(0);\n+\tispCtrls_ = entityControls.at(1);\n \t/* Setup a metadata ControlList to output metadata. */\n \tlibcameraMetadata_ = ControlList(controls::controls);\n \n@@ -238,18 +238,18 @@ void IPARPi::configure(const CameraSensorInfo &sensorInfo,\n \t *\"mistrusted\", which depends on whether this is a startup from cold,\n \t * or merely a mode switch in a running system.\n \t */\n-\tframe_count_ = 0;\n-\tcheck_count_ = 0;\n-\tunsigned int drop_frame = 0;\n+\tframeCount_ = 0;\n+\tcheckCount_ = 0;\n+\tunsigned int dropFrame = 0;\n \tif (controllerInit_) {\n-\t\tdrop_frame = helper_->HideFramesModeSwitch();\n-\t\tmistrust_count_ = helper_->MistrustFramesModeSwitch();\n+\t\tdropFrame = helper_->HideFramesModeSwitch();\n+\t\tmistrustCount_ = helper_->MistrustFramesModeSwitch();\n \t} else {\n-\t\tdrop_frame = helper_->HideFramesStartup();\n-\t\tmistrust_count_ = helper_->MistrustFramesStartup();\n+\t\tdropFrame = helper_->HideFramesStartup();\n+\t\tmistrustCount_ = helper_->MistrustFramesStartup();\n \t}\n \n-\tresult->data.push_back(drop_frame);\n+\tresult->data.push_back(dropFrame);\n \tresult->operation |= RPi::IPA_CONFIG_DROP_FRAMES;\n \n \tstruct AgcStatus agcStatus;\n@@ -264,8 +264,8 @@ void IPARPi::configure(const CameraSensorInfo &sensorInfo,\n \t\tcontrollerInit_ = true;\n \n \t\t/* Supply initial values for gain and exposure. */\n-\t\tagcStatus.shutter_time = DEFAULT_EXPOSURE_TIME;\n-\t\tagcStatus.analogue_gain = DEFAULT_ANALOGUE_GAIN;\n+\t\tagcStatus.shutter_time = DefaultExposureTime;\n+\t\tagcStatus.analogue_gain = DefaultAnalogueGain;\n \t}\n \n \tRPiController::Metadata metadata;\n@@ -274,7 +274,7 @@ void IPARPi::configure(const CameraSensorInfo &sensorInfo,\n \t/* SwitchMode may supply updated exposure/gain values to use. */\n \tmetadata.Get(\"agc.status\", agcStatus);\n \tif (agcStatus.shutter_time != 0.0 && agcStatus.analogue_gain != 0.0) {\n-\t\tControlList ctrls(unicam_ctrls_);\n+\t\tControlList ctrls(unicamCtrls_);\n \t\tapplyAGC(&agcStatus, ctrls);\n \t\tresult->controls.push_back(ctrls);\n \n@@ -287,14 +287,14 @@ void IPARPi::configure(const CameraSensorInfo &sensorInfo,\n \tif (ipaConfig.operation & RPi::IPA_CONFIG_LS_TABLE) {\n \t\t/* Remove any previous table, if there was one. */\n \t\tif (lsTable_) {\n-\t\t\tmunmap(lsTable_, MAX_LS_GRID_SIZE);\n+\t\t\tmunmap(lsTable_, RPi::MaxLsGridSize);\n \t\t\tlsTable_ = nullptr;\n \t\t}\n \n \t\t/* Map the LS table buffer into user space. */\n \t\tlsTableHandle_ = FileDescriptor(ipaConfig.data[0]);\n \t\tif (lsTableHandle_.isValid()) {\n-\t\t\tlsTable_ = mmap(nullptr, MAX_LS_GRID_SIZE, PROT_READ | PROT_WRITE,\n+\t\t\tlsTable_ = mmap(nullptr, RPi::MaxLsGridSize, PROT_READ | PROT_WRITE,\n \t\t\t\t\tMAP_SHARED, lsTableHandle_.fd(), 0);\n \n \t\t\tif (lsTable_ == MAP_FAILED) {\n@@ -343,9 +343,9 @@ void IPARPi::processEvent(const IPAOperationData &event)\n \tcase RPi::IPA_EVENT_SIGNAL_STAT_READY: {\n \t\tunsigned int bufferId = event.data[0];\n \n-\t\tif (++check_count_ != frame_count_) /* assert here? */\n+\t\tif (++checkCount_ != frameCount_) /* assert here? */\n \t\t\tLOG(IPARPI, Error) << \"WARNING: Prepare/Process mismatch!!!\";\n-\t\tif (frame_count_ > mistrust_count_)\n+\t\tif (frameCount_ > mistrustCount_)\n \t\t\tprocessStats(bufferId);\n \n \t\treportMetadata();\n@@ -368,7 +368,7 @@ void IPARPi::processEvent(const IPAOperationData &event)\n \t\t * they are \"unreliable\".\n \t\t */\n \t\tprepareISP(embeddedbufferId);\n-\t\tframe_count_++;\n+\t\tframeCount_++;\n \n \t\t/* Ready to push the input buffer into the ISP. */\n \t\tIPAOperationData op;\n@@ -713,7 +713,7 @@ void IPARPi::prepareISP(unsigned int bufferId)\n \treturnEmbeddedBuffer(bufferId);\n \n \tif (success) {\n-\t\tControlList ctrls(isp_ctrls_);\n+\t\tControlList ctrls(ispCtrls_);\n \n \t\trpiMetadata_.Clear();\n \t\trpiMetadata_.Set(\"device.status\", deviceStatus);\n@@ -785,19 +785,19 @@ bool IPARPi::parseEmbeddedData(unsigned int bufferId, struct DeviceStatus &devic\n \tif (status != RPiController::MdParser::Status::OK) {\n \t\tLOG(IPARPI, Error) << \"Embedded Buffer parsing failed, error \" << status;\n \t} else {\n-\t\tuint32_t exposure_lines, gain_code;\n-\t\tif (helper_->Parser().GetExposureLines(exposure_lines) != RPiController::MdParser::Status::OK) {\n+\t\tuint32_t exposureLines, gainCode;\n+\t\tif (helper_->Parser().GetExposureLines(exposureLines) != RPiController::MdParser::Status::OK) {\n \t\t\tLOG(IPARPI, Error) << \"Exposure time failed\";\n \t\t\treturn false;\n \t\t}\n \n-\t\tdeviceStatus.shutter_speed = helper_->Exposure(exposure_lines);\n-\t\tif (helper_->Parser().GetGainCode(gain_code) != RPiController::MdParser::Status::OK) {\n+\t\tdeviceStatus.shutter_speed = helper_->Exposure(exposureLines);\n+\t\tif (helper_->Parser().GetGainCode(gainCode) != RPiController::MdParser::Status::OK) {\n \t\t\tLOG(IPARPI, Error) << \"Gain failed\";\n \t\t\treturn false;\n \t\t}\n \n-\t\tdeviceStatus.analogue_gain = helper_->Gain(gain_code);\n+\t\tdeviceStatus.analogue_gain = helper_->Gain(gainCode);\n \t\tLOG(IPARPI, Debug) << \"Metadata - Exposure : \"\n \t\t\t\t   << deviceStatus.shutter_speed << \" Gain : \"\n \t\t\t\t   << deviceStatus.analogue_gain;\n@@ -820,7 +820,7 @@ void IPARPi::processStats(unsigned int bufferId)\n \n \tstruct AgcStatus agcStatus;\n \tif (rpiMetadata_.Get(\"agc.status\", agcStatus) == 0) {\n-\t\tControlList ctrls(unicam_ctrls_);\n+\t\tControlList ctrls(unicamCtrls_);\n \t\tapplyAGC(&agcStatus, ctrls);\n \n \t\tIPAOperationData op;\n@@ -832,14 +832,14 @@ void IPARPi::processStats(unsigned int bufferId)\n \n void IPARPi::applyAWB(const struct AwbStatus *awbStatus, ControlList &ctrls)\n {\n-\tconst auto gainR = isp_ctrls_.find(V4L2_CID_RED_BALANCE);\n-\tif (gainR == isp_ctrls_.end()) {\n+\tconst auto gainR = ispCtrls_.find(V4L2_CID_RED_BALANCE);\n+\tif (gainR == ispCtrls_.end()) {\n \t\tLOG(IPARPI, Error) << \"Can't find red gain control\";\n \t\treturn;\n \t}\n \n-\tconst auto gainB = isp_ctrls_.find(V4L2_CID_BLUE_BALANCE);\n-\tif (gainB == isp_ctrls_.end()) {\n+\tconst auto gainB = ispCtrls_.find(V4L2_CID_BLUE_BALANCE);\n+\tif (gainB == ispCtrls_.end()) {\n \t\tLOG(IPARPI, Error) << \"Can't find blue gain control\";\n \t\treturn;\n \t}\n@@ -855,31 +855,31 @@ void IPARPi::applyAWB(const struct AwbStatus *awbStatus, ControlList &ctrls)\n \n void IPARPi::applyAGC(const struct AgcStatus *agcStatus, ControlList &ctrls)\n {\n-\tint32_t gain_code = helper_->GainCode(agcStatus->analogue_gain);\n-\tint32_t exposure_lines = helper_->ExposureLines(agcStatus->shutter_time);\n+\tint32_t gainCode = helper_->GainCode(agcStatus->analogue_gain);\n+\tint32_t exposureLines = helper_->ExposureLines(agcStatus->shutter_time);\n \n-\tif (unicam_ctrls_.find(V4L2_CID_ANALOGUE_GAIN) == unicam_ctrls_.end()) {\n+\tif (unicamCtrls_.find(V4L2_CID_ANALOGUE_GAIN) == unicamCtrls_.end()) {\n \t\tLOG(IPARPI, Error) << \"Can't find analogue gain control\";\n \t\treturn;\n \t}\n \n-\tif (unicam_ctrls_.find(V4L2_CID_EXPOSURE) == unicam_ctrls_.end()) {\n+\tif (unicamCtrls_.find(V4L2_CID_EXPOSURE) == unicamCtrls_.end()) {\n \t\tLOG(IPARPI, Error) << \"Can't find exposure control\";\n \t\treturn;\n \t}\n \n \tLOG(IPARPI, Debug) << \"Applying AGC Exposure: \" << agcStatus->shutter_time\n-\t\t\t   << \" (Shutter lines: \" << exposure_lines << \") Gain: \"\n+\t\t\t   << \" (Shutter lines: \" << exposureLines << \") Gain: \"\n \t\t\t   << agcStatus->analogue_gain << \" (Gain Code: \"\n-\t\t\t   << gain_code << \")\";\n+\t\t\t   << gainCode << \")\";\n \n-\tctrls.set(V4L2_CID_ANALOGUE_GAIN, gain_code);\n-\tctrls.set(V4L2_CID_EXPOSURE, exposure_lines);\n+\tctrls.set(V4L2_CID_ANALOGUE_GAIN, gainCode);\n+\tctrls.set(V4L2_CID_EXPOSURE, exposureLines);\n }\n \n void IPARPi::applyDG(const struct AgcStatus *dgStatus, ControlList &ctrls)\n {\n-\tif (isp_ctrls_.find(V4L2_CID_DIGITAL_GAIN) == isp_ctrls_.end()) {\n+\tif (ispCtrls_.find(V4L2_CID_DIGITAL_GAIN) == ispCtrls_.end()) {\n \t\tLOG(IPARPI, Error) << \"Can't find digital gain control\";\n \t\treturn;\n \t}\n@@ -890,7 +890,7 @@ void IPARPi::applyDG(const struct AgcStatus *dgStatus, ControlList &ctrls)\n \n void IPARPi::applyCCM(const struct CcmStatus *ccmStatus, ControlList &ctrls)\n {\n-\tif (isp_ctrls_.find(V4L2_CID_USER_BCM2835_ISP_CC_MATRIX) == isp_ctrls_.end()) {\n+\tif (ispCtrls_.find(V4L2_CID_USER_BCM2835_ISP_CC_MATRIX) == ispCtrls_.end()) {\n \t\tLOG(IPARPI, Error) << \"Can't find CCM control\";\n \t\treturn;\n \t}\n@@ -911,7 +911,7 @@ void IPARPi::applyCCM(const struct CcmStatus *ccmStatus, ControlList &ctrls)\n \n void IPARPi::applyGamma(const struct ContrastStatus *contrastStatus, ControlList &ctrls)\n {\n-\tif (isp_ctrls_.find(V4L2_CID_USER_BCM2835_ISP_GAMMA) == isp_ctrls_.end()) {\n+\tif (ispCtrls_.find(V4L2_CID_USER_BCM2835_ISP_GAMMA) == ispCtrls_.end()) {\n \t\tLOG(IPARPI, Error) << \"Can't find Gamma control\";\n \t\treturn;\n \t}\n@@ -930,7 +930,7 @@ void IPARPi::applyGamma(const struct ContrastStatus *contrastStatus, ControlList\n \n void IPARPi::applyBlackLevel(const struct BlackLevelStatus *blackLevelStatus, ControlList &ctrls)\n {\n-\tif (isp_ctrls_.find(V4L2_CID_USER_BCM2835_ISP_BLACK_LEVEL) == isp_ctrls_.end()) {\n+\tif (ispCtrls_.find(V4L2_CID_USER_BCM2835_ISP_BLACK_LEVEL) == ispCtrls_.end()) {\n \t\tLOG(IPARPI, Error) << \"Can't find black level control\";\n \t\treturn;\n \t}\n@@ -948,7 +948,7 @@ void IPARPi::applyBlackLevel(const struct BlackLevelStatus *blackLevelStatus, Co\n \n void IPARPi::applyGEQ(const struct GeqStatus *geqStatus, ControlList &ctrls)\n {\n-\tif (isp_ctrls_.find(V4L2_CID_USER_BCM2835_ISP_GEQ) == isp_ctrls_.end()) {\n+\tif (ispCtrls_.find(V4L2_CID_USER_BCM2835_ISP_GEQ) == ispCtrls_.end()) {\n \t\tLOG(IPARPI, Error) << \"Can't find geq control\";\n \t\treturn;\n \t}\n@@ -966,7 +966,7 @@ void IPARPi::applyGEQ(const struct GeqStatus *geqStatus, ControlList &ctrls)\n \n void IPARPi::applyDenoise(const struct SdnStatus *denoiseStatus, ControlList &ctrls)\n {\n-\tif (isp_ctrls_.find(V4L2_CID_USER_BCM2835_ISP_DENOISE) == isp_ctrls_.end()) {\n+\tif (ispCtrls_.find(V4L2_CID_USER_BCM2835_ISP_DENOISE) == ispCtrls_.end()) {\n \t\tLOG(IPARPI, Error) << \"Can't find denoise control\";\n \t\treturn;\n \t}\n@@ -986,7 +986,7 @@ void IPARPi::applyDenoise(const struct SdnStatus *denoiseStatus, ControlList &ct\n \n void IPARPi::applySharpen(const struct SharpenStatus *sharpenStatus, ControlList &ctrls)\n {\n-\tif (isp_ctrls_.find(V4L2_CID_USER_BCM2835_ISP_SHARPEN) == isp_ctrls_.end()) {\n+\tif (ispCtrls_.find(V4L2_CID_USER_BCM2835_ISP_SHARPEN) == ispCtrls_.end()) {\n \t\tLOG(IPARPI, Error) << \"Can't find sharpen control\";\n \t\treturn;\n \t}\n@@ -1007,7 +1007,7 @@ void IPARPi::applySharpen(const struct SharpenStatus *sharpenStatus, ControlList\n \n void IPARPi::applyDPC(const struct DpcStatus *dpcStatus, ControlList &ctrls)\n {\n-\tif (isp_ctrls_.find(V4L2_CID_USER_BCM2835_ISP_DPC) == isp_ctrls_.end()) {\n+\tif (ispCtrls_.find(V4L2_CID_USER_BCM2835_ISP_DPC) == ispCtrls_.end()) {\n \t\tLOG(IPARPI, Error) << \"Can't find DPC control\";\n \t\treturn;\n \t}\n@@ -1023,7 +1023,7 @@ void IPARPi::applyDPC(const struct DpcStatus *dpcStatus, ControlList &ctrls)\n \n void IPARPi::applyLS(const struct AlscStatus *lsStatus, ControlList &ctrls)\n {\n-\tif (isp_ctrls_.find(V4L2_CID_USER_BCM2835_ISP_LENS_SHADING) == isp_ctrls_.end()) {\n+\tif (ispCtrls_.find(V4L2_CID_USER_BCM2835_ISP_LENS_SHADING) == ispCtrls_.end()) {\n \t\tLOG(IPARPI, Error) << \"Can't find LS control\";\n \t\treturn;\n \t}\n@@ -1032,18 +1032,18 @@ void IPARPi::applyLS(const struct AlscStatus *lsStatus, ControlList &ctrls)\n \t * Program lens shading tables into pipeline.\n \t * Choose smallest cell size that won't exceed 63x48 cells.\n \t */\n-\tconst int cell_sizes[] = { 16, 32, 64, 128, 256 };\n-\tunsigned int num_cells = ARRAY_SIZE(cell_sizes);\n-\tunsigned int i, w, h, cell_size;\n-\tfor (i = 0; i < num_cells; i++) {\n-\t\tcell_size = cell_sizes[i];\n-\t\tw = (mode_.width + cell_size - 1) / cell_size;\n-\t\th = (mode_.height + cell_size - 1) / cell_size;\n+\tconst int cellSizes[] = { 16, 32, 64, 128, 256 };\n+\tunsigned int numCells = ARRAY_SIZE(cellSizes);\n+\tunsigned int i, w, h, cellSize;\n+\tfor (i = 0; i < numCells; i++) {\n+\t\tcellSize = cellSizes[i];\n+\t\tw = (mode_.width + cellSize - 1) / cellSize;\n+\t\th = (mode_.height + cellSize - 1) / cellSize;\n \t\tif (w < 64 && h <= 48)\n \t\t\tbreak;\n \t}\n \n-\tif (i == num_cells) {\n+\tif (i == numCells) {\n \t\tLOG(IPARPI, Error) << \"Cannot find cell size\";\n \t\treturn;\n \t}\n@@ -1052,7 +1052,7 @@ void IPARPi::applyLS(const struct AlscStatus *lsStatus, ControlList &ctrls)\n \tw++, h++;\n \tbcm2835_isp_lens_shading ls = {\n \t\t.enabled = 1,\n-\t\t.grid_cell_size = cell_size,\n+\t\t.grid_cell_size = cellSize,\n \t\t.grid_width = w,\n \t\t.grid_stride = w,\n \t\t.grid_height = h,\n@@ -1062,7 +1062,7 @@ void IPARPi::applyLS(const struct AlscStatus *lsStatus, ControlList &ctrls)\n \t\t.gain_format = GAIN_FORMAT_U4P10\n \t};\n \n-\tif (!lsTable_ || w * h * 4 * sizeof(uint16_t) > MAX_LS_GRID_SIZE) {\n+\tif (!lsTable_ || w * h * 4 * sizeof(uint16_t) > RPi::MaxLsGridSize) {\n \t\tLOG(IPARPI, Error) << \"Do not have a correctly allocate lens shading table!\";\n \t\treturn;\n \t}\n@@ -1083,41 +1083,41 @@ void IPARPi::applyLS(const struct AlscStatus *lsStatus, ControlList &ctrls)\n }\n \n /*\n- * Resamples a 16x12 table with central sampling to dest_w x dest_h with corner\n+ * Resamples a 16x12 table with central sampling to destW x destH with corner\n  * sampling.\n  */\n void IPARPi::resampleTable(uint16_t dest[], double const src[12][16],\n-\t\t\t   int dest_w, int dest_h)\n+\t\t\t   int destW, int destH)\n {\n \t/*\n \t * Precalculate and cache the x sampling locations and phases to\n \t * save recomputing them on every row.\n \t */\n-\tassert(dest_w > 1 && dest_h > 1 && dest_w <= 64);\n-\tint x_lo[64], x_hi[64];\n+\tassert(destW > 1 && destH > 1 && destW <= 64);\n+\tint xLo[64], xHi[64];\n \tdouble xf[64];\n-\tdouble x = -0.5, x_inc = 16.0 / (dest_w - 1);\n-\tfor (int i = 0; i < dest_w; i++, x += x_inc) {\n-\t\tx_lo[i] = floor(x);\n-\t\txf[i] = x - x_lo[i];\n-\t\tx_hi[i] = x_lo[i] < 15 ? x_lo[i] + 1 : 15;\n-\t\tx_lo[i] = x_lo[i] > 0 ? x_lo[i] : 0;\n+\tdouble x = -0.5, xInc = 16.0 / (destW - 1);\n+\tfor (int i = 0; i < destW; i++, x += xInc) {\n+\t\txLo[i] = floor(x);\n+\t\txf[i] = x - xLo[i];\n+\t\txHi[i] = xLo[i] < 15 ? xLo[i] + 1 : 15;\n+\t\txLo[i] = xLo[i] > 0 ? xLo[i] : 0;\n \t}\n \n \t/* Now march over the output table generating the new values. */\n-\tdouble y = -0.5, y_inc = 12.0 / (dest_h - 1);\n-\tfor (int j = 0; j < dest_h; j++, y += y_inc) {\n-\t\tint y_lo = floor(y);\n-\t\tdouble yf = y - y_lo;\n-\t\tint y_hi = y_lo < 11 ? y_lo + 1 : 11;\n-\t\ty_lo = y_lo > 0 ? y_lo : 0;\n-\t\tdouble const *row_above = src[y_lo];\n-\t\tdouble const *row_below = src[y_hi];\n-\t\tfor (int i = 0; i < dest_w; i++) {\n-\t\t\tdouble above = row_above[x_lo[i]] * (1 - xf[i])\n-\t\t\t\t     + row_above[x_hi[i]] * xf[i];\n-\t\t\tdouble below = row_below[x_lo[i]] * (1 - xf[i])\n-\t\t\t\t     + row_below[x_hi[i]] * xf[i];\n+\tdouble y = -0.5, yInc = 12.0 / (destH - 1);\n+\tfor (int j = 0; j < destH; j++, y += yInc) {\n+\t\tint yLo = floor(y);\n+\t\tdouble yf = y - yLo;\n+\t\tint yHi = yLo < 11 ? yLo + 1 : 11;\n+\t\tyLo = yLo > 0 ? yLo : 0;\n+\t\tdouble const *rowAbove = src[yLo];\n+\t\tdouble const *rowBelow = src[yHi];\n+\t\tfor (int i = 0; i < destW; i++) {\n+\t\t\tdouble above = rowAbove[xLo[i]] * (1 - xf[i])\n+\t\t\t\t     + rowAbove[xHi[i]] * xf[i];\n+\t\t\tdouble below = rowBelow[xLo[i]] * (1 - xf[i])\n+\t\t\t\t     + rowBelow[xHi[i]] * xf[i];\n \t\t\tint result = floor(1024 * (above * (1 - yf) + below * yf) + .5);\n \t\t\t*(dest++) = result > 16383 ? 16383 : result; /* want u4.10 */\n \t\t}\ndiff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 35dbe0fb..8d40b0ed 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -1012,7 +1012,7 @@ int RPiCameraData::configureIPA()\n \n \t/* Allocate the lens shading table via dmaHeap and pass to the IPA. */\n \tif (!lsTable_.isValid()) {\n-\t\tlsTable_ = dmaHeap_.alloc(\"ls_grid\", MAX_LS_GRID_SIZE);\n+\t\tlsTable_ = dmaHeap_.alloc(\"ls_grid\", RPi::MaxLsGridSize);\n \t\tif (!lsTable_.isValid())\n \t\t\treturn -ENOMEM;\n \n",
    "prefixes": [
        "libcamera-devel",
        "4/4"
    ]
}