Patch Detail
Show a patch.
GET /api/patches/26563/?format=api
{ "id": 26563, "url": "https://patchwork.libcamera.org/api/patches/26563/?format=api", "web_url": "https://patchwork.libcamera.org/patch/26563/", "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": "<20260424200255.356798-3-mzamazal@redhat.com>", "date": "2026-04-24T20:02:48", "name": "[RFC,v3,2/7] libcamera: software_isp: Add LSC data to DebayerParams", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "958976c73932e3769a7d6246163c62eddb23d39e", "submitter": { "id": 177, "url": "https://patchwork.libcamera.org/api/people/177/?format=api", "name": "Milan Zamazal", "email": "mzamazal@redhat.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/26563/mbox/", "series": [ { "id": 5885, "url": "https://patchwork.libcamera.org/api/series/5885/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5885", "date": "2026-04-24T20:02:46", "name": "LSC for SoftISP simple pipeline", "version": 3, "mbox": "https://patchwork.libcamera.org/series/5885/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/26563/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/26563/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 474B8BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 24 Apr 2026 20:03:20 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E8DA762F8D;\n\tFri, 24 Apr 2026 22:03:19 +0200 (CEST)", "from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8857062E6A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Apr 2026 22:03:18 +0200 (CEST)", "from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com\n\t(ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97])\n\tby relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n\tcipher=TLS_AES_256_GCM_SHA384) id us-mta-10-YZ-yJ9wSN82KcFPWk0r1Bg-1;\n\tFri, 24 Apr 2026 16:03:13 -0400", "from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com\n\t(mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (2048 bits)\n\tserver-digest SHA256) (No client certificate requested)\n\tby mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTPS id 822A11800464; Fri, 24 Apr 2026 20:03:09 +0000 (UTC)", "from mzamazal-thinkpadp1gen7.tpbc.com (unknown [10.44.32.33])\n\tby mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTP id 0C72B300757B; Fri, 24 Apr 2026 20:03:06 +0000 (UTC)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"TPUi3eEm\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1777060997;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=2prc4hvAsVQbH4pizRKwsLdQcQZ1ajWkbALLlhlNAZw=;\n\tb=TPUi3eEmkxtG35wPcvwddutK2rVXbpnWJqMr2k+16EAvC4PDAWiN+EJv60HLbxsObvWiq9\n\t4IO+mrPKPF3Dg1vt8XtUoq0l4etw8JyadQ4ObH4eiWwc80WySGo5ZQWJl3NVoMySX25SOD\n\t5XhAKr3n9+lx4fyj3QiqHOVoChXHQe8=", "X-MC-Unique": "YZ-yJ9wSN82KcFPWk0r1Bg-1", "X-Mimecast-MFC-AGG-ID": "YZ-yJ9wSN82KcFPWk0r1Bg_1777060989", "From": "Milan Zamazal <mzamazal@redhat.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Xander Pronk <xander.c.pronk@gmail.com>,\n\tBryan O'Donoghue <bod.linux@nxsw.ie>,\n\tHans de Goede <johannes.goede@oss.qualcomm.com>,\n\tRick ten Wolde <rick_libcamera@wolde.info>,\n\tMilan Zamazal <mzamazal@redhat.com>", "Subject": "[RFC PATCH v3 2/7] libcamera: software_isp: Add LSC data to\n\tDebayerParams", "Date": "Fri, 24 Apr 2026 22:02:48 +0200", "Message-ID": "<20260424200255.356798-3-mzamazal@redhat.com>", "In-Reply-To": "<20260424200255.356798-1-mzamazal@redhat.com>", "References": "<20260424200255.356798-1-mzamazal@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 3.4.1 on 10.30.177.4", "X-Mimecast-Spam-Score": "0", "X-Mimecast-MFC-PROC-ID": "A4LjXtGcCLvamijl79v2IjZT9Wv6buY3_AFKQi1lXvA_1777060989", "X-Mimecast-Originator": "redhat.com", "Content-Transfer-Encoding": "8bit", "content-type": "text/plain; charset=\"US-ASCII\"; x-default=true", "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": "From: Xander Pronk <xander.c.pronk@gmail.com>\n\nAdd a lookup table for grid-based lens shading correction to debayer\nparams. The lookup table is in the format of an RGB texture to be\npassed to debayering.\n\nThe parameter is filled in by LSC algorithm implemented in a followup\npatch. If the algorithm is not enabled, the parameter content is\narbitrary and the parameter may not be used. The parameter is currently\nunused, its handling is implemented in a followup patch.\n\nThere is no special meaning about the selected grid size, it's\njust one of the smaller common sizes.\n\nCo-developed-by: Rick ten Wolde <rick_libcamera@wolde.info>\nSigned-off-by: Rick ten Wolde <rick_libcamera@wolde.info>\nSigned-off-by: Xander Pronk <xander.c.pronk@gmail.com>\nSigned-off-by: Milan Zamazal <mzamazal@redhat.com>\n---\n .../internal/software_isp/debayer_params.h | 7 ++++++\n src/libcamera/software_isp/debayer.cpp | 23 +++++++++++++++++++\n 2 files changed, 30 insertions(+)", "diff": "diff --git a/include/libcamera/internal/software_isp/debayer_params.h b/include/libcamera/internal/software_isp/debayer_params.h\nindex 6772b43bc..e98eef044 100644\n--- a/include/libcamera/internal/software_isp/debayer_params.h\n+++ b/include/libcamera/internal/software_isp/debayer_params.h\n@@ -10,6 +10,7 @@\n \n #pragma once\n \n+#include <array>\n #include <stdint.h>\n \n #include \"libcamera/internal/matrix.h\"\n@@ -25,6 +26,12 @@ struct DebayerParams {\n \tfloat gamma = 1.0;\n \tfloat contrastExp = 1.0;\n \tRGB<float> gains = RGB<float>({ 1.0, 1.0, 1.0 });\n+\n+\tstatic constexpr unsigned int kLscBytesPerCell = 3;\n+\tstatic constexpr unsigned int kLscGridSize = 16;\n+\tusing LscLookupTable =\n+\t\tstd::array<uint8_t, kLscGridSize * kLscGridSize * kLscBytesPerCell>;\n+\tLscLookupTable lscLut{};\n };\n \n } /* namespace libcamera */\ndiff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp\nindex a6bceb58b..3ad243685 100644\n--- a/src/libcamera/software_isp/debayer.cpp\n+++ b/src/libcamera/software_isp/debayer.cpp\n@@ -49,6 +49,29 @@ namespace libcamera {\n * \\brief Contrast value to be used as an exponent\n */\n \n+/**\n+ * \\var DebayerParams::kLscBytesPerCell\n+ * \\brief Number of bytes per each of the lens shading grid areas\n+ */\n+\n+/**\n+ * \\var DebayerParams::kLscGridSize\n+ * \\brief Number of lens shading grid areas in one direction\n+ */\n+\n+/**\n+ * \\typedef DebayerParams::LscLookupTable\n+ * \\brief Lookup table for lens shading correction\n+ *\n+ * It's an array of bytes to be later used as a texture.\n+ * The bytes are in row - column - RGB order.\n+ */\n+\n+/**\n+ * \\var DebayerParams::lscLut\n+ * \\brief Lens shading lookup table\n+ */\n+\n /**\n * \\class Debayer\n * \\brief Base debayering class\n", "prefixes": [ "RFC", "v3", "2/7" ] }