[3/3] ipa: rkisp1: agc: Plumb lux
diff mbox series

Message ID 20240412091700.1817754-4-paul.elder@ideasonboard.com
State New
Headers show
Series
  • ipa: rkisp1: Add lux estimation
Related show

Commit Message

Paul Elder April 12, 2024, 9:17 a.m. UTC
Now that the rkisp1 IPA has a lux algorithm module, use the lux value
that comes from that as opposed to hardcoding it.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
---
 src/ipa/rkisp1/algorithms/agc.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Laurent Pinchart June 16, 2024, 10:36 p.m. UTC | #1
Hi Paul,

Thank you for the patch.

On Fri, Apr 12, 2024 at 06:17:00PM +0900, Paul Elder wrote:
> Now that the rkisp1 IPA has a lux algorithm module, use the lux value
> that comes from that as opposed to hardcoding it.
> 
> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
> ---
>  src/ipa/rkisp1/algorithms/agc.cpp | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp
> index ed4d6330..5371ae48 100644
> --- a/src/ipa/rkisp1/algorithms/agc.cpp
> +++ b/src/ipa/rkisp1/algorithms/agc.cpp
> @@ -424,8 +424,7 @@ void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,
>  	double analogueGain = frameContext.sensor.gain;
>  	utils::Duration effectiveExposureValue = exposureTime * analogueGain;
>  
> -	/* \todo Plumb in the lux value. Requires a lux algo + tuning */
> -	double lux = 400;
> +	double lux = frameContext.agc.lux;

I like this :-) But with the current implementation, for this to work, I
think you need to ensure that the Lux algorithm is instantiated in the
tuning file before Agc. This should be documented somewhere.

>  
>  	utils::Duration shutterTime;
>  	double aGain, dGain;

Patch
diff mbox series

diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp
index ed4d6330..5371ae48 100644
--- a/src/ipa/rkisp1/algorithms/agc.cpp
+++ b/src/ipa/rkisp1/algorithms/agc.cpp
@@ -424,8 +424,7 @@  void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,
 	double analogueGain = frameContext.sensor.gain;
 	utils::Duration effectiveExposureValue = exposureTime * analogueGain;
 
-	/* \todo Plumb in the lux value. Requires a lux algo + tuning */
-	double lux = 400;
+	double lux = frameContext.agc.lux;
 
 	utils::Duration shutterTime;
 	double aGain, dGain;