[2/7] libcamera: software_isp: Add LSC data to DebayerParams
diff mbox series

Message ID 20260126104256.119697-3-rick.w.ten.wolde@gmail.com
State New
Headers show
Series
  • LSC for SoftISP simple pipeline
Related show

Commit Message

Rick ten Wolde Jan. 26, 2026, 10:42 a.m. UTC
From: Xander Pronk <xander.c.pronk@gmail.com>

Add separate red, green and blue LSC tables to struct DebayerParams.

Co-authored-by: Rick ten Wolde <rick_libcamera@wolde.info>
Signed-off-by: Rick ten Wolde <rick_libcamera@wolde.info>
Signed-off-by: Xander Pronk <xander.c.pronk@gmail.com>
---
 .../internal/software_isp/debayer_params.h     |  6 ++++++
 src/libcamera/software_isp/debayer.cpp         | 18 ++++++++++++++++++
 2 files changed, 24 insertions(+)

Comments

Barnabás Pőcze Jan. 26, 2026, 11:30 a.m. UTC | #1
Hi

2026. 01. 26. 11:42 keltezéssel, Rick ten Wolde írta:
> From: Xander Pronk <xander.c.pronk@gmail.com>
> 
> Add separate red, green and blue LSC tables to struct DebayerParams.
> 
> Co-authored-by: Rick ten Wolde <rick_libcamera@wolde.info>
> Signed-off-by: Rick ten Wolde <rick_libcamera@wolde.info>
> Signed-off-by: Xander Pronk <xander.c.pronk@gmail.com>
> ---
>   .../internal/software_isp/debayer_params.h     |  6 ++++++
>   src/libcamera/software_isp/debayer.cpp         | 18 ++++++++++++++++++
>   2 files changed, 24 insertions(+)
> 
> diff --git a/include/libcamera/internal/software_isp/debayer_params.h b/include/libcamera/internal/software_isp/debayer_params.h
> index 256c7d43..4252cd2d 100644
> --- a/include/libcamera/internal/software_isp/debayer_params.h
> +++ b/include/libcamera/internal/software_isp/debayer_params.h
> @@ -30,6 +30,8 @@ struct DebayerParams {
>   	using LookupTable = std::array<uint8_t, kRGBLookupSize>;
>   	using CcmLookupTable = std::array<CcmColumn, kRGBLookupSize>;
>   
> +	using LscLookupTable = uint8_t[16*16];

   std::array<uint8_t, 16 * 16>

or is there a reason for normal arrays?

It probably also makes sense to give a name to 16 like it is done
for `kRGBLookupSize`, and use that named constant everywhere else.


> +
>   	/*
>   	 * Color lookup tables when CCM is not used.
>   	 *
> @@ -53,6 +55,10 @@ struct DebayerParams {
>   	CcmLookupTable blueCcm;
>   	LookupTable gammaLut;
>   
> +	LscLookupTable LSC_red;
> +	LscLookupTable LSC_green;
> +	LscLookupTable LSC_blue;

Please either follow the existing naming pattern: lscRed, lscGreen, lscBlue.


Regards,
Barnabás Pőcze

> +
>   	/*
>   	 * Per frame corrections as calculated by the IPA
>   	 */
> diff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp
> index 65a1762d..7a8b3462 100644
> --- a/src/libcamera/software_isp/debayer.cpp
> +++ b/src/libcamera/software_isp/debayer.cpp
> @@ -65,6 +65,11 @@ namespace libcamera {
>    * \brief Type of the CCM lookup tables for red, green, blue values
>    */
>   
> +/**
> + * \typedef DebayerParams::LscLookupTable
> + * \brief Type of the LSC lookup tables
> + */
> +
>   /**
>    * \var DebayerParams::red
>    * \brief Lookup table for red color, mapping input values to output values
> @@ -120,6 +125,19 @@ namespace libcamera {
>    * \brief Contrast value for GPUISP
>    */
>   
> +/**
> + * \var DebayerParams::LSC_red
> + * \brief Per frame Lens shading correction red channel
> + */
> +/**
> + * \var DebayerParams::LSC_green
> + * \brief Per frame Lens shading correction red channel
> + */
> +/**
> + * \var DebayerParams::LSC_blue
> + * \brief Per frame Lens shading correction red channel
> + */
> +
>   /**
>    * \class Debayer
>    * \brief Base debayering class

Patch
diff mbox series

diff --git a/include/libcamera/internal/software_isp/debayer_params.h b/include/libcamera/internal/software_isp/debayer_params.h
index 256c7d43..4252cd2d 100644
--- a/include/libcamera/internal/software_isp/debayer_params.h
+++ b/include/libcamera/internal/software_isp/debayer_params.h
@@ -30,6 +30,8 @@  struct DebayerParams {
 	using LookupTable = std::array<uint8_t, kRGBLookupSize>;
 	using CcmLookupTable = std::array<CcmColumn, kRGBLookupSize>;
 
+	using LscLookupTable = uint8_t[16*16];
+
 	/*
 	 * Color lookup tables when CCM is not used.
 	 *
@@ -53,6 +55,10 @@  struct DebayerParams {
 	CcmLookupTable blueCcm;
 	LookupTable gammaLut;
 
+	LscLookupTable LSC_red;
+	LscLookupTable LSC_green;
+	LscLookupTable LSC_blue;
+
 	/*
 	 * Per frame corrections as calculated by the IPA
 	 */
diff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp
index 65a1762d..7a8b3462 100644
--- a/src/libcamera/software_isp/debayer.cpp
+++ b/src/libcamera/software_isp/debayer.cpp
@@ -65,6 +65,11 @@  namespace libcamera {
  * \brief Type of the CCM lookup tables for red, green, blue values
  */
 
+/**
+ * \typedef DebayerParams::LscLookupTable
+ * \brief Type of the LSC lookup tables
+ */
+
 /**
  * \var DebayerParams::red
  * \brief Lookup table for red color, mapping input values to output values
@@ -120,6 +125,19 @@  namespace libcamera {
  * \brief Contrast value for GPUISP
  */
 
+/**
+ * \var DebayerParams::LSC_red
+ * \brief Per frame Lens shading correction red channel
+ */
+/**
+ * \var DebayerParams::LSC_green
+ * \brief Per frame Lens shading correction red channel
+ */
+/**
+ * \var DebayerParams::LSC_blue
+ * \brief Per frame Lens shading correction red channel
+ */
+
 /**
  * \class Debayer
  * \brief Base debayering class