Show a patch.

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

{
    "id": 13781,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/13781/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/13781/",
    "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": "<20210909082516.26055-3-jeanmichel.hautbois@ideasonboard.com>",
    "date": "2021-09-09T08:25:14",
    "name": "[libcamera-devel,v5,2/4] ipa: ipu3: Rename IspStatsRegion to Accumulator",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "d48a5028914c12aa328bca64f0a691c4001afa80",
    "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/13781/mbox/",
    "series": [
        {
            "id": 2503,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2503/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2503",
            "date": "2021-09-09T08:25:12",
            "name": "Move and improve AWB structures",
            "version": 5,
            "mbox": "https://patchwork.libcamera.org/series/2503/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/13781/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/13781/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 E5353BDB1D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  9 Sep 2021 08:25:23 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 53D0869174;\n\tThu,  9 Sep 2021 10:25:23 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 357F56916D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  9 Sep 2021 10:25:20 +0200 (CEST)",
            "from tatooine.ideasonboard.com (unknown\n\t[IPv6:2a01:e0a:169:7140:ab35:be36:579e:39cf])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 730BAD88;\n\tThu,  9 Sep 2021 10:25:19 +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=\"ReuUJ2JJ\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1631175919;\n\tbh=FspWbIz6Rjwifbs1ggSz/FxeY+uTQJjsubl8lIg31pU=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=ReuUJ2JJtTSxqfNDA0HfjveOMFRH3cX17UwzJcIF9TIa4JG3YyXn/xt5v7Jy80Pg1\n\tBrwwFWvh19VSGzx9Sd1AlCb2Q/xb+wF/Ru+6BQAc+9NQY5bb7p0jzIjdZj67JmmQk8\n\tq5gonGTmfFYMIR71ypvoHNO4tNvHCPnl4d0rZYlY=",
        "From": "Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Thu,  9 Sep 2021 10:25:14 +0200",
        "Message-Id": "<20210909082516.26055-3-jeanmichel.hautbois@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.30.2",
        "In-Reply-To": "<20210909082516.26055-1-jeanmichel.hautbois@ideasonboard.com>",
        "References": "<20210909082516.26055-1-jeanmichel.hautbois@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v5 2/4] ipa: ipu3: Rename IspStatsRegion\n\tto Accumulator",
        "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 IspStatsRegion structure was introduced as an attempt to prepare for\na generic AWB algorithm structure. The structure name by itself is not\nexplicit and it is too optimistic to try and make a generic one for now.\n\nIts role is to accumulate the pixels in a given region.  Rename it to\naccumulator, and remove the uncounted field at the same time. It is\nalways possible to know how many pixels are not relevant for the\nalgorithm by calculating total-counted. The uncounted field was only\ndeclared and not used. Amend the documentation accordingly.\n\nSigned-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n---\n src/ipa/ipu3/algorithms/awb.cpp | 36 ++++++++++++++++++++-------------\n src/ipa/ipu3/algorithms/awb.h   |  5 ++---\n 2 files changed, 24 insertions(+), 17 deletions(-)",
    "diff": "diff --git a/src/ipa/ipu3/algorithms/awb.cpp b/src/ipa/ipu3/algorithms/awb.cpp\nindex e05647c9..97f5839f 100644\n--- a/src/ipa/ipu3/algorithms/awb.cpp\n+++ b/src/ipa/ipu3/algorithms/awb.cpp\n@@ -21,26 +21,35 @@ static constexpr uint32_t kMinZonesCounted = 16;\n static constexpr uint32_t kMinGreenLevelInZone = 32;\n \n /**\n- * \\struct IspStatsRegion\n+ * \\struct Accumulator\n  * \\brief RGB statistics for a given region\n  *\n- * The IspStatsRegion structure is intended to abstract the ISP specific\n- * statistics and use an agnostic algorithm to compute AWB.\n+ * A frame is divided into zones, each zone is made of multiple regions which\n+ * are defined by the grid configuration. The algorithm works with a fixed\n+ * number of zones \\a kAwbStatsSizeX x \\a kAwbStatsSizeY.\n+ * For example, a frame of 1280x720 is divided into 81x45 regions of [16x16]\n+ * pixels because the BDS output size will be calculated as 1296x720. In the\n+ * case of \\a kAwbStatsSizeX=16 and \\a kAwbStatsSizeY=12 the zones are made of\n+ * [5x4] regions. The regions are left-aligned and calculated by\n+ * IPAIPU3::calculateBdsGrid().\n  *\n- * \\var IspStatsRegion::counted\n- * \\brief Number of pixels used to calculate the sums\n+ * The Accumulator structure stores the sum of the pixel values in a zone of\n+ * the image, as well as the number of relevant regions in this same zone. A\n+ * relevant region is an unsaturated region here, depending on the awb\n+ * thresholds.\n+ * \\todo extend the notion of relevant to something else ?\n  *\n- * \\var IspStatsRegion::uncounted\n- * \\brief Remaining number of pixels in the region\n+ * \\var Accumulator::counted\n+ * \\brief Number of relevant regions used to calculate the sums\n  *\n- * \\var IspStatsRegion::rSum\n- * \\brief Sum of the red values in the region\n+ * \\var Accumulator::rSum\n+ * \\brief Sum of the red values in the zone\n  *\n- * \\var IspStatsRegion::gSum\n- * \\brief Sum of the green values in the region\n+ * \\var Accumulator::gSum\n+ * \\brief Sum of the green values in the zone\n  *\n- * \\var IspStatsRegion::bSum\n- * \\brief Sum of the blue values in the region\n+ * \\var Accumulator::bSum\n+ * \\brief Sum of the blue values in the zone\n  */\n \n /**\n@@ -215,7 +224,6 @@ void Awb::clearAwbStats()\n \t\tawbStats_[i].rSum = 0;\n \t\tawbStats_[i].gSum = 0;\n \t\tawbStats_[i].counted = 0;\n-\t\tawbStats_[i].uncounted = 0;\n \t}\n }\n \ndiff --git a/src/ipa/ipu3/algorithms/awb.h b/src/ipa/ipu3/algorithms/awb.h\nindex cc848060..ac8ccc84 100644\n--- a/src/ipa/ipu3/algorithms/awb.h\n+++ b/src/ipa/ipu3/algorithms/awb.h\n@@ -33,9 +33,8 @@ struct Ipu3AwbCell {\n \tunsigned char padding[3];\n } __attribute__((packed));\n \n-struct IspStatsRegion {\n+struct Accumulator {\n \tunsigned int counted;\n-\tunsigned int uncounted;\n \tunsigned long long rSum;\n \tunsigned long long gSum;\n \tunsigned long long bSum;\n@@ -82,7 +81,7 @@ private:\n \tuint32_t estimateCCT(double red, double green, double blue);\n \n \tstd::vector<RGB> zones_;\n-\tIspStatsRegion awbStats_[kAwbStatsSizeX * kAwbStatsSizeY];\n+\tAccumulator awbStats_[kAwbStatsSizeX * kAwbStatsSizeY];\n \tAwbStatus asyncResults_;\n };\n \n",
    "prefixes": [
        "libcamera-devel",
        "v5",
        "2/4"
    ]
}