Show a patch.

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

{
    "id": 14058,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/14058/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/14058/",
    "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": "<20211006140041.964542-5-jeanmichel.hautbois@ideasonboard.com>",
    "date": "2021-10-06T14:00:34",
    "name": "[libcamera-devel,v3,04/12] ipa: ipu3: awb: Make the naming consistent",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "599b1032ca991ef2aa744826d6bb663a8fb75e0a",
    "submitter": {
        "id": 75,
        "url": "https://patchwork.libcamera.org/api/1.1/people/75/?format=api",
        "name": "Jean-Michel Hautbois",
        "email": "jeanmichel.hautbois@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/14058/mbox/",
    "series": [
        {
            "id": 2605,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2605/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2605",
            "date": "2021-10-06T14:00:30",
            "name": "Improve ImgU statistics usage",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/2605/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/14058/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/14058/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 20D7EC323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  6 Oct 2021 14:01:08 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3AD54691D7;\n\tWed,  6 Oct 2021 16:01:06 +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 CD0CE691BE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  6 Oct 2021 16:01:01 +0200 (CEST)",
            "from tatooine.ideasonboard.com (unknown\n\t[IPv6:2a01:e0a:169:7140:843b:c831:54de:6e8c])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 677A51909;\n\tWed,  6 Oct 2021 16:01:01 +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=\"wXSjydVN\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1633528861;\n\tbh=/1nqqv7d8EaT3GEaQLgVYmBWxVQ86adJo9s6N7mQRmA=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=wXSjydVNPkaZ8SCT1rwKti+R0n9UcXTNCcJ4toMmetgZumsyY8E/pzVrrQRt1lJB1\n\tm+WSuAaL4v4/slKxCVnKgPkWgR0jEsZNFFxSHIt8L0LvZfvMZxPEl6+/P9yEPnHcuP\n\tk6gWxDQVVsM/kTA2nRHHuaf1BP0Q4WeyCRBZIOKM=",
        "From": "Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed,  6 Oct 2021 16:00:34 +0200",
        "Message-Id": "<20211006140041.964542-5-jeanmichel.hautbois@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.30.2",
        "In-Reply-To": "<20211006140041.964542-1-jeanmichel.hautbois@ideasonboard.com>",
        "References": "<20211006140041.964542-1-jeanmichel.hautbois@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v3 04/12] ipa: ipu3: awb: Make the naming\n\tconsistent",
        "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 variables mix the terms cell, region and zone. It can confuse the\nreader, and make the algorithm more difficult to follow. Rename the\nlocal variables to be consistent with their definitions:\n- Cells are defined in Pixels\n- Zones are defined in Cells\nThere is no \"region\" as such, so replace it with the correct term.\n\nSigned-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/ipa/ipu3/algorithms/awb.cpp | 31 +++++++++++++++++--------------\n 1 file changed, 17 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/src/ipa/ipu3/algorithms/awb.cpp b/src/ipa/ipu3/algorithms/awb.cpp\nindex c1a303e2..dba7cec3 100644\n--- a/src/ipa/ipu3/algorithms/awb.cpp\n+++ b/src/ipa/ipu3/algorithms/awb.cpp\n@@ -224,31 +224,34 @@ void Awb::generateZones(std::vector<RGB> &zones)\n void Awb::generateAwbStats(const ipu3_uapi_stats_3a *stats,\n \t\t\t   const ipu3_uapi_grid_config &grid)\n {\n-\tuint32_t regionWidth = round(grid.width / static_cast<double>(kAwbStatsSizeX));\n-\tuint32_t regionHeight = round(grid.height / static_cast<double>(kAwbStatsSizeY));\n+\tuint32_t cellsPerZoneX = round(grid.width / static_cast<double>(kAwbStatsSizeX));\n+\tuint32_t cellsPerZoneY = round(grid.height / static_cast<double>(kAwbStatsSizeY));\n \n \t/*\n \t * Generate a (kAwbStatsSizeX x kAwbStatsSizeY) array from the IPU3 grid which is\n \t * (grid.width x grid.height).\n \t */\n-\tfor (unsigned int j = 0; j < kAwbStatsSizeY * regionHeight; j++) {\n-\t\tfor (unsigned int i = 0; i < kAwbStatsSizeX * regionWidth; i++) {\n-\t\t\tuint32_t cellPosition = j * grid.width + i;\n-\t\t\tuint32_t cellX = (cellPosition / regionWidth) % kAwbStatsSizeX;\n-\t\t\tuint32_t cellY = ((cellPosition / grid.width) / regionHeight) % kAwbStatsSizeY;\n+\tfor (unsigned int cellY = 0; cellY < kAwbStatsSizeY * cellsPerZoneY; cellY++) {\n+\t\tfor (unsigned int cellX = 0; cellX < kAwbStatsSizeX * cellsPerZoneX; cellX++) {\n+\t\t\tuint32_t cellPosition = (cellY * grid.width + cellX)\n+\t\t\t\t\t      * sizeof(Ipu3AwbCell);\n+\t\t\tuint32_t zoneX = cellX / cellsPerZoneX;\n+\t\t\tuint32_t zoneY = cellY / cellsPerZoneY;\n \n-\t\t\tuint32_t awbRegionPosition = cellY * kAwbStatsSizeX + cellX;\n-\t\t\tcellPosition *= 8;\n+\t\t\tuint32_t awbZonePosition = zoneY * kAwbStatsSizeX + zoneX;\n \n \t\t\t/* Cast the initial IPU3 structure to simplify the reading */\n-\t\t\tIpu3AwbCell *currentCell = reinterpret_cast<Ipu3AwbCell *>(const_cast<uint8_t *>(&stats->awb_raw_buffer.meta_data[cellPosition]));\n+\t\t\tconst Ipu3AwbCell *currentCell =\n+\t\t\t\treinterpret_cast<const Ipu3AwbCell *>(\n+\t\t\t\t\t&stats->awb_raw_buffer.meta_data[cellPosition]\n+\t\t\t\t);\n \t\t\tif (currentCell->satRatio == 0) {\n \t\t\t\t/* The cell is not saturated, use the current cell */\n-\t\t\t\tawbStats_[awbRegionPosition].counted++;\n+\t\t\t\tawbStats_[awbZonePosition].counted++;\n \t\t\t\tuint32_t greenValue = currentCell->greenRedAvg + currentCell->greenBlueAvg;\n-\t\t\t\tawbStats_[awbRegionPosition].sum.green += greenValue / 2;\n-\t\t\t\tawbStats_[awbRegionPosition].sum.red += currentCell->redAvg;\n-\t\t\t\tawbStats_[awbRegionPosition].sum.blue += currentCell->blueAvg;\n+\t\t\t\tawbStats_[awbZonePosition].sum.green += greenValue / 2;\n+\t\t\t\tawbStats_[awbZonePosition].sum.red += currentCell->redAvg;\n+\t\t\t\tawbStats_[awbZonePosition].sum.blue += currentCell->blueAvg;\n \t\t\t}\n \t\t}\n \t}\n",
    "prefixes": [
        "libcamera-devel",
        "v3",
        "04/12"
    ]
}