[06/12] ipa: rkisp1: agc: Make size argument to computeHistogramPredivider const
diff mbox series

Message ID 20240616163910.5506-7-laurent.pinchart@ideasonboard.com
State Accepted
Commit de4ed4e966b476dbcfa63bc61028b0fc16ee4a78
Headers show
Series
  • ipa: rkisp1: Miscellaneous AGC fixes
Related show

Commit Message

Laurent Pinchart June 16, 2024, 4:39 p.m. UTC
The Agc::computeHistogramPredivider() function doesn't need to modify
its size parameter. Make it const.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/ipa/rkisp1/algorithms/agc.cpp | 3 ++-
 src/ipa/rkisp1/algorithms/agc.h   | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

Comments

Kieran Bingham June 17, 2024, 9:17 a.m. UTC | #1
Quoting Laurent Pinchart (2024-06-16 17:39:04)
> The Agc::computeHistogramPredivider() function doesn't need to modify
> its size parameter. Make it const.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> ---
>  src/ipa/rkisp1/algorithms/agc.cpp | 3 ++-
>  src/ipa/rkisp1/algorithms/agc.h   | 2 +-
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp
> index 0f60d08fd41c..9dac60bdb24e 100644
> --- a/src/ipa/rkisp1/algorithms/agc.cpp
> +++ b/src/ipa/rkisp1/algorithms/agc.cpp
> @@ -84,7 +84,8 @@ int Agc::parseMeteringModes(IPAContext &context, const YamlObject &tuningData)
>         return 0;
>  }
>  
> -uint8_t Agc::computeHistogramPredivider(Size &size, enum rkisp1_cif_isp_histogram_mode mode)
> +uint8_t Agc::computeHistogramPredivider(const Size &size,
> +                                       enum rkisp1_cif_isp_histogram_mode mode)
>  {
>         /*
>          * The maximum number of pixels that could potentially be in one bin is
> diff --git a/src/ipa/rkisp1/algorithms/agc.h b/src/ipa/rkisp1/algorithms/agc.h
> index 996fea71755c..9ceaa82b099e 100644
> --- a/src/ipa/rkisp1/algorithms/agc.h
> +++ b/src/ipa/rkisp1/algorithms/agc.h
> @@ -45,7 +45,7 @@ public:
>  
>  private:
>         int parseMeteringModes(IPAContext &context, const YamlObject &tuningData);
> -       uint8_t computeHistogramPredivider(Size &size,
> +       uint8_t computeHistogramPredivider(const Size &size,
>                                            enum rkisp1_cif_isp_histogram_mode mode);
>  
>         void fillMetadata(IPAContext &context, IPAFrameContext &frameContext,
> -- 
> Regards,
> 
> Laurent Pinchart
>
Paul Elder June 17, 2024, 10:12 a.m. UTC | #2
On Sun, Jun 16, 2024 at 07:39:04PM +0300, Laurent Pinchart wrote:
> The Agc::computeHistogramPredivider() function doesn't need to modify
> its size parameter. Make it const.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>

> ---
>  src/ipa/rkisp1/algorithms/agc.cpp | 3 ++-
>  src/ipa/rkisp1/algorithms/agc.h   | 2 +-
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp
> index 0f60d08fd41c..9dac60bdb24e 100644
> --- a/src/ipa/rkisp1/algorithms/agc.cpp
> +++ b/src/ipa/rkisp1/algorithms/agc.cpp
> @@ -84,7 +84,8 @@ int Agc::parseMeteringModes(IPAContext &context, const YamlObject &tuningData)
>  	return 0;
>  }
>  
> -uint8_t Agc::computeHistogramPredivider(Size &size, enum rkisp1_cif_isp_histogram_mode mode)
> +uint8_t Agc::computeHistogramPredivider(const Size &size,
> +					enum rkisp1_cif_isp_histogram_mode mode)
>  {
>  	/*
>  	 * The maximum number of pixels that could potentially be in one bin is
> diff --git a/src/ipa/rkisp1/algorithms/agc.h b/src/ipa/rkisp1/algorithms/agc.h
> index 996fea71755c..9ceaa82b099e 100644
> --- a/src/ipa/rkisp1/algorithms/agc.h
> +++ b/src/ipa/rkisp1/algorithms/agc.h
> @@ -45,7 +45,7 @@ public:
>  
>  private:
>  	int parseMeteringModes(IPAContext &context, const YamlObject &tuningData);
> -	uint8_t computeHistogramPredivider(Size &size,
> +	uint8_t computeHistogramPredivider(const Size &size,
>  					   enum rkisp1_cif_isp_histogram_mode mode);
>  
>  	void fillMetadata(IPAContext &context, IPAFrameContext &frameContext,

Patch
diff mbox series

diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp
index 0f60d08fd41c..9dac60bdb24e 100644
--- a/src/ipa/rkisp1/algorithms/agc.cpp
+++ b/src/ipa/rkisp1/algorithms/agc.cpp
@@ -84,7 +84,8 @@  int Agc::parseMeteringModes(IPAContext &context, const YamlObject &tuningData)
 	return 0;
 }
 
-uint8_t Agc::computeHistogramPredivider(Size &size, enum rkisp1_cif_isp_histogram_mode mode)
+uint8_t Agc::computeHistogramPredivider(const Size &size,
+					enum rkisp1_cif_isp_histogram_mode mode)
 {
 	/*
 	 * The maximum number of pixels that could potentially be in one bin is
diff --git a/src/ipa/rkisp1/algorithms/agc.h b/src/ipa/rkisp1/algorithms/agc.h
index 996fea71755c..9ceaa82b099e 100644
--- a/src/ipa/rkisp1/algorithms/agc.h
+++ b/src/ipa/rkisp1/algorithms/agc.h
@@ -45,7 +45,7 @@  public:
 
 private:
 	int parseMeteringModes(IPAContext &context, const YamlObject &tuningData);
-	uint8_t computeHistogramPredivider(Size &size,
+	uint8_t computeHistogramPredivider(const Size &size,
 					   enum rkisp1_cif_isp_histogram_mode mode);
 
 	void fillMetadata(IPAContext &context, IPAFrameContext &frameContext,