Show a patch.

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

{
    "id": 24487,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/24487/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/24487/",
    "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": "<20250929131355.25897-1-hansg@kernel.org>",
    "date": "2025-09-29T13:13:55",
    "name": "ipa: simple: blc: Use 16 as starting blacklevel when there is no sensor-info",
    "commit_ref": "07b87b8095330fd3c559e68307c4bcc166e0f7ad",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "b277fd7832371e82b776017b5e94b20f7aceac69",
    "submitter": {
        "id": 239,
        "url": "https://patchwork.libcamera.org/api/1.1/people/239/?format=api",
        "name": "Hans de Goede",
        "email": "hansg@kernel.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/24487/mbox/",
    "series": [
        {
            "id": 5465,
            "url": "https://patchwork.libcamera.org/api/1.1/series/5465/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5465",
            "date": "2025-09-29T13:13:55",
            "name": "ipa: simple: blc: Use 16 as starting blacklevel when there is no sensor-info",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/5465/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/24487/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/24487/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 229DFC328C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 29 Sep 2025 13:14:03 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DF0496B5F3;\n\tMon, 29 Sep 2025 15:14:01 +0200 (CEST)",
            "from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A0CFC6B599\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Sep 2025 15:13:59 +0200 (CEST)",
            "from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n\tby tor.source.kernel.org (Postfix) with ESMTP id A9A146220A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Sep 2025 13:13:58 +0000 (UTC)",
            "by smtp.kernel.org (Postfix) with ESMTPSA id 7B666C4CEF4;\n\tMon, 29 Sep 2025 13:13:57 +0000 (UTC)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=kernel.org header.i=@kernel.org\n\theader.b=\"Hwf1/LjD\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1759151638;\n\tbh=T5nt2Y3bCWrMnpkOPcFkdrdM2njfw/CGpuAGXcpoxYs=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=Hwf1/LjDzDNC/6qofd1vdPhwSTceueOudy7z86/pDCAynFzq/oB92WhRfVgcvgaHE\n\tBUwTFj25xbzN/f3RNyJRxa5kYwLo30cgl1up7TiW45v1HkPJUk1VsdmgCEXbcUm+IH\n\tkRcGHqlI7tLoHW9uq1wWUVIUWS2XjXsektTF+4wF/+4b9QvzrsaCe7vnMm+ngv3yjz\n\toE/emSPVlx/OgGyMrQomZ1nD8qXzdzRZOX9GzKnL1+F8f2pnUIjaF8KDx88awaaBiT\n\tP13DAQnWp6o1VXwxv8ky+zzNQXwcGU1pvdUVc7BPTLCf3IHQ2wdpo7jzjehzt+J8I0\n\toGCaYPQYOE1sQ==",
        "From": "Hans de Goede <hansg@kernel.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Hans de Goede <hansg@kernel.org>",
        "Subject": "[PATCH] ipa: simple: blc: Use 16 as starting blacklevel when there\n\tis no sensor-info",
        "Date": "Mon, 29 Sep 2025 15:13:55 +0200",
        "Message-ID": "<20250929131355.25897-1-hansg@kernel.org>",
        "X-Mailer": "git-send-email 2.51.0",
        "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": "At the moment the blc code uses 255 as starting blacklevel for sensors\nwhere there is no blacklevel info in the sensor-helper.\n\nThere are a number of issues with this:\n\n1. When the first frame is bad (e.g. mostly white) which happens sometimes\nthe initial blacklevel will be kept leading to a divide by zero problem\nin the AGC code (this divide by 0 problem is avoided in the AGC code by\nnot running the AGC algorithm).\n\n2. Not runnning the AGC algorithm means that the gain/exposure do not\nchange, which causes the BLC algorithm to not run on the next frames,\nso we keep the bad 255 blacklevel which stops AGC from running which\nstops BLC from running. Leaving things stuck at a 255 blacklevel\nresulting in an unusuable image.\n\n3. Sometimes the auto-blc code leads to an unrealistic high\nblacklevel detection which results in lower image quality.\n\nTo fix this start with a blacklevel of 16, which is the highest\n(4096 / 256) blacklevel used for any sensor listing a blackLevel_\nvalue in the sensor-helper class.\n\nNote 2. could alternatively be fixed by disabling the check for\nexposure/gain changes when the blacklevel is unrealistic high,\nbut that still leaves the other problems.\n\nSigned-off-by: Hans de Goede <hansg@kernel.org>\n---\n src/ipa/simple/algorithms/blc.cpp | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)",
    "diff": "diff --git a/src/ipa/simple/algorithms/blc.cpp b/src/ipa/simple/algorithms/blc.cpp\nindex ec71e154e..370385afc 100644\n--- a/src/ipa/simple/algorithms/blc.cpp\n+++ b/src/ipa/simple/algorithms/blc.cpp\n@@ -43,7 +43,7 @@ int BlackLevel::configure(IPAContext &context,\n \tif (definedLevel_.has_value())\n \t\tcontext.configuration.black.level = definedLevel_;\n \tcontext.activeState.blc.level =\n-\t\tcontext.configuration.black.level.value_or(255);\n+\t\tcontext.configuration.black.level.value_or(16);\n \treturn 0;\n }\n \n",
    "prefixes": []
}