Show a patch.

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

{
    "id": 24422,
    "url": "https://patchwork.libcamera.org/api/patches/24422/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/24422/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/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": "<20250919094041.183031-14-stefan.klug@ideasonboard.com>",
    "date": "2025-09-19T09:40:28",
    "name": "[v5,13/19] ipa: rkisp1: Switch histogram to RGB combined mode",
    "commit_ref": "c8f323b7ae40d4bd56cb1d547b269b29a8324fbb",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "d85240e201c5eb1345aed057ebf44667dcb2fc13",
    "submitter": {
        "id": 184,
        "url": "https://patchwork.libcamera.org/api/people/184/?format=api",
        "name": "Stefan Klug",
        "email": "stefan.klug@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/24422/mbox/",
    "series": [
        {
            "id": 5450,
            "url": "https://patchwork.libcamera.org/api/series/5450/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5450",
            "date": "2025-09-19T09:40:15",
            "name": "Implement WDR algorithm",
            "version": 5,
            "mbox": "https://patchwork.libcamera.org/series/5450/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/24422/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/24422/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 DC578C328C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 19 Sep 2025 09:41:36 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 72BBF6B5C2;\n\tFri, 19 Sep 2025 11:41:36 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 930C26B5BA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 19 Sep 2025 11:41:31 +0200 (CEST)",
            "from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:4d54:eab8:98ca:163b])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 6765FD3E;\n\tFri, 19 Sep 2025 11:40:11 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"NMOmdyKi\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1758274811;\n\tbh=/pVOmLIZnIp1gu90GepU9SqG6OJvbmpojHTW1RnqeNs=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=NMOmdyKi+1e/l/xGkZorhz4dM+wfrIOPLYfXWNeVXRu05nx5t6So92rRgyCn8Enwy\n\ti5eMm3GczXqBIp967OZnE+BzBVgm+aqBvn8QQ2soTE4PJ5pANpsxH5wMB3a+Tp/o7D\n\tgquZ0od8tQFKzis2uikqOEDWW8M7roYpojPlHqRw=",
        "From": "Stefan Klug <stefan.klug@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Stefan Klug <stefan.klug@ideasonboard.com>,\n\tPaul Elder <paul.elder@ideasonboard.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>",
        "Subject": "[PATCH v5 13/19] ipa: rkisp1: Switch histogram to RGB combined mode",
        "Date": "Fri, 19 Sep 2025 11:40:28 +0200",
        "Message-ID": "<20250919094041.183031-14-stefan.klug@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.48.1",
        "In-Reply-To": "<20250919094041.183031-1-stefan.klug@ideasonboard.com>",
        "References": "<20250919094041.183031-1-stefan.klug@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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 Y mode of the histogram gets captured at the ISP output, before the\noutput formatter.  This has the side effect that the first and the last\nbins are empty in case of limited YUV range.  Another side effect is\nthat gamma and GWDR processing is included in the histogram which makes\nalgorithm development very difficult. In RGB mode the histogram is taken\nafter xtalk (CCM) and is therefore independent of gamma and WDR. The\nlimited range issue also does not apply. In the ISP reference it is\nhowever stated that \"it is not possible to calculate a luminance or\ngrayscale histogram from an RGB histogram since the position information\nis lost during its generation\".\n\nDuring testing the RGB histogram provided good data and better\nalgorithmic stability at a possible (but not measured) inaccuracy.\n\nAnother option would be to pass the color space information into the IPA\nand strip the histogram accordingly. For ease of implementation switch to\nthe RGB mode.\n\nSigned-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n---\n\nChanges in v4:\n- Tiny fixes in the block comment (no doxygen & whitespace)\n- Collected tags\n\nChanges in v3:\n- Added block comment inside the code\n---\n src/ipa/rkisp1/algorithms/agc.cpp | 19 ++++++++++++++++++-\n 1 file changed, 18 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\nindex fe2f66cf6ee4..174d810edc65 100644\n--- a/src/ipa/rkisp1/algorithms/agc.cpp\n+++ b/src/ipa/rkisp1/algorithms/agc.cpp\n@@ -397,7 +397,24 @@ void Agc::prepare(IPAContext &context, const uint32_t frame,\n \thstConfig.setEnabled(true);\n \n \thstConfig->meas_window = context.configuration.agc.measureWindow;\n-\thstConfig->mode = RKISP1_CIF_ISP_HISTOGRAM_MODE_Y_HISTOGRAM;\n+\t/*\n+\t * The Y mode of the histogram gets captured at the ISP output, before\n+\t * the output formatter.  This has the side effect that the first and\n+\t * the last bins are empty in case of limited YUV range.  Another side\n+\t * effect is that gamma and GWDR processing is included in the histogram\n+\t * which makes algorithm development very difficult. In RGB mode the\n+\t * histogram is taken after xtalk (CCM) and is therefore independent of\n+\t * gamma and WDR. The limited range issue also does not apply. In the\n+\t * ISP reference it is however stated that \"it is not possible to\n+\t * calculate a luminance or grayscale histogram from an RGB histogram\n+\t * since the position information is lost during its generation\".\n+\t *\n+\t * During testing the RGB histogram provided good data and better\n+\t * algorithmic stability at a possible (but not measured) inaccuracy.\n+\t *\n+\t * \\todo For a proper fix support for HIST64 is needed.\n+\t */\n+\thstConfig->mode = RKISP1_CIF_ISP_HISTOGRAM_MODE_RGB_COMBINED;\n \n \tSpan<uint8_t> weights{\n \t\thstConfig->hist_weight,\n",
    "prefixes": [
        "v5",
        "13/19"
    ]
}