@@ -197,6 +197,26 @@ int Af::configure(IPAContext &context, const IPAConfigInfo &configInfo)
return 0;
}
+/**
+ * \brief Lock AE and AWB
+ * \param[in] context The shared IPA context
+ */
+void Af::afLockAeAwb(IPAContext &context)
+{
+ if (!context.frameContext.af.stable && ignoreCounter_ == 0)
+ context.configuration.af.requireAeAwbLock = true;
+}
+
+/**
+ * \brief Unlock AE and AWB
+ * \param[in] context The shared IPA context
+ */
+void Af::afUnlockAeAwb(IPAContext &context)
+{
+ if (context.frameContext.af.stable)
+ context.configuration.af.requireAeAwbLock = false;
+}
+
/**
* \brief AF coarse scan
*
@@ -451,8 +471,10 @@ void Af::process(IPAContext &context, const ipu3_uapi_stats_3a *stats)
currentVariance_ = afEstimateVariance(y_item, afRawBufferLen, true);
if (!context.frameContext.af.stable) {
+ afLockAeAwb(context);
afCoarseScan(context);
afFineScan(context);
+ afUnlockAeAwb(context);
} else {
if (afIsOutOfFocus(context))
afReset(context);
@@ -55,6 +55,8 @@ private:
double afEstimateVariance(y_table_item_t *y_item, uint32_t len,
bool isY1);
bool afIsOutOfFocus(IPAContext context);
+ void afLockAeAwb(IPAContext &context);
+ void afUnlockAeAwb(IPAContext &context);
/* VCM step configuration. It is the current setting of the VCM step. */
uint32_t focus_;
When AF start to work, it requests to lock the AE and AWB to stabilize the estimated variance of the AF scene. After the algorithm determinesthe lens position, the lock will be released immediately. Signed-off-by: Kate Hsuan <hpa@redhat.com> --- src/ipa/ipu3/algorithms/af.cpp | 22 ++++++++++++++++++++++ src/ipa/ipu3/algorithms/af.h | 2 ++ 2 files changed, 24 insertions(+)