[{"id":39705,"web_url":"https://patchwork.libcamera.org/comment/39705/","msgid":"<e099c1fc-4e51-4e9b-8483-3d74ca489d95@nxsw.ie>","date":"2026-07-15T00:26:27","subject":"Re: [RFC PATCH v7 2/6] libcamera: software_isp: Add LSC data to\n\tDebayerParams","submitter":{"id":226,"url":"https://patchwork.libcamera.org/api/people/226/","name":"Bryan O'Donoghue","email":"bod.linux@nxsw.ie"},"content":"On 08/07/2026 21:18, Milan Zamazal wrote:\n> From: Xander Pronk <xander.c.pronk@gmail.com>\n> \n> Add a lookup table for grid-based lens shading correction to debayer\n> params.  The lookup table is in the format of an RGB texture to be\n> passed to debayering.\n> \n> The parameter is filled in by Lsc algorithm implemented in a followup\n\nLSC\n\nfollow-up\n\n> patch.  If the algorithm is not enabled, the parameter content is\n> arbitrary and the parameter may not be used.  The parameter is currently\n> unused, its handling is implemented in a followup patch.\n> \n> There is no special meaning about the selected grid size, it's\n> just one of the smaller common sizes.\n> \n> Co-developed-by: Rick ten Wolde <rick_libcamera@wolde.info>\n> Signed-off-by: Rick ten Wolde <rick_libcamera@wolde.info>\n> Signed-off-by: Xander Pronk <xander.c.pronk@gmail.com>\n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> ---\n>   .../internal/software_isp/debayer_params.h    |  9 +++++\n>   src/libcamera/software_isp/debayer.cpp        | 33 +++++++++++++++++++\n>   2 files changed, 42 insertions(+)\n> \n> diff --git a/include/libcamera/internal/software_isp/debayer_params.h b/include/libcamera/internal/software_isp/debayer_params.h\n> index 1074720d7..4eb6c7e8d 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,14 @@ struct DebayerParams {\n>   \tfloat gamma = 1.0;\n>   \tfloat contrastExp = 1.0;\n>   \tRGB<double> gains = RGB<double>({ 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\nIs there really a use-case for having LscvalueType at all - we will \npretty much be float forever right ?\n\nOtherwise seems reasonable to me.","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 D7A13C32CE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 15 Jul 2026 00:26:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4E87C66155;\n\tWed, 15 Jul 2026 02:26:34 +0200 (CEST)","from tor.source.kernel.org (tor.source.kernel.org\n\t[IPv6:2600:3c04:e001:324:0:1991:8:25])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 23CE766152\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 15 Jul 2026 02:26:33 +0200 (CEST)","from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])\n\tby tor.source.kernel.org (Postfix) with ESMTP id 9B058600BB;\n\tWed, 15 Jul 2026 00:26:31 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id DA9BE1F000E9;\n\tWed, 15 Jul 2026 00:26:29 +0000 (UTC)"],"Message-ID":"<e099c1fc-4e51-4e9b-8483-3d74ca489d95@nxsw.ie>","Date":"Wed, 15 Jul 2026 01:26:27 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [RFC PATCH v7 2/6] libcamera: software_isp: Add LSC data to\n\tDebayerParams","To":"Milan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","Cc":"Xander Pronk <xander.c.pronk@gmail.com>,\n\tHans de Goede <johannes.goede@oss.qualcomm.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tRick ten Wolde <rick_libcamera@wolde.info>","References":"<20260708201816.299983-1-mzamazal@redhat.com>\n\t<j5qXxGwctFIhGQHmeAym6dTT95Jn9Whm54-0_176UcKv60179iZ-Orj3eIHg3nAMXXfoMhVp5rTbxmT9V_Z9Vg==@protonmail.internalid>\n\t<20260708201816.299983-3-mzamazal@redhat.com>","From":"Bryan O'Donoghue <bod.linux@nxsw.ie>","Content-Language":"en-GB","In-Reply-To":"<20260708201816.299983-3-mzamazal@redhat.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","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>"}},{"id":39710,"web_url":"https://patchwork.libcamera.org/comment/39710/","msgid":"<85zezsn0r3.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2026-07-15T07:57:36","subject":"Re: [RFC PATCH v7 2/6] libcamera: software_isp: Add LSC data to\n\tDebayerParams","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Bryan O'Donoghue <bod.linux@nxsw.ie> writes:\n\n> On 08/07/2026 21:18, Milan Zamazal wrote:\n>> From: Xander Pronk <xander.c.pronk@gmail.com>\n>> Add a lookup table for grid-based lens shading correction to debayer\n>\n>> params.  The lookup table is in the format of an RGB texture to be\n>> passed to debayering.\n>> The parameter is filled in by Lsc algorithm implemented in a followup\n>\n> LSC\n\nLSC = Lens Shading Correction\nLsc = the name of the LSC algorithm in `simple' pipeline\n\n> follow-up\n\nack\n\n>> patch.  If the algorithm is not enabled, the parameter content is\n>> arbitrary and the parameter may not be used.  The parameter is currently\n>> unused, its handling is implemented in a followup patch.\n>> There is no special meaning about the selected grid size, it's\n>> just one of the smaller common sizes.\n>> Co-developed-by: Rick ten Wolde <rick_libcamera@wolde.info>\n>> Signed-off-by: Rick ten Wolde <rick_libcamera@wolde.info>\n>> Signed-off-by: Xander Pronk <xander.c.pronk@gmail.com>\n>> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n>> ---\n>>   .../internal/software_isp/debayer_params.h    |  9 +++++\n>>   src/libcamera/software_isp/debayer.cpp        | 33 +++++++++++++++++++\n>>   2 files changed, 42 insertions(+)\n>> diff --git a/include/libcamera/internal/software_isp/debayer_params.h\n>> b/include/libcamera/internal/software_isp/debayer_params.h\n>> index 1074720d7..4eb6c7e8d 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>>   #pragma once\n>> +#include <array>\n>>   #include <stdint.h>\n>>   #include \"libcamera/internal/matrix.h\"\n>> @@ -25,6 +26,14 @@ struct DebayerParams {\n>>   \tfloat gamma = 1.0;\n>>   \tfloat contrastExp = 1.0;\n>>   \tRGB<double> gains = RGB<double>({ 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>\n> Is there really a use-case for having LscvalueType at all\n\nSince it is used only in two locations close to each other, it's not\nworth it, I'll remove it.\n\n> - we will pretty much be float forever right ?\n\nWould you like to take a bet? :-)\n\n> Otherwise seems reasonable to me.","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 3092DC3304\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 15 Jul 2026 07:57:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6334066168;\n\tWed, 15 Jul 2026 09:57:44 +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 9E2E866157\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 15 Jul 2026 09:57:42 +0200 (CEST)","from mail-wm1-f69.google.com (mail-wm1-f69.google.com\n\t[209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-94-0fdA5nXIMh2A-u0oYwkhAg-1; Wed, 15 Jul 2026 03:57:40 -0400","by mail-wm1-f69.google.com with SMTP id\n\t5b1f17b1804b1-493bdaf8549so49024745e9.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 15 Jul 2026 00:57:39 -0700 (PDT)","from mzamazal-thinkpadp1gen7.tpbc.csb\n\t(ip-77-48-47-4.net.vodafone.cz. [77.48.47.4])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-4950a2f951asm140112835e9.14.2026.07.15.00.57.37\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 15 Jul 2026 00:57:37 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"LMvyhMF8\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1784102261;\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\tin-reply-to:in-reply-to:references:references;\n\tbh=T2yEqb+mo5SzviEFpc9p49sO4NtIWJGzIGT45g94quw=;\n\tb=LMvyhMF889AdTN+kTtdd75BeclcX2ggOYDMKKzhBbooaHxr9jZ2UdRXlx4ayY+e2rm8Xsy\n\tqWVEZCslEOcWi/K2iqEuZ8yIfReTPBlFq+GZIutEHLjdavkd1/2cKKR7e1jEJZujPRcQIV\n\tgIyEykmUXGuONttd7Mcr1E1TwRFr1vk=","X-MC-Unique":"0fdA5nXIMh2A-u0oYwkhAg-1","X-Mimecast-MFC-AGG-ID":"0fdA5nXIMh2A-u0oYwkhAg_1784102259","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20251104; t=1784102259; x=1784707059;\n\th=content-type:mime-version:user-agent:message-id:date:references\n\t:in-reply-to:subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to\n\t:cc:subject:date:message-id:reply-to:content-type;\n\tbh=T2yEqb+mo5SzviEFpc9p49sO4NtIWJGzIGT45g94quw=;\n\tb=Gh7I/JB4fJQCphjd/wJKqlqYs5Kr1Zt7fkz0EeFUO8ELpJ128/FTHE7FaAEjyD9cye\n\t6guvuzPDZJQ9rObD9voFKkY6J1nWXBaDVC+7uqH8SbTCsqTdPSwYXVr/Wp+VeCgaqKZp\n\twOuBfatwOdmek+dyfQoaysxfskWl//Hqh7+OF35YoNDDbIwsgTEpoZl/DulqABw2XSD9\n\tPXq4jN4geuH4X0Vgcnugqmrj5xcu/2t0mSRNhKsgL3+ZcpxC8+dzlmwx70RmutVrSprq\n\tq4WyQ+bIwqcLL8c5Kf/A/yUX3KAUt+L6U6HB7MfgJayY617ZpCH1gaOtGyjMG5eoOL6a\n\tORNw==","X-Gm-Message-State":"AOJu0YxqPspZFP1FDBNYSnoINydDYoNB4SuR19sPjhzvgRHuVZURfUEn\n\tLgdtrcKquL+nW8HoleVl+KCfICDuq1EcFQyvyhfR01F3JaTpZvYAY9eEqMNjUVXetBnz8cfna9m\n\tiNRWqAZLaFThHuQqHgVIcLmrqg/me4700LrW2GkuMwSi43gcu3VrBnaplPB0dFYrEGkJ7X+neB7\n\twOR1eHBcY=","X-Gm-Gg":"AfdE7ckBQRwYUmQfbZQGb1ODPtyY+BagxF4MkLTNnuXlfqRfEKHvtG0+N98s02o2FwW\n\t8mcPf6oubl9knXYk0t030HQ0OkbgzDySdZLdIcfmUlqqp5zBHsOePCeLgV6cLgNb2g6uHA2AdVK\n\t02n2/VSfa2KlA61gYy7EvYRkMzsz49DzEEL5SbEYslRHgoNw0r4zOcL7nqsHN4ua0D+JKP8wVSc\n\tOfC3meGd+c+SzXmUCzTQHmcuRxx2ExFhNbQwL42kVnuAae/ETAsysfjg4RL2TC/lnLtJXqYAh9G\n\tleyI1s7ZhblLiRNYZST+4vm1FqfBSBm8cd9LQCl0Rrp0e6z+9YZbbei5xmG7s8UzcNgD4RUqOsC\n\tnuIXFtuNCIsUWVUe7wf4VCiliOXv+4/LRoPW6oM18verbP5NeycUEqk/oXP3nDrLb","X-Received":["by 2002:a05:600c:8117:b0:493:fa7d:56a0 with SMTP id\n\t5b1f17b1804b1-4953c15f693mr19843715e9.13.1784102258793; \n\tWed, 15 Jul 2026 00:57:38 -0700 (PDT)","by 2002:a05:600c:8117:b0:493:fa7d:56a0 with SMTP id\n\t5b1f17b1804b1-4953c15f693mr19843315e9.13.1784102258221; \n\tWed, 15 Jul 2026 00:57:38 -0700 (PDT)"],"From":"Milan Zamazal <mzamazal@redhat.com>","To":"Bryan O'Donoghue <bod.linux@nxsw.ie>","Cc":"libcamera-devel@lists.libcamera.org,  Xander Pronk\n\t<xander.c.pronk@gmail.com>,  Hans de Goede\n\t<johannes.goede@oss.qualcomm.com>,  Laurent Pinchart\n\t<laurent.pinchart@ideasonboard.com>,  Rick ten Wolde\n\t<rick_libcamera@wolde.info>","Subject":"Re: [RFC PATCH v7 2/6] libcamera: software_isp: Add LSC data to\n\tDebayerParams","In-Reply-To":"<e099c1fc-4e51-4e9b-8483-3d74ca489d95@nxsw.ie> (Bryan\n\tO'Donoghue's message of \"Wed, 15 Jul 2026 01:26:27 +0100\")","References":"<20260708201816.299983-1-mzamazal@redhat.com>\n\t<j5qXxGwctFIhGQHmeAym6dTT95Jn9Whm54-0_176UcKv60179iZ-Orj3eIHg3nAMXXfoMhVp5rTbxmT9V_Z9Vg==@protonmail.internalid>\n\t<20260708201816.299983-3-mzamazal@redhat.com>\n\t<e099c1fc-4e51-4e9b-8483-3d74ca489d95@nxsw.ie>","Date":"Wed, 15 Jul 2026 09:57:36 +0200","Message-ID":"<85zezsn0r3.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"Hto4sAfxL5DhTfkAOXY0Y7ANzG32YeUy04dOyEEI1cg_1784102259","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain","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>"}}]