Show a patch.

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

{
    "id": 19738,
    "url": "https://patchwork.libcamera.org/api/patches/19738/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/19738/",
    "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": "<20240319105403.4045592-2-paul.elder@ideasonboard.com>",
    "date": "2024-03-19T10:54:02",
    "name": "[1/2] ipa: libipa: histogram: Add rshift parameter to constructor",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": false,
    "hash": "f738fd6258393aabeac8911accc43726b6450595",
    "submitter": {
        "id": 17,
        "url": "https://patchwork.libcamera.org/api/people/17/?format=api",
        "name": "Paul Elder",
        "email": "paul.elder@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/19738/mbox/",
    "series": [
        {
            "id": 4229,
            "url": "https://patchwork.libcamera.org/api/series/4229/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4229",
            "date": "2024-03-19T10:54:01",
            "name": "ipa: rkisp1: Fix histogram",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/4229/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/19738/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/19738/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 3CA95C3274\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 19 Mar 2024 10:54:32 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CE86262CAD;\n\tTue, 19 Mar 2024 11:54:31 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BF65A62CA4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 19 Mar 2024 11:54:29 +0100 (CET)",
            "from pyrite.hamster-moth.ts.net (h175-177-049-156.catv02.itscom.jp\n\t[175.177.49.156])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 37880F02;\n\tTue, 19 Mar 2024 11:54:01 +0100 (CET)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"IwkxVIf/\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1710845643;\n\tbh=qVvoVGoHabeb9SJcBGwBh3Ew6mdH5XghgO5gs5yTtmM=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=IwkxVIf/X6qyLpXelV+F3mD0i/M17wh6khjMqwt8Uf9qTq1BCpSDSZabWG2foNMA8\n\tb6f/m9ZKjmK7pLmYlM4uud/Ej7uSKgQDT8Vr2wj3Bkg9NLG+4r5CrR/Yw80aFsLNcn\n\tYUKIdAcmytvmLtMKn8zC+hJ5RReZwCICYvJ5h1pk=",
        "From": "Paul Elder <paul.elder@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Paul Elder <paul.elder@ideasonboard.com>",
        "Subject": "[PATCH 1/2] ipa: libipa: histogram: Add rshift parameter to\n\tconstructor",
        "Date": "Tue, 19 Mar 2024 19:54:02 +0900",
        "Message-Id": "<20240319105403.4045592-2-paul.elder@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.39.2",
        "In-Reply-To": "<20240319105403.4045592-1-paul.elder@ideasonboard.com>",
        "References": "<20240319105403.4045592-1-paul.elder@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": "Add an parameter for right-shifting the values during construction of\nthe histogram.\n\nThis is necessary notably for the rkisp1, as the values reported from\nthe hardware are 20 bits where the upper 16-bits are meaningful integer\nvalues and the lower 4 bits are fractional and meant to be discarded.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n---\n src/ipa/libipa/histogram.cpp | 5 +++--\n src/ipa/libipa/histogram.h   | 2 +-\n 2 files changed, 4 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/src/ipa/libipa/histogram.cpp b/src/ipa/libipa/histogram.cpp\nindex 6b5cde8e..5cfbb720 100644\n--- a/src/ipa/libipa/histogram.cpp\n+++ b/src/ipa/libipa/histogram.cpp\n@@ -31,13 +31,14 @@ namespace ipa {\n /**\n  * \\brief Create a cumulative histogram\n  * \\param[in] data A pre-sorted histogram to be passed\n+ * \\param[in] rshift Number of bits to right shift the values by\n  */\n-Histogram::Histogram(Span<const uint32_t> data)\n+Histogram::Histogram(Span<const uint32_t> data, uint8_t rshift)\n {\n \tcumulative_.reserve(data.size());\n \tcumulative_.push_back(0);\n \tfor (const uint32_t &value : data)\n-\t\tcumulative_.push_back(cumulative_.back() + value);\n+\t\tcumulative_.push_back(cumulative_.back() + (value >> rshift));\n }\n \n /**\ndiff --git a/src/ipa/libipa/histogram.h b/src/ipa/libipa/histogram.h\nindex 05bb4b80..a82e623e 100644\n--- a/src/ipa/libipa/histogram.h\n+++ b/src/ipa/libipa/histogram.h\n@@ -22,7 +22,7 @@ namespace ipa {\n class Histogram\n {\n public:\n-\tHistogram(Span<const uint32_t> data);\n+\tHistogram(Span<const uint32_t> data, uint8_t rshift = 0);\n \tsize_t bins() const { return cumulative_.size() - 1; }\n \tuint64_t total() const { return cumulative_[cumulative_.size() - 1]; }\n \tuint64_t cumulativeFrequency(double bin) const;\n",
    "prefixes": [
        "1/2"
    ]
}