[v1,04/12] ipa: rkisp1: lsc: Rename res to positions
diff mbox series

Message ID 20251014075252.2876485-5-stefan.klug@ideasonboard.com
State New
Headers show
Series
  • Add resampling support for polynomial LSC data
Related show

Commit Message

Stefan Klug Oct. 14, 2025, 7:52 a.m. UTC
Rename the res variable to positions which better describes the intent.
This was commented in review after being merged.

While at it, improve the documentation a bit.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
---
 src/ipa/rkisp1/algorithms/lsc.cpp | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

Comments

Barnabás Pőcze Oct. 24, 2025, 4:11 p.m. UTC | #1
2025. 10. 14. 9:52 keltezéssel, Stefan Klug írta:
> Rename the res variable to positions which better describes the intent.
> This was commented in review after being merged.
> 
> While at it, improve the documentation a bit.
> 
> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
> ---

Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>


>   src/ipa/rkisp1/algorithms/lsc.cpp | 18 ++++++++++--------
>   1 file changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp
> index c581e6441853..bb58386ae646 100644
> --- a/src/ipa/rkisp1/algorithms/lsc.cpp
> +++ b/src/ipa/rkisp1/algorithms/lsc.cpp
> @@ -132,9 +132,11 @@ public:
>   
>   private:
>   	/*
> -	 * The lsc grid has custom spacing defined on half the range (see
> -	 * parseSizes() for details). For easier handling this function converts
> -	 * the spaces vector to positions and mirrors them. E.g.:
> +	 * The rkisp1 LSC grid spacing is defined by the cell sizes on the first
> +	 * half of the grid. This is then mirrored in hardware to the other
> +	 * half. See parseSizes() for further details. For easier handling, this
> +	 * function converts the cell sizes of half the grid to a list of
> +	 * position of the whole grid (on one axis). Example:
>   	 *
>   	 * input:   | 0.2 | 0.3 |
>   	 * output: 0.0   0.2   0.5   0.8   1.0
> @@ -142,17 +144,17 @@ private:
>   	std::vector<double> sizesListToPositions(const std::vector<double> &sizes)
>   	{
>   		const int half = sizes.size();
> -		std::vector<double> res(half * 2 + 1);
> +		std::vector<double> positions(half * 2 + 1);
>   		double x = 0.0;
>   
> -		res[half] = 0.5;
> +		positions[half] = 0.5;
>   		for (int i = 1; i <= half; i++) {
>   			x += sizes[half - i];
> -			res[half - i] = 0.5 - x;
> -			res[half + i] = 0.5 + x;
> +			positions[half - i] = 0.5 - x;
> +			positions[half + i] = 0.5 + x;
>   		}
>   
> -		return res;
> +		return positions;
>   	}
>   
>   	std::vector<uint16_t> samplePolynomial(const LscPolynomial &poly)
Rui Wang Oct. 25, 2025, 2:16 p.m. UTC | #2
On 2025-10-14 03:52, Stefan Klug wrote:
> Rename the res variable to positions which better describes the intent.
> This was commented in review after being merged.
>
> While at it, improve the documentation a bit.
>
> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
> ---
>   src/ipa/rkisp1/algorithms/lsc.cpp | 18 ++++++++++--------
>   1 file changed, 10 insertions(+), 8 deletions(-)
>
> diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp
> index c581e6441853..bb58386ae646 100644
> --- a/src/ipa/rkisp1/algorithms/lsc.cpp
> +++ b/src/ipa/rkisp1/algorithms/lsc.cpp
> @@ -132,9 +132,11 @@ public:
>   
>   private:
>   	/*
> -	 * The lsc grid has custom spacing defined on half the range (see
> -	 * parseSizes() for details). For easier handling this function converts
> -	 * the spaces vector to positions and mirrors them. E.g.:
> +	 * The rkisp1 LSC grid spacing is defined by the cell sizes on the first
> +	 * half of the grid. This is then mirrored in hardware to the other
> +	 * half. See parseSizes() for further details. For easier handling, this
> +	 * function converts the cell sizes of half the grid to a list of
> +	 * position of the whole grid (on one axis). Example:
>   	 *
>   	 * input:   | 0.2 | 0.3 |
>   	 * output: 0.0   0.2   0.5   0.8   1.0
> @@ -142,17 +144,17 @@ private:
>   	std::vector<double> sizesListToPositions(const std::vector<double> &sizes)
>   	{
>   		const int half = sizes.size();
> -		std::vector<double> res(half * 2 + 1);
> +		std::vector<double> positions(half * 2 + 1);
>   		double x = 0.0;
>   
> -		res[half] = 0.5;
> +		positions[half] = 0.5;
>   		for (int i = 1; i <= half; i++) {
>   			x += sizes[half - i];
> -			res[half - i] = 0.5 - x;
> -			res[half + i] = 0.5 + x;
> +			positions[half - i] = 0.5 - x;
> +			positions[half + i] = 0.5 + x;
>   		}
>   
> -		return res;
> +		return positions;
>   	}
>   
>   	std::vector<uint16_t> samplePolynomial(const LscPolynomial &poly)

Reviewed by Rui Wang
Rui Wang Oct. 27, 2025, 8:59 p.m. UTC | #3
On 2025-10-14 03:52, Stefan Klug wrote:
> Rename the res variable to positions which better describes the intent.
> This was commented in review after being merged.
>
> While at it, improve the documentation a bit.
>
> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
> ---
>   src/ipa/rkisp1/algorithms/lsc.cpp | 18 ++++++++++--------
>   1 file changed, 10 insertions(+), 8 deletions(-)
>
> diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp
> index c581e6441853..bb58386ae646 100644
> --- a/src/ipa/rkisp1/algorithms/lsc.cpp
> +++ b/src/ipa/rkisp1/algorithms/lsc.cpp
> @@ -132,9 +132,11 @@ public:
>   
>   private:
>   	/*
> -	 * The lsc grid has custom spacing defined on half the range (see
> -	 * parseSizes() for details). For easier handling this function converts
> -	 * the spaces vector to positions and mirrors them. E.g.:
> +	 * The rkisp1 LSC grid spacing is defined by the cell sizes on the first
> +	 * half of the grid. This is then mirrored in hardware to the other
> +	 * half. See parseSizes() for further details. For easier handling, this
> +	 * function converts the cell sizes of half the grid to a list of
> +	 * position of the whole grid (on one axis). Example:
>   	 *
>   	 * input:   | 0.2 | 0.3 |
>   	 * output: 0.0   0.2   0.5   0.8   1.0
> @@ -142,17 +144,17 @@ private:
>   	std::vector<double> sizesListToPositions(const std::vector<double> &sizes)
>   	{
>   		const int half = sizes.size();
> -		std::vector<double> res(half * 2 + 1);
> +		std::vector<double> positions(half * 2 + 1);
>   		double x = 0.0;
>   
> -		res[half] = 0.5;
> +		positions[half] = 0.5;
>   		for (int i = 1; i <= half; i++) {
>   			x += sizes[half - i];
> -			res[half - i] = 0.5 - x;
> -			res[half + i] = 0.5 + x;
> +			positions[half - i] = 0.5 - x;
> +			positions[half + i] = 0.5 + x;
>   		}
>   
> -		return res;
> +		return positions;
>   	}
>   
>   	std::vector<uint16_t> samplePolynomial(const LscPolynomial &poly)

Reviewed-by: Rui Wang <rui.wang@ideasonboard.com>

Patch
diff mbox series

diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp
index c581e6441853..bb58386ae646 100644
--- a/src/ipa/rkisp1/algorithms/lsc.cpp
+++ b/src/ipa/rkisp1/algorithms/lsc.cpp
@@ -132,9 +132,11 @@  public:
 
 private:
 	/*
-	 * The lsc grid has custom spacing defined on half the range (see
-	 * parseSizes() for details). For easier handling this function converts
-	 * the spaces vector to positions and mirrors them. E.g.:
+	 * The rkisp1 LSC grid spacing is defined by the cell sizes on the first
+	 * half of the grid. This is then mirrored in hardware to the other
+	 * half. See parseSizes() for further details. For easier handling, this
+	 * function converts the cell sizes of half the grid to a list of
+	 * position of the whole grid (on one axis). Example:
 	 *
 	 * input:   | 0.2 | 0.3 |
 	 * output: 0.0   0.2   0.5   0.8   1.0
@@ -142,17 +144,17 @@  private:
 	std::vector<double> sizesListToPositions(const std::vector<double> &sizes)
 	{
 		const int half = sizes.size();
-		std::vector<double> res(half * 2 + 1);
+		std::vector<double> positions(half * 2 + 1);
 		double x = 0.0;
 
-		res[half] = 0.5;
+		positions[half] = 0.5;
 		for (int i = 1; i <= half; i++) {
 			x += sizes[half - i];
-			res[half - i] = 0.5 - x;
-			res[half + i] = 0.5 + x;
+			positions[half - i] = 0.5 - x;
+			positions[half + i] = 0.5 + x;
 		}
 
-		return res;
+		return positions;
 	}
 
 	std::vector<uint16_t> samplePolynomial(const LscPolynomial &poly)