[v2,4/5] libcamera: software_isp: Remove DebayerParams::kGain10
diff mbox series

Message ID 20240430173430.200392-5-mzamazal@redhat.com
State New
Headers show
Series
  • Software ISP levels cleanup
Related show

Commit Message

Milan Zamazal April 30, 2024, 5:34 p.m. UTC
The constant is used in a single place internally and doesn't belong to
DebayerParams anymore.  Let's use 256 directly.

Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
---
 include/libcamera/internal/software_isp/debayer_params.h | 1 -
 src/ipa/simple/soft_simple.cpp                           | 3 +--
 src/libcamera/software_isp/debayer.cpp                   | 5 -----
 3 files changed, 1 insertion(+), 8 deletions(-)

Comments

Andrei Konovalov May 22, 2024, 9:50 a.m. UTC | #1
Hi Milan,

Thank you for the patch!

Reviewed-by: Andrei Konovalov <andrey.konovalov.ynk@gmail.com>

On 30.04.2024 20:34, Milan Zamazal wrote:
> The constant is used in a single place internally and doesn't belong to
> DebayerParams anymore.  Let's use 256 directly.
> 
> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
> ---
>   include/libcamera/internal/software_isp/debayer_params.h | 1 -
>   src/ipa/simple/soft_simple.cpp                           | 3 +--
>   src/libcamera/software_isp/debayer.cpp                   | 5 -----
>   3 files changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/include/libcamera/internal/software_isp/debayer_params.h b/include/libcamera/internal/software_isp/debayer_params.h
> index 09f4ff00..6aaa7d4c 100644
> --- a/include/libcamera/internal/software_isp/debayer_params.h
> +++ b/include/libcamera/internal/software_isp/debayer_params.h
> @@ -16,7 +16,6 @@
>   namespace libcamera {
>   
>   struct DebayerParams {
> -	static constexpr unsigned int kGain10 = 256;
>   	static constexpr unsigned int kRGBLookupSize = 256;
>   
>   	using ColorLookupTable = std::array<uint8_t, kRGBLookupSize>;
> diff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp
> index 981e1ae0..0af23ee7 100644
> --- a/src/ipa/simple/soft_simple.cpp
> +++ b/src/ipa/simple/soft_simple.cpp
> @@ -290,8 +290,7 @@ void IPASoftSimple::processStats(const ControlList &sensorControls)
>   
>   	for (unsigned int i = 0; i < DebayerParams::kRGBLookupSize; i++) {
>   		constexpr unsigned int div =
> -			DebayerParams::kRGBLookupSize * DebayerParams::kGain10 /
> -			kGammaLookupSize;
> +			DebayerParams::kRGBLookupSize * 256 / kGammaLookupSize;
>   		unsigned int idx;
>   
>   		/* Apply gamma after gain! */
> diff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp
> index ac438a33..548c2ccd 100644
> --- a/src/libcamera/software_isp/debayer.cpp
> +++ b/src/libcamera/software_isp/debayer.cpp
> @@ -18,11 +18,6 @@ namespace libcamera {
>    * \brief Struct to hold the debayer parameters.
>    */
>   
> -/**
> - * \var DebayerParams::kGain10
> - * \brief const value for 1.0 gain
> - */
> -
>   /**
>    * \var DebayerParams::kRGBLookupSize
>    * \brief Size of a color lookup table

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 09f4ff00..6aaa7d4c 100644
--- a/include/libcamera/internal/software_isp/debayer_params.h
+++ b/include/libcamera/internal/software_isp/debayer_params.h
@@ -16,7 +16,6 @@ 
 namespace libcamera {
 
 struct DebayerParams {
-	static constexpr unsigned int kGain10 = 256;
 	static constexpr unsigned int kRGBLookupSize = 256;
 
 	using ColorLookupTable = std::array<uint8_t, kRGBLookupSize>;
diff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp
index 981e1ae0..0af23ee7 100644
--- a/src/ipa/simple/soft_simple.cpp
+++ b/src/ipa/simple/soft_simple.cpp
@@ -290,8 +290,7 @@  void IPASoftSimple::processStats(const ControlList &sensorControls)
 
 	for (unsigned int i = 0; i < DebayerParams::kRGBLookupSize; i++) {
 		constexpr unsigned int div =
-			DebayerParams::kRGBLookupSize * DebayerParams::kGain10 /
-			kGammaLookupSize;
+			DebayerParams::kRGBLookupSize * 256 / kGammaLookupSize;
 		unsigned int idx;
 
 		/* Apply gamma after gain! */
diff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp
index ac438a33..548c2ccd 100644
--- a/src/libcamera/software_isp/debayer.cpp
+++ b/src/libcamera/software_isp/debayer.cpp
@@ -18,11 +18,6 @@  namespace libcamera {
  * \brief Struct to hold the debayer parameters.
  */
 
-/**
- * \var DebayerParams::kGain10
- * \brief const value for 1.0 gain
- */
-
 /**
  * \var DebayerParams::kRGBLookupSize
  * \brief Size of a color lookup table