[{"id":37938,"web_url":"https://patchwork.libcamera.org/comment/37938/","msgid":"<5d6d9629-fb5b-4c65-88c7-32fb6aa12f1b@ideasonboard.com>","date":"2026-01-26T11:30:31","subject":"Re: [PATCH 2/7] libcamera: software_isp: Add LSC data to\n\tDebayerParams","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"Hi\n\n2026. 01. 26. 11:42 keltezéssel, Rick ten Wolde írta:\n> From: Xander Pronk <xander.c.pronk@gmail.com>\n> \n> Add separate red, green and blue LSC tables to struct DebayerParams.\n> \n> Co-authored-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> ---\n>   .../internal/software_isp/debayer_params.h     |  6 ++++++\n>   src/libcamera/software_isp/debayer.cpp         | 18 ++++++++++++++++++\n>   2 files changed, 24 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 256c7d43..4252cd2d 100644\n> --- a/include/libcamera/internal/software_isp/debayer_params.h\n> +++ b/include/libcamera/internal/software_isp/debayer_params.h\n> @@ -30,6 +30,8 @@ struct DebayerParams {\n>   \tusing LookupTable = std::array<uint8_t, kRGBLookupSize>;\n>   \tusing CcmLookupTable = std::array<CcmColumn, kRGBLookupSize>;\n>   \n> +\tusing LscLookupTable = uint8_t[16*16];\n\n   std::array<uint8_t, 16 * 16>\n\nor is there a reason for normal arrays?\n\nIt probably also makes sense to give a name to 16 like it is done\nfor `kRGBLookupSize`, and use that named constant everywhere else.\n\n\n> +\n>   \t/*\n>   \t * Color lookup tables when CCM is not used.\n>   \t *\n> @@ -53,6 +55,10 @@ struct DebayerParams {\n>   \tCcmLookupTable blueCcm;\n>   \tLookupTable gammaLut;\n>   \n> +\tLscLookupTable LSC_red;\n> +\tLscLookupTable LSC_green;\n> +\tLscLookupTable LSC_blue;\n\nPlease either follow the existing naming pattern: lscRed, lscGreen, lscBlue.\n\n\nRegards,\nBarnabás Pőcze\n\n> +\n>   \t/*\n>   \t * Per frame corrections as calculated by the IPA\n>   \t */\n> diff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp\n> index 65a1762d..7a8b3462 100644\n> --- a/src/libcamera/software_isp/debayer.cpp\n> +++ b/src/libcamera/software_isp/debayer.cpp\n> @@ -65,6 +65,11 @@ namespace libcamera {\n>    * \\brief Type of the CCM lookup tables for red, green, blue values\n>    */\n>   \n> +/**\n> + * \\typedef DebayerParams::LscLookupTable\n> + * \\brief Type of the LSC lookup tables\n> + */\n> +\n>   /**\n>    * \\var DebayerParams::red\n>    * \\brief Lookup table for red color, mapping input values to output values\n> @@ -120,6 +125,19 @@ namespace libcamera {\n>    * \\brief Contrast value for GPUISP\n>    */\n>   \n> +/**\n> + * \\var DebayerParams::LSC_red\n> + * \\brief Per frame Lens shading correction red channel\n> + */\n> +/**\n> + * \\var DebayerParams::LSC_green\n> + * \\brief Per frame Lens shading correction red channel\n> + */\n> +/**\n> + * \\var DebayerParams::LSC_blue\n> + * \\brief Per frame Lens shading correction red channel\n> + */\n> +\n>   /**\n>    * \\class Debayer\n>    * \\brief Base debayering class","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 D08E3C3220\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 26 Jan 2026 11:30:33 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 85C2F61FCF;\n\tMon, 26 Jan 2026 12:30:33 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5170F61A35\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 26 Jan 2026 12:30:32 +0100 (CET)","from [192.168.33.36] (185.221.142.123.nat.pool.zt.hu\n\t[185.221.142.123])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 800E3161;\n\tMon, 26 Jan 2026 12:29:56 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"o73n1IhG\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1769426997;\n\tbh=Um23a94rRgQYrvNniTyLmMmCodBAYBaddNlJvx1neTA=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=o73n1IhG0XSFsjKpypzTbUx4lp/1wBpotHfoHrMZVWEYAyKWSC2rB5Us5FxI1zHab\n\tFMi5SMT/lDbmRKKZEx5ZVpMIQwTz/GkiwB+4s12MPsi7EzY3LFs8MtrZ4H+SEWxxn8\n\tAOzlO5f7DltoTvj4oso/rMXb+hkisnvyK+4ABO5s=","Message-ID":"<5d6d9629-fb5b-4c65-88c7-32fb6aa12f1b@ideasonboard.com>","Date":"Mon, 26 Jan 2026 12:30:31 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 2/7] libcamera: software_isp: Add LSC data to\n\tDebayerParams","To":"Rick ten Wolde <rick.w.ten.wolde@gmail.com>,\n\tlibcamera-devel@lists.libcamera.org","Cc":"xander.c.pronk@gmail.com, derekgielen@outlook.com,\n\t22012540@student.hhs.nl, johannes.goede@oss.qualcomm.com,\n\tRick ten Wolde <rick_libcamera@wolde.info>","References":"<20260126104256.119697-1-rick.w.ten.wolde@gmail.com>\n\t<20260126104256.119697-3-rick.w.ten.wolde@gmail.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20260126104256.119697-3-rick.w.ten.wolde@gmail.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","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>"}},{"id":38077,"web_url":"https://patchwork.libcamera.org/comment/38077/","msgid":"<c8ec7ecc-0de6-4e02-bff3-c3b5428edf7d@linaro.org>","date":"2026-02-04T15:08:50","subject":"Re: [PATCH 2/7] libcamera: software_isp: Add LSC data to\n\tDebayerParams","submitter":{"id":175,"url":"https://patchwork.libcamera.org/api/people/175/","name":"Bryan O'Donoghue","email":"bryan.odonoghue@linaro.org"},"content":"On 26/01/2026 10:42, Rick ten Wolde wrote:\n> From: Xander Pronk <xander.c.pronk@gmail.com>\n> \n> Add separate red, green and blue LSC tables to struct DebayerParams.\n> \n> Co-authored-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> ---\n>   .../internal/software_isp/debayer_params.h     |  6 ++++++\n>   src/libcamera/software_isp/debayer.cpp         | 18 ++++++++++++++++++\n>   2 files changed, 24 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 256c7d43..4252cd2d 100644\n> --- a/include/libcamera/internal/software_isp/debayer_params.h\n> +++ b/include/libcamera/internal/software_isp/debayer_params.h\n> @@ -30,6 +30,8 @@ struct DebayerParams {\n>   \tusing LookupTable = std::array<uint8_t, kRGBLookupSize>;\n>   \tusing CcmLookupTable = std::array<CcmColumn, kRGBLookupSize>;\n> \n> +\tusing LscLookupTable = uint8_t[16*16];\n> +\n\nIf the idea is to have an array of 256 entries then either\n\nunit8_t[256] or unit8_t[16][16]\n\nif the 16x16 has some meaning.\n\nAlso I think the number of elements should be based on a define so that \nwe can move the number of elements up/down as necessary.\n\n>   \t/*\n>   \t * Color lookup tables when CCM is not used.\n>   \t *\n> @@ -53,6 +55,10 @@ struct DebayerParams {\n>   \tCcmLookupTable blueCcm;\n>   \tLookupTable gammaLut;\n> \n> +\tLscLookupTable LSC_red;\n> +\tLscLookupTable LSC_green;\n> +\tLscLookupTable LSC_blue;\n> +\n>   \t/*\n>   \t * Per frame corrections as calculated by the IPA\n>   \t */\n> diff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp\n> index 65a1762d..7a8b3462 100644\n> --- a/src/libcamera/software_isp/debayer.cpp\n> +++ b/src/libcamera/software_isp/debayer.cpp\n> @@ -65,6 +65,11 @@ namespace libcamera {\n>    * \\brief Type of the CCM lookup tables for red, green, blue values\n>    */\n> \n> +/**\n> + * \\typedef DebayerParams::LscLookupTable\n> + * \\brief Type of the LSC lookup tables\n> + */\n> +\n>   /**\n>    * \\var DebayerParams::red\n>    * \\brief Lookup table for red color, mapping input values to output values\n> @@ -120,6 +125,19 @@ namespace libcamera {\n>    * \\brief Contrast value for GPUISP\n>    */\n> \n> +/**\n> + * \\var DebayerParams::LSC_red\n> + * \\brief Per frame Lens shading correction red channel\n> + */\n> +/**\n> + * \\var DebayerParams::LSC_green\n> + * \\brief Per frame Lens shading correction red channel\n> + */\n> +/**\n> + * \\var DebayerParams::LSC_blue\n> + * \\brief Per frame Lens shading correction red channel\n> + */\n> +\n>   /**\n>    * \\class Debayer\n>    * \\brief Base debayering class\n> --\n> 2.51.0\n>","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 AF937BD78E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  4 Feb 2026 15:08:55 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D557A6203F;\n\tWed,  4 Feb 2026 16:08:54 +0100 (CET)","from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com\n\t[IPv6:2a00:1450:4864:20::32e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A6BEB61FBF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  4 Feb 2026 16:08:53 +0100 (CET)","by mail-wm1-x32e.google.com with SMTP id\n\t5b1f17b1804b1-47ee07570deso59341975e9.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 04 Feb 2026 07:08:53 -0800 (PST)","from [192.168.0.40] (188-141-3-146.dynamic.upc.ie. [188.141.3.146])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-4830ec18706sm40029615e9.0.2026.02.04.07.08.51\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tWed, 04 Feb 2026 07:08:52 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"OROK5yn6\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linaro.org; s=google; t=1770217733; x=1770822533;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:in-reply-to:content-language:from\n\t:references:cc:to:subject:user-agent:mime-version:date:message-id\n\t:from:to:cc:subject:date:message-id:reply-to;\n\tbh=H8P2jEH+uFKsY3a/tLXD/w0yvm3h93L1QsvXshgRwsI=;\n\tb=OROK5yn68u4HLf9zbvGbgX1xduRUZK5/RBTaFvlB0s7Cabt6HOUnqE8TLoO0VJQ21Y\n\tO5ha+CqWUUI9DgA/Gsc8QW4yfboEk7VUdJ8gcc7qgL3Z8EkSi7FvVwzmcxKB85X0dY+T\n\tCsPRrsZ98kVSMwqpfCffbpvWGB9ErHhT7zsZhDg4TyM4wAB7/SczzzptSlRrrKmwdC2b\n\t/FkrfhCkdgi3Rs/SwVv1zQQV7+QqIfaFo3WRdx1PkuDcExc6Jqm54BI1VRD6/uCU4EQo\n\tVTNPblakKBDN5FQvOD1hdLYfwJ4iH+si6y6olRLNJzRaw+gijqn14ckkD2k73Avc55Sh\n\tjZgQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1770217733; x=1770822533;\n\th=content-transfer-encoding:in-reply-to:content-language:from\n\t:references:cc:to:subject:user-agent:mime-version:date:message-id\n\t:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=H8P2jEH+uFKsY3a/tLXD/w0yvm3h93L1QsvXshgRwsI=;\n\tb=Ot3PIRPZLOM29N8TUp2M32/B5LGcrzNgCbfsyfFfxpQnAMaac+7afpGu38lsNwqlAR\n\tpXkY6tN1dsUgeVcc0pZBssuR/eADJTo38ZxLlJZ9k2673a8P2qeiiYh/ytdsliM6gabs\n\tmTOcecIduLg+MyK6Letc+qlWwOSpmWXCobkJwvHUW+Ni+Qofk3YK9W238+Rjk9cX2kI3\n\t/ArBbieYCw81HhsXf7u7JcG8W8CEdv+UxXDsubcns02IyIjk7jMFM+xkQrfyOvDfy9n9\n\t0OyxXXmoQz8CFcGJpUxIKUSgTX9/A9tWyKLUOroq8oEmuD6aXmFI6Ks8zINn3Ze9c5iz\n\th3yQ==","X-Forwarded-Encrypted":"i=1;\n\tAJvYcCWAeee5G7twDDxg7bI+GeTj3JvhZf3baPf+7xTceor7sMFaXLeEIBHg1foqdZ4Xp+z9E+P6hVXLp37ZDRCjTGk=@lists.libcamera.org","X-Gm-Message-State":"AOJu0YxscNWTx8hgFtztOE3Ux9HIGqAEynMNHFf9vtq48HgoPHgNrCbY\n\thnbWWHBV0NQQQMbf3xH0vWpO+WS6fVqme3Q1yek8aZrbg95rShv5V3dE1qvJoOn9bmM=","X-Gm-Gg":"AZuq6aJs/hZ1iKi6o/J2sg6m+ZW87xngjolm5sFUAu/UajJcl2Etd8We4Od/vZjhTE3\n\tzdHV9gtMriJqzs2xZfw06AMsbDlr0VqaGrlKI8zW2JATwmFS6+MNitU2SIF0ahwAEjsWwFvg9zc\n\tkIJhD0j/RzDNsPG5LLkJEIi34BKn5/x1dwbcGmPvrtzCmV1iqFr8k2Q5Z/sHLLr7bpuTZkMw3+y\n\tToB7TnWQUQeE0ZzlrKqMHljWydqTUcWCnvPY/b3jAqkyGkj0E2DuUhgf0SCVs1Dsmsyn1a6Pv0L\n\tUSyxn97xM9+aNE/ABmDOjAw9uTTJpI19T5vSbWGbbSZtUITy+vyy8Jk04qpcnMrkYorf/dYXVTc\n\tHkqmM6VwYryIHVCosVWE6f26bplr2bMGn2MI+9IMLeiChmKP5WQ6lub7E3/GGTypPwJlNhL5lWx\n\taUulhy75SnvKol2d32GvvXG7Srjwvz4lKqugt+szz34kNLGBlsAd2a","X-Received":"by 2002:a05:600c:820a:b0:46e:4586:57e4 with SMTP id\n\t5b1f17b1804b1-4830e987d12mr49796405e9.24.1770217733056; \n\tWed, 04 Feb 2026 07:08:53 -0800 (PST)","Message-ID":"<c8ec7ecc-0de6-4e02-bff3-c3b5428edf7d@linaro.org>","Date":"Wed, 4 Feb 2026 15:08:50 +0000","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 2/7] libcamera: software_isp: Add LSC data to\n\tDebayerParams","To":"Rick ten Wolde <rick.w.ten.wolde@gmail.com>,\n\tlibcamera-devel@lists.libcamera.org","Cc":"xander.c.pronk@gmail.com, derekgielen@outlook.com,\n\t22012540@student.hhs.nl, johannes.goede@oss.qualcomm.com,\n\tRick ten Wolde <rick_libcamera@wolde.info>","References":"<20260126104256.119697-1-rick.w.ten.wolde@gmail.com>\n\t<L0KaTycbYhThO51knS31A9kdYvkx6knVw5pJ0NbzLqjYWs7lDlD7dMyr1CP3CkTgwpgSndoO8iLmiCqWokE4IA==@protonmail.internalid>\n\t<20260126104256.119697-3-rick.w.ten.wolde@gmail.com>","From":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>","Content-Language":"en-US","In-Reply-To":"<20260126104256.119697-3-rick.w.ten.wolde@gmail.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>"}}]