[v3,17/23] libcamera: software_isp: Call Algorithm::process
diff mbox series

Message ID 20240717085444.289997-18-mzamazal@redhat.com
State Superseded
Headers show
Series
  • Software ISP refactoring
Related show

Commit Message

Milan Zamazal July 17, 2024, 8:54 a.m. UTC
This patch adds Algorithm::process call for the defined algorithms.
This is preparation only since there are currently no Algorithm based
algorithms defined.

As software ISP currently doesn't produce any metadata, a dummy and
unused metadata instance is created to satisfy Algorithm::process API.
This should be changed in future.

Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
---
 src/ipa/simple/soft_simple.cpp | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

Comments

Dan Scally Aug. 13, 2024, 9:34 a.m. UTC | #1
Hi Milan

On 17/07/2024 09:54, Milan Zamazal wrote:
> This patch adds Algorithm::process call for the defined algorithms.
> This is preparation only since there are currently no Algorithm based
> algorithms defined.
>
> As software ISP currently doesn't produce any metadata, a dummy and
> unused metadata instance is created to satisfy Algorithm::process API.
> This should be changed in future.
>
> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
> ---
>   src/ipa/simple/soft_simple.cpp | 13 ++++++++++++-
>   1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp
> index f4a6bdf4..a8499f29 100644
> --- a/src/ipa/simple/soft_simple.cpp
> +++ b/src/ipa/simple/soft_simple.cpp
> @@ -287,10 +287,21 @@ void IPASoftSimple::prepare(const uint32_t frame)
>   }
>   
>   void IPASoftSimple::processStats(
> -	[[maybe_unused]] const uint32_t frame,
> +	const uint32_t frame,
Usual comment about the name of the variable
>   	[[maybe_unused]] const uint32_t bufferId,
>   	const ControlList &sensorControls)
>   {
> +	IPAFrameContext &frameContext = context_.frameContexts.get(frame);
> +	/*
> +	 * Software ISP currently does not produce any metadata. Use an empty
> +	 * ControlList for now.
> +	 *
> +	 * \todo Implement proper metadata handling
> +	 */

I think this is fine for now...it would be nice to get this included too but tracking when to 
complete the request when it's more than just waiting for the buffers to complete has historically 
not proven to be trivial.


Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>

> +	ControlList metadata(controls::controls);
> +	for (auto const &algo : algorithms())
> +		algo->process(context_, frame, frameContext, stats_, metadata);
> +
>   	SwIspStats::Histogram histogram = stats_->yHistogram;
>   	if (ignoreUpdates_ > 0)
>   		blackLevel_.update(histogram);

Patch
diff mbox series

diff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp
index f4a6bdf4..a8499f29 100644
--- a/src/ipa/simple/soft_simple.cpp
+++ b/src/ipa/simple/soft_simple.cpp
@@ -287,10 +287,21 @@  void IPASoftSimple::prepare(const uint32_t frame)
 }
 
 void IPASoftSimple::processStats(
-	[[maybe_unused]] const uint32_t frame,
+	const uint32_t frame,
 	[[maybe_unused]] const uint32_t bufferId,
 	const ControlList &sensorControls)
 {
+	IPAFrameContext &frameContext = context_.frameContexts.get(frame);
+	/*
+	 * Software ISP currently does not produce any metadata. Use an empty
+	 * ControlList for now.
+	 *
+	 * \todo Implement proper metadata handling
+	 */
+	ControlList metadata(controls::controls);
+	for (auto const &algo : algorithms())
+		algo->process(context_, frame, frameContext, stats_, metadata);
+
 	SwIspStats::Histogram histogram = stats_->yHistogram;
 	if (ignoreUpdates_ > 0)
 		blackLevel_.update(histogram);