| Message ID | 20260120-sklug-lsc-resampling-v2-dev-v5-4-ef5cec7b299f@ideasonboard.com |
|---|---|
| State | Superseded |
| Headers | show |
| Series |
|
| Related | show |
On Tue, Jan 20, 2026 at 01:26:09PM +0100, 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> > Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> > Reviewed-by: Rui Wang <rui.wang@ideasonboard.com> > > --- > > Changes in v2: > - Collected tags > --- > 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 c581e6441853d18618284b51bfa25c25e1fc8083..bb58386ae646ad6089322ba63d2a9e89664884d2 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 This makes it sound like the grid is split in two, while it's split in four. I would use quadrant instead of half: * The rkisp1 LSC grid spacing is defined by the cell sizes on the * top-left quadrant of the grid. This is then mirrored in hardware to * the other quadrants. See parseSizes() for further details. Up to you. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > + * 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)
diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp index c581e6441853d18618284b51bfa25c25e1fc8083..bb58386ae646ad6089322ba63d2a9e89664884d2 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)