Show a patch.

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

{
    "id": 19907,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/19907/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/19907/",
    "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": "<20240418124632.652163-4-dan.scally@ideasonboard.com>",
    "date": "2024-04-18T12:46:32",
    "name": "[3/3] ipa: ipu3: Use a Y histogram instead of green",
    "commit_ref": null,
    "pull_url": null,
    "state": "rejected",
    "archived": false,
    "hash": "b4f8988041fd2fd172ba40f6b3cc3b26f09af1af",
    "submitter": {
        "id": 156,
        "url": "https://patchwork.libcamera.org/api/1.1/people/156/?format=api",
        "name": "Dan Scally",
        "email": "dan.scally@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/19907/mbox/",
    "series": [
        {
            "id": 4262,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4262/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4262",
            "date": "2024-04-18T12:46:29",
            "name": "Minor AGC fixes",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/4262/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/19907/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/19907/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 9B1A8C32C9\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 18 Apr 2024 12:46:51 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 615F7633F7;\n\tThu, 18 Apr 2024 14:46:48 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 74E07633F3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 18 Apr 2024 14:46:43 +0200 (CEST)",
            "from mail.ideasonboard.com\n\t(cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C62C727C;\n\tThu, 18 Apr 2024 14:45:55 +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=\"A8ywHBYC\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1713444355;\n\tbh=6XqyCQqXki+3gyfZzJ7+4a2JpEiAEDmlubddBrbgCs8=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=A8ywHBYC4dr1XN+at5x/ZyV7C6FKlDkk2yN4PhKXjHQNdCsxkJxcotWyCQJXE1jUk\n\tlYDyM7ar+nj3JMPHyxnoKtdA+weVhF4TXoCJZsGxgPxufEf1fDBFLvxmjIGo3NXry+\n\tamcfoADrjmSr6nn4Spmfrnr6PxdmQa6FTMa9xADI=",
        "From": "Daniel Scally <dan.scally@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Daniel Scally <dan.scally@ideasonboard.com>",
        "Subject": "[PATCH 3/3] ipa: ipu3: Use a Y histogram instead of green",
        "Date": "Thu, 18 Apr 2024 13:46:32 +0100",
        "Message-Id": "<20240418124632.652163-4-dan.scally@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20240418124632.652163-1-dan.scally@ideasonboard.com>",
        "References": "<20240418124632.652163-1-dan.scally@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 IPU3 IPA module uses a green histogram for the AGC algorithm's\nconstraint mode calculations. Switch instead to a luminance histogram\ncalculated using the Rec.601 coefficients.\n\nSigned-off-by: Daniel Scally <dan.scally@ideasonboard.com>\n---\n src/ipa/ipu3/algorithms/agc.cpp | 15 ++++++++-------\n 1 file changed, 8 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp\nindex a59b73fb..76d2bb60 100644\n--- a/src/ipa/ipu3/algorithms/agc.cpp\n+++ b/src/ipa/ipu3/algorithms/agc.cpp\n@@ -152,18 +152,19 @@ Histogram Agc::parseStatistics(const ipu3_uapi_stats_3a *stats,\n \t\t\t\treinterpret_cast<const ipu3_uapi_awb_set_item *>(\n \t\t\t\t\t&stats->awb_raw_buffer.meta_data[cellPosition]);\n \n-\t\t\trgbTriples_.push_back({\n-\t\t\t\tcell->R_avg,\n-\t\t\t\t(cell->Gr_avg + cell->Gb_avg) / 2,\n-\t\t\t\tcell->B_avg\n-\t\t\t});\n+\t\t\tuint8_t G_avg = (cell->Gr_avg + cell->Gb_avg) / 2;\n+\n+\t\t\trgbTriples_.push_back({cell->R_avg, G_avg, cell->B_avg});\n \n \t\t\t/*\n-\t\t\t * Store the average green value to estimate the\n+\t\t\t * Store the average luminance value to estimate the\n \t\t\t * brightness. Even the overexposed pixels are\n \t\t\t * taken into account.\n \t\t\t */\n-\t\t\thist[(cell->Gr_avg + cell->Gb_avg) / 2]++;\n+\t\t\tuint8_t y = (cell->R_avg * .299) +\n+\t\t\t\t    (G_avg * .587) +\n+\t\t\t\t    (cell->B_avg * .114);\n+\t\t\thist[y]++;\n \t\t}\n \t}\n \n",
    "prefixes": [
        "3/3"
    ]
}