[v3,27/35] ipa: libipa: lsc_polynomial: Remove sensorSize_
diff mbox series

Message ID 20260706-libipa-algorithms-v3-27-968757b038bb@ideasonboard.com
State Superseded
Headers show
Series
  • ipa: libipa: Introduce libipa algorithms
Related show

Commit Message

Jacopo Mondi July 6, 2026, 8:01 a.m. UTC
The sensorSize_ field is only used during the init() function and is
provided to LscPolynomial using the LscDescriptor type.

There is no need to store it as a class member and to pass it in
at class construction time.

Remove it and move the \todo comment in the LscDescriptor type
documentation.

Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
---
 src/ipa/libipa/lsc.cpp            | 6 +-----
 src/ipa/libipa/lsc_base.cpp       | 3 +++
 src/ipa/libipa/lsc_polynomial.cpp | 7 -------
 src/ipa/libipa/lsc_polynomial.h   | 6 ------
 4 files changed, 4 insertions(+), 18 deletions(-)

Comments

Kieran Bingham July 6, 2026, 6:46 p.m. UTC | #1
Quoting Jacopo Mondi (2026-07-06 09:01:47)
> The sensorSize_ field is only used during the init() function and is
> provided to LscPolynomial using the LscDescriptor type.
> 
> There is no need to store it as a class member and to pass it in
> at class construction time.
> 
> Remove it and move the \todo comment in the LscDescriptor type
> documentation.
> 
> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> ---
>  src/ipa/libipa/lsc.cpp            | 6 +-----
>  src/ipa/libipa/lsc_base.cpp       | 3 +++
>  src/ipa/libipa/lsc_polynomial.cpp | 7 -------
>  src/ipa/libipa/lsc_polynomial.h   | 6 ------
>  4 files changed, 4 insertions(+), 18 deletions(-)
> 
> diff --git a/src/ipa/libipa/lsc.cpp b/src/ipa/libipa/lsc.cpp
> index c860569ccee4..804bbc2915e4 100644
> --- a/src/ipa/libipa/lsc.cpp
> +++ b/src/ipa/libipa/lsc.cpp
> @@ -215,11 +215,7 @@ int LscAlgorithm::init(const ValueNode &tuningData, ControlInfoMap::Map &control
>                 impl_ = std::make_unique<LscTable>();
>                 LOG(Lsc, Debug) << "Using table-based Lsc";
>         } else if (type == "polynomial") {
> -               /*
> -                * \todo: Most likely the reference frame should be native_size.
> -                * Let's wait how the internal discussions progress.
> -                */
> -               impl_ = std::make_unique<LscPolynomial>(descriptor.sensorSize);
> +               impl_ = std::make_unique<LscPolynomial>();
>                 polynomial_ = true;
>                 LOG(Lsc, Debug) << "Using polynomial Lsc";
>         } else {
> diff --git a/src/ipa/libipa/lsc_base.cpp b/src/ipa/libipa/lsc_base.cpp
> index 30af8d970a12..7de6ee70e7a0 100644
> --- a/src/ipa/libipa/lsc_base.cpp
> +++ b/src/ipa/libipa/lsc_base.cpp
> @@ -78,6 +78,9 @@ void Interpolator<lsc::Components>::
>   * \var LscDescriptor::sensorSize

it's hard to tell from this context alone, is this used at all in anyway
still ?

Are they the 'limit's of the Polynomial output?


>   * \brief The physical sensor size. This is the largest frame size used to
>   * generate the lsc table. Only used by the polynomial lsc algorithm
> + *
> + * \todo: Most likely the reference frame should be native_size.
> + * Let's wait how the internal discussions progress.
>   */
>  
>  /**
> diff --git a/src/ipa/libipa/lsc_polynomial.cpp b/src/ipa/libipa/lsc_polynomial.cpp
> index 0550229b5152..013a4469546e 100644
> --- a/src/ipa/libipa/lsc_polynomial.cpp
> +++ b/src/ipa/libipa/lsc_polynomial.cpp
> @@ -123,13 +123,6 @@ void Polynomial::setReferenceImageSize(const Size &size)
>   * \sa LscImplementation
>   */
>  
> -/**
> - * \fn LscPolynomial::LscPolynomial
> - * \param[in] sensorSize The physical sensor size
> - *
> - * Construct an LscPolynomial
> - */
> -
>  /**
>   * \brief Parse polynomial lsc data
>   * \param[in] sets The tuning file content
> diff --git a/src/ipa/libipa/lsc_polynomial.h b/src/ipa/libipa/lsc_polynomial.h
> index 2a26db499d68..6d19e46a50b7 100644
> --- a/src/ipa/libipa/lsc_polynomial.h
> +++ b/src/ipa/libipa/lsc_polynomial.h
> @@ -57,11 +57,6 @@ private:
>         using PolynomialComponentsMap = std::map<unsigned int, PolynomialComponents>;
>  
>  public:
> -       LscPolynomial(const Size &sensorSize)
> -               : sensorSize_(sensorSize)
> -       {
> -       }
> -
>         int parseLscData(const ValueNode &sets,
>                          const LscDescriptor &descriptor) override;
>  
> @@ -75,7 +70,6 @@ private:
>                                                Span<const double> yPositions,
>                                                const Rectangle &cropRectangle);
>         PolynomialComponentsMap lscData_;
> -       Size sensorSize_;

Anyway, if you're still able to compile after this commit then this
wasn't used and can be removed so:


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

>  };
>  
>  } /* namespace ipa */
> 
> -- 
> 2.54.0
>

Patch
diff mbox series

diff --git a/src/ipa/libipa/lsc.cpp b/src/ipa/libipa/lsc.cpp
index c860569ccee4..804bbc2915e4 100644
--- a/src/ipa/libipa/lsc.cpp
+++ b/src/ipa/libipa/lsc.cpp
@@ -215,11 +215,7 @@  int LscAlgorithm::init(const ValueNode &tuningData, ControlInfoMap::Map &control
 		impl_ = std::make_unique<LscTable>();
 		LOG(Lsc, Debug) << "Using table-based Lsc";
 	} else if (type == "polynomial") {
-		/*
-		 * \todo: Most likely the reference frame should be native_size.
-		 * Let's wait how the internal discussions progress.
-		 */
-		impl_ = std::make_unique<LscPolynomial>(descriptor.sensorSize);
+		impl_ = std::make_unique<LscPolynomial>();
 		polynomial_ = true;
 		LOG(Lsc, Debug) << "Using polynomial Lsc";
 	} else {
diff --git a/src/ipa/libipa/lsc_base.cpp b/src/ipa/libipa/lsc_base.cpp
index 30af8d970a12..7de6ee70e7a0 100644
--- a/src/ipa/libipa/lsc_base.cpp
+++ b/src/ipa/libipa/lsc_base.cpp
@@ -78,6 +78,9 @@  void Interpolator<lsc::Components>::
  * \var LscDescriptor::sensorSize
  * \brief The physical sensor size. This is the largest frame size used to
  * generate the lsc table. Only used by the polynomial lsc algorithm
+ *
+ * \todo: Most likely the reference frame should be native_size.
+ * Let's wait how the internal discussions progress.
  */
 
 /**
diff --git a/src/ipa/libipa/lsc_polynomial.cpp b/src/ipa/libipa/lsc_polynomial.cpp
index 0550229b5152..013a4469546e 100644
--- a/src/ipa/libipa/lsc_polynomial.cpp
+++ b/src/ipa/libipa/lsc_polynomial.cpp
@@ -123,13 +123,6 @@  void Polynomial::setReferenceImageSize(const Size &size)
  * \sa LscImplementation
  */
 
-/**
- * \fn LscPolynomial::LscPolynomial
- * \param[in] sensorSize The physical sensor size
- *
- * Construct an LscPolynomial
- */
-
 /**
  * \brief Parse polynomial lsc data
  * \param[in] sets The tuning file content
diff --git a/src/ipa/libipa/lsc_polynomial.h b/src/ipa/libipa/lsc_polynomial.h
index 2a26db499d68..6d19e46a50b7 100644
--- a/src/ipa/libipa/lsc_polynomial.h
+++ b/src/ipa/libipa/lsc_polynomial.h
@@ -57,11 +57,6 @@  private:
 	using PolynomialComponentsMap = std::map<unsigned int, PolynomialComponents>;
 
 public:
-	LscPolynomial(const Size &sensorSize)
-		: sensorSize_(sensorSize)
-	{
-	}
-
 	int parseLscData(const ValueNode &sets,
 			 const LscDescriptor &descriptor) override;
 
@@ -75,7 +70,6 @@  private:
 					       Span<const double> yPositions,
 					       const Rectangle &cropRectangle);
 	PolynomialComponentsMap lscData_;
-	Size sensorSize_;
 };
 
 } /* namespace ipa */