[libcamera-devel,3/4] ipa: ipu3: awb: AWB lock for AF scan
diff mbox series

Message ID 20220322024155.6528-4-hpa@redhat.com
State Superseded
Headers show
Series
  • ipa: ipu3: af: Temporarily suspend AWB and AE during AF scanning
Related show

Commit Message

Kate Hsuan March 22, 2022, 2:41 a.m. UTC
When the AF starts to perform the scan, AWB will be suspended to stabilize
the AF scene variance and improve the AF performance.

Signed-off-by: Kate Hsuan <hpa@redhat.com>
---
 src/ipa/ipu3/algorithms/awb.cpp | 13 +++++++++++++
 src/ipa/ipu3/algorithms/awb.h   |  1 +
 2 files changed, 14 insertions(+)

Patch
diff mbox series

diff --git a/src/ipa/ipu3/algorithms/awb.cpp b/src/ipa/ipu3/algorithms/awb.cpp
index 87a6cc7a..328bd38d 100644
--- a/src/ipa/ipu3/algorithms/awb.cpp
+++ b/src/ipa/ipu3/algorithms/awb.cpp
@@ -384,11 +384,24 @@  void Awb::calculateWBGains(const ipu3_uapi_stats_3a *stats)
 	}
 }
 
+/**
+ * \brief Test the AF requested lock is exist.
+ */
+bool Awb::isAfRequestedLock(IPAContext context)
+{
+	if (context.configuration.af.requireAeAwbLock)
+		return true;
+	else
+		return false;
+}
+
 /**
  * \copydoc libcamera::ipa::Algorithm::process
  */
 void Awb::process(IPAContext &context, const ipu3_uapi_stats_3a *stats)
 {
+	if (isAfRequestedLock(context))
+		return;
 	calculateWBGains(stats);
 
 	/*
diff --git a/src/ipa/ipu3/algorithms/awb.h b/src/ipa/ipu3/algorithms/awb.h
index ab4b0a33..9673592f 100644
--- a/src/ipa/ipu3/algorithms/awb.h
+++ b/src/ipa/ipu3/algorithms/awb.h
@@ -72,6 +72,7 @@  private:
 	void awbGreyWorld();
 	uint32_t estimateCCT(double red, double green, double blue);
 	static constexpr uint16_t threshold(float value);
+	bool isAfRequestedLock(IPAContext context);
 
 	std::vector<RGB> zones_;
 	Accumulator awbStats_[kAwbStatsSizeX * kAwbStatsSizeY];