Show a patch.

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

{
    "id": 17441,
    "url": "https://patchwork.libcamera.org/api/patches/17441/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/17441/",
    "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": "<20220927023642.12341-31-laurent.pinchart@ideasonboard.com>",
    "date": "2022-09-27T02:36:39",
    "name": "[libcamera-devel,v5,30/33] ipa: rkisp1: awb: Prevent RGB means from being negative",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "276dd35b92a064400844343f4070e00a452b6d9e",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/17441/mbox/",
    "series": [
        {
            "id": 3506,
            "url": "https://patchwork.libcamera.org/api/series/3506/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3506",
            "date": "2022-09-27T02:36:09",
            "name": "ipa: Frame context queue, IPU3 & RkISP consolidation, and RkISP1 improvements",
            "version": 5,
            "mbox": "https://patchwork.libcamera.org/series/3506/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/17441/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/17441/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 E23B7C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 27 Sep 2022 02:37:49 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A830862379;\n\tTue, 27 Sep 2022 04:37:49 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 99768622EE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 27 Sep 2022 04:37:46 +0200 (CEST)",
            "from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1DFC24F7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 27 Sep 2022 04:37:46 +0200 (CEST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664246269;\n\tbh=MVOLInGX5yVAIA9XLQDFWLFjXKy+lGpTeefmyExcEhw=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=cJKcLu0lJsipo2kA5CF373Fk7Had8BVGO4ztXo0nbcZgR+wN9op4myiNLd6chn6qy\n\tKAV5yTcYvqj94DRKlQyVzlur6iuhVVKXNJt5xjqxw9lfe6kh8iDxoXQBNH2j6725Fg\n\teyUqXgZTh/6P9dFXp1I8NfHHQWA/4JFCRMo/6m1D++ZiZhMHNB4YCJlOSzPj7WVIZ9\n\tuOOQ+4p6um4Uj9pQ/6eXh0DpFtba40Zjlp1vQUrsHG5QjSVgfZRZO/+Mg5NVfOQfnI\n\tERRUM7b0AV2t+PvDb/PwBYBpw93/MdxzzYPVuozpiKRThtWFWjxC6UlEfhaiU9EVvD\n\tjfgtSRHjvTjaw==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1664246266;\n\tbh=MVOLInGX5yVAIA9XLQDFWLFjXKy+lGpTeefmyExcEhw=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=l9yeaTN2xVfcGM/cxv+qjmuCEceMMHoffo2LoQLPeX/CeQgpwQ7r2r2521WKUADXa\n\tQwU2elsBw+PXFKag2S95yC2UuQ6nPNnlIIRAFqCiI1ShrlciYVge4ug3eUM0aLM1gf\n\taohVbK+GRJ7L8wC7rvO4388wtm6kSeCKZhe7cnhk="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"l9yeaTN2\"; dkim-atps=neutral",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue, 27 Sep 2022 05:36:39 +0300",
        "Message-Id": "<20220927023642.12341-31-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.35.1",
        "In-Reply-To": "<20220927023642.12341-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20220927023642.12341-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v5 30/33] ipa: rkisp1: awb: Prevent RGB\n\tmeans from being negative",
        "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>",
        "From": "Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Due to hardware rounding errors in the YCbCr means, the calculated RGB\nmeans may be negative. This would lead to negative gains, messing up\ncalculation. Prevent this by clamping the means to positive values.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/ipa/rkisp1/algorithms/awb.cpp | 10 ++++++++++\n 1 file changed, 10 insertions(+)",
    "diff": "diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp\nindex 139c8239504f..59664d09b84c 100644\n--- a/src/ipa/rkisp1/algorithms/awb.cpp\n+++ b/src/ipa/rkisp1/algorithms/awb.cpp\n@@ -242,6 +242,16 @@ void Awb::process(IPAContext &context,\n \t\tredMean = 1.1636 * yMean - 0.0623 * cbMean + 1.6008 * crMean;\n \t\tgreenMean = 1.1636 * yMean - 0.4045 * cbMean - 0.7949 * crMean;\n \t\tblueMean = 1.1636 * yMean + 1.9912 * cbMean - 0.0250 * crMean;\n+\n+\t\t/*\n+\t\t * Due to hardware rounding errors in the YCbCr means, the\n+\t\t * calculated RGB means may be negative. This would lead to\n+\t\t * negative gains, messing up calculation. Prevent this by\n+\t\t * clamping the means to positive values.\n+\t\t */\n+\t\tredMean = std::max(redMean, 0.0);\n+\t\tgreenMean = std::max(greenMean, 0.0);\n+\t\tblueMean = std::max(blueMean, 0.0);\n \t}\n \n \t/*\n",
    "prefixes": [
        "libcamera-devel",
        "v5",
        "30/33"
    ]
}