@@ -403,6 +403,16 @@ bool Af::afIsOutOfFocus(IPAContext context)
return false;
}
+void Af::pause(IPAContext &context)
+{
+ context.frameContext.af.focus = focus_;
+}
+
+bool Af::isAgcStable(IPAContext context)
+{
+ return context.frameContext.agc.stable;
+}
+
/**
* \brief Determine the max contrast image and lens position.
* \param[in] context The IPA context.
@@ -421,6 +431,8 @@ bool Af::afIsOutOfFocus(IPAContext context)
*/
void Af::process(IPAContext &context, const ipu3_uapi_stats_3a *stats)
{
+ if (!isAgcStable(context))
+ pause(context);
/* Evaluate the AF buffer length */
uint32_t afRawBufferLen = context.configuration.af.afGrid.width *
context.configuration.af.afGrid.height;
@@ -44,6 +44,8 @@ private:
double afEstimateVariance(Span<const y_table_item_t> y_items, bool isY1);
bool afIsOutOfFocus(IPAContext context);
+ bool isAgcStable(IPAContext context);
+ void pause(IPAContext &context);
/* VCM step configuration. It is the current setting of the VCM step. */
uint32_t focus_;
AGC stable status is used to determine that AF is triggered or paused. If AGC is ready, AF can start to evaluate the lens position. Signed-off-by: Kate Hsuan<hpa@redhat.com> --- src/ipa/ipu3/algorithms/af.cpp | 12 ++++++++++++ src/ipa/ipu3/algorithms/af.h | 2 ++ 2 files changed, 14 insertions(+)