{"id":26725,"url":"https://patchwork.libcamera.org/api/patches/26725/?format=json","web_url":"https://patchwork.libcamera.org/patch/26725/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260512123619.120068-3-mzamazal@redhat.com>","date":"2026-05-12T12:36:06","name":"[RFC,v5,02/10] libcamera: software_isp: Add LSC data to DebayerParams","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"d1e9eaa4d015717b5a7cfcec81bc55c7975b1944","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/?format=json","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/26725/mbox/","series":[{"id":5936,"url":"https://patchwork.libcamera.org/api/series/5936/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5936","date":"2026-05-12T12:36:04","name":"LSC for SoftISP simple pipeline","version":5,"mbox":"https://patchwork.libcamera.org/series/5936/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/26725/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/26725/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 DF9A2BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 12 May 2026 12:36:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7C5756302D;\n\tTue, 12 May 2026 14:36:45 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8CFF363020\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 12 May 2026 14:36:43 +0200 (CEST)","from mx-prod-mc-08.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-303-FPWBD2WTPMC9sJGoJWShTA-1;\n\tTue, 12 May 2026 08:36:39 -0400","from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com\n\t(mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com\n\t[10.30.177.17])\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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTPS id 4C39C18002C9; Tue, 12 May 2026 12:36:37 +0000 (UTC)","from mzamazal-thinkpadp1gen7.tpbc.com (unknown [10.44.50.44])\n\tby mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTP id 585371955D84; Tue, 12 May 2026 12:36:33 +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=\"fSoHCKw6\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1778589402;\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=GMpTRJkAeYb5u4p7zVG3zTLovAUt5iXhXpZDwDhZzFI=;\n\tb=fSoHCKw6KvhHRie1UYmqlAcJcH+1ZDktZ7FEuFEEonU8RLHhfzChrizTazmeI7T0c2tAI4\n\tqwlrw0qEhSfVOt3yLFrXzwkLqzNttCJVeREY8w1Ku3HgANGfwE/zbTGQOtkru92ZEt4kl7\n\tDz/MqFpW5EplXbe6uJvoJH+8LnpspPs=","X-MC-Unique":"FPWBD2WTPMC9sJGoJWShTA-1","X-Mimecast-MFC-AGG-ID":"FPWBD2WTPMC9sJGoJWShTA_1778589397","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\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tRick ten Wolde <rick_libcamera@wolde.info>,\n\tMilan Zamazal <mzamazal@redhat.com>","Subject":"[RFC PATCH v5 02/10] libcamera: software_isp: Add LSC data to\n\tDebayerParams","Date":"Tue, 12 May 2026 14:36:06 +0200","Message-ID":"<20260512123619.120068-3-mzamazal@redhat.com>","In-Reply-To":"<20260512123619.120068-1-mzamazal@redhat.com>","References":"<20260512123619.120068-1-mzamazal@redhat.com>","MIME-Version":"1.0","X-Scanned-By":"MIMEDefang 3.0 on 10.30.177.17","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"lRNMhBgEvZgpthpD5te7WhQcNaZoZYVP2NKSZRIl5f0_1778589397","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    |  8 ++++++\n src/libcamera/software_isp/debayer.cpp        | 28 +++++++++++++++++++\n 2 files changed, 36 insertions(+)","diff":"diff --git a/include/libcamera/internal/software_isp/debayer_params.h b/include/libcamera/internal/software_isp/debayer_params.h\nindex 6772b43bc..47f2c3ac2 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,13 @@ 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 kLscGridSize = 16;\n+\tstatic constexpr unsigned int kLscValuesPerCell = 3;\n+\tusing LscValueType = float;\n+\tusing LscLookupTable =\n+\t\tstd::array<LscValueType, kLscGridSize * kLscGridSize * kLscValuesPerCell>;\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 2d7abfb83..d91a7aff5 100644\n--- a/src/libcamera/software_isp/debayer.cpp\n+++ b/src/libcamera/software_isp/debayer.cpp\n@@ -43,6 +43,34 @@ namespace libcamera {\n  * \\brief Contrast value to be used as an exponent\n  */\n \n+/**\n+ * \\var DebayerParams::kLscGridSize\n+ * \\brief Number of lens shading grid areas in one direction\n+ */\n+\n+/**\n+ * \\var DebayerParams::kLscValuesPerCell\n+ * \\brief Number of pixel values per each of the lens shading grid areas\n+ */\n+\n+/**\n+ * \\typedef DebayerParams::LscValueType\n+ * \\brief Type of LSC grid values\n+ */\n+\n+/**\n+ * \\typedef DebayerParams::LscLookupTable\n+ * \\brief Lookup table for lens shading correction\n+ *\n+ * It's an array of values to be later used as a texture.\n+ * The values 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","v5","02/10"]}