From patchwork Fri Sep 16 10:37:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 17375 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 2A73FC3272 for ; Fri, 16 Sep 2022 10:37:39 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E8AD461FBA; Fri, 16 Sep 2022 12:37:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1663324658; bh=+LX1xPaaR2C8yA6D4RnRXY9lbP66wLhrJtiprkp5Akg=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=EBC0KiK1uUBvuNTpAfMIBIxAbB2TJAGjJM5020Da402rpIS03ZSLOxcCIKlQXwxyJ sX36gG08czz6WiNy1qOXJDtGkJnakarqo6s/PwmO3E9jTlrauIOMaC1ZfpeSKYM0iS 6pVdDXWfc8A3etcHYPpTPtFv9XLBsA+FQm1IILCdGe+m3jGOk/2psD4XzX02i1yru1 vT6ktgDuYdLw3HsjtqTpin5CFtk1uEVnWkCSqsCODaKaBf8xwYuzskSUsM2Vs1SLKp 3LANQ4qPOnVcenjDrrL8B70pkpD9V2staIrc7yWvq5r8J+QDqF9T96lkqzhg7A0PNM K31mWZXXY4pwQ== Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1D1EA61FAB for ; Fri, 16 Sep 2022 12:37:37 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="C2L2R+cV"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663324656; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BUd4fh3maUw7N0BUVSH1+BM4NctThW+3TbIDj42y71o=; b=C2L2R+cVtNJDoRX+uvIdDYDQu04K+XRRfdMLTePR4t5Ro6XfG2pMnEV36l/UTZZi36Pm0K CB+oMwQOgAh7hIKohjdtaao45vXsHWl965FUiKArMbaPsVlzHpylpm8JmSys18IlGs7Vrq hxALVMTyUXdzT/SXGfoI+WazlIPkbh0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-587-pZ3drWUtNx-Bu6e2PSDSUA-1; Fri, 16 Sep 2022 06:37:35 -0400 X-MC-Unique: pZ3drWUtNx-Bu6e2PSDSUA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E932F101A52A for ; Fri, 16 Sep 2022 10:37:34 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.39.193.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id C1E5740F2D20; Fri, 16 Sep 2022 10:37:32 +0000 (UTC) To: libcamera devel , Hans De Goede Date: Fri, 16 Sep 2022 18:37:11 +0800 Message-Id: <20220916103713.21132-2-hpa@redhat.com> In-Reply-To: <20220916103713.21132-1-hpa@redhat.com> References: <20220916103713.21132-1-hpa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [libcamera-devel] [PATCH 1/3] ipu3: Registering AF controls X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Kate Hsuan via libcamera-devel From: Kate Hsuan Reply-To: Kate Hsuan Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Regitering AF controls, including AF_MODE and LENS_POSITION. Signed-off-by: Kate Hsuan --- src/ipa/ipu3/ipu3.cpp | 4 ++++ src/libcamera/pipeline/ipu3/ipu3.cpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp index e37b2fa0..ac0c42a7 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -277,6 +277,10 @@ void IPAIPU3::updateControls(const IPACameraSensorInfo &sensorInfo, frameDurations[1], frameDurations[2]); + /* Af controls */ + controls[&controls::AfMode] = ControlInfo(controls::AfModeValues); + controls[&controls::LensPosition] = ControlInfo(0.0f, 1.0f, 0.5f); + *ipaControls = ControlInfoMap(std::move(controls), controls::controls); } diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 93219a6c..2e35b9bc 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -43,6 +43,8 @@ LOG_DEFINE_CATEGORY(IPU3) static const ControlInfoMap::Map IPU3Controls = { { &controls::draft::PipelineDepth, ControlInfo(2, 3) }, + { &controls::AfMode, ControlInfo(controls::AfModeValues) }, + { &controls::LensPosition, ControlInfo(0.0f, 1.0f, 0.5f) } }; class IPU3CameraData : public Camera::Private From patchwork Fri Sep 16 10:37:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 17376 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id C3DB8C3272 for ; Fri, 16 Sep 2022 10:37:45 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7E77E61FAB; Fri, 16 Sep 2022 12:37:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1663324665; bh=u7jSniZ9dEKWuTdrcKnvInmONMg4NSiKRe60jkchxZQ=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=VYgv7HNB/+dtO4CU7fbwyI2bVIww9Nz2OXh2F1B3qBR+lCg4po8bOEFle14NUHpuC PpgMyxKvGsLMAllf+LjZ7e8VhQbhVmYHD111HIRFwpprOyFjwNoIo24c034f/VynxI 4GBwzmMjw3B5sjJNwWPZeiWAnwrccc4ByR+OVXfmGASz3f+BLD5vsJRBPDnpA75hDQ lTb3i+QI2BJcUoQCIXYzfy7gecXmJlc187OEv0ccyNM0IWhgWkdUvKCPy2/MRt98B5 znY08fAU3MHBr32OlKRQugKUr2Kr12l74hbyvcCLvMX/mX8uD5SG78lX9b913iuiwQ OKrhSFto3HrAQ== Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 48B1661FAB for ; Fri, 16 Sep 2022 12:37:43 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="LSPlB4g7"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663324662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xgmP2jvNq4Aci3qEkXLz9LFniveEsEPiTEvFREL+XSQ=; b=LSPlB4g7Q0WYh5h/aC9wK8+GZcCcXJ9txmRMMhWgHAS72Zrn4E7+azbw8alsU4r6pLtkwQ 4RD02Wh+p36y8nL36bmVmzT4BqERrZupl0TWRt0M8aFkRZOWeYklK56PbvouVasQTXksX+ MvQpYXWL8xM1p1Z7hTAGi7O3ukcjZw4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-619-LW7X2-2eNQKYh4huN1Qe7g-1; Fri, 16 Sep 2022 06:37:40 -0400 X-MC-Unique: LW7X2-2eNQKYh4huN1Qe7g-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 76F7F185A792 for ; Fri, 16 Sep 2022 10:37:40 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.39.193.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id 678FC40C83EB; Fri, 16 Sep 2022 10:37:38 +0000 (UTC) To: libcamera devel , Hans De Goede Date: Fri, 16 Sep 2022 18:37:12 +0800 Message-Id: <20220916103713.21132-3-hpa@redhat.com> In-Reply-To: <20220916103713.21132-1-hpa@redhat.com> References: <20220916103713.21132-1-hpa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [libcamera-devel] [PATCH 2/3] ipa: ipu3: Drive requestQueue when controls are accepted X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Kate Hsuan via libcamera-devel From: Kate Hsuan Reply-To: Kate Hsuan Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Drive and dispatch the controls to the algorithms when the controls are received. Signed-off-by: Kate Hsuan --- src/ipa/ipu3/ipu3.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp index ac0c42a7..4f64a546 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -657,6 +657,9 @@ void IPAIPU3::queueRequest(const uint32_t frame, const ControlList &controls) { /* \todo Start processing for 'frame' based on 'controls'. */ context_.frameContexts[frame % kMaxFrameContexts] = { frame, controls }; + + for (auto const &algo : algorithms()) + algo->queueRequest(context_, frame, controls); } /** From patchwork Fri Sep 16 10:37:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 17377 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 49D9FC3272 for ; Fri, 16 Sep 2022 10:37:49 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E8CAC6208F; Fri, 16 Sep 2022 12:37:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1663324668; bh=EzhGxGjctKdsR7YJHD/qd9HhfmpwnUT20OnjG62q8UE=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=PSV/xpMtFslgr7Nnjrmuxet3eyVk4xhs7sgfpgrKs4bQtIte/lA4dLDmPo4XbqTlP WTSFMvD9/hfDLVq07bS4DXF666pJJprI+U5gGfINyVUq8NfSZSbF3f/4deAneyzbyx oeVVrUL1hHUcM3DyHxPKhKBu7Vu0qT0JY0/G5gayqk8f7SytNGzeYFS806/zcLEKih dWn6hvX9THrIB4a47MfAOzYtjhOfac3xG/tH4F4aT+wQ2kcedyyUQduXrAfKFt3lY/ LWGQovGQQ2AUMBWpcnrU+3U/Adj4e49ANHsJ0unw+ggRy6hi9BIj9QWpVE+HQwObNf gKzgy6so/86YQ== Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 60F2761FB7 for ; Fri, 16 Sep 2022 12:37:47 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="RaPxFG2X"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663324666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LHGod8qOBDpSdbsgZjzmaChqt6EtIlH8wVkl3t9neO0=; b=RaPxFG2XzLcwVnuev1ZrWSSP6UQ9S/MqzsMs7u5w/uGN8JmjRHPwlWycxKwPqHa5EtD+tN QQfmR570oIM5fYxdCqq4PDTXQA8ikDno79rDN0XEbPv5PeMEQIJXheLT2oOfTaArgz0PVi 02Cc2mnnxQUplKlTzo8TFxhNSIV52AQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-312-Z8fWpUbWPeudzNX4Rnhdww-1; Fri, 16 Sep 2022 06:37:45 -0400 X-MC-Unique: Z8fWpUbWPeudzNX4Rnhdww-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 497DD101A528 for ; Fri, 16 Sep 2022 10:37:45 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.39.193.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id 35BA040C83EB; Fri, 16 Sep 2022 10:37:42 +0000 (UTC) To: libcamera devel , Hans De Goede Date: Fri, 16 Sep 2022 18:37:13 +0800 Message-Id: <20220916103713.21132-4-hpa@redhat.com> In-Reply-To: <20220916103713.21132-1-hpa@redhat.com> References: <20220916103713.21132-1-hpa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [libcamera-devel] [PATCH 3/3] ipa: ipu3: af: AfMode and LensPosition control implementation X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Kate Hsuan via libcamera-devel From: Kate Hsuan Reply-To: Kate Hsuan Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" AfMode controls include manual, auto, and continuous modes. For auto and continuous modes, both of the algorithms try to keep the image focused. The difference between them is that continuous mode has higher sensitivity to the change of image variance than auto mode. So, the AF is frequently triggered in continuous mode. The user-defined lens position can only be set in manual mode. Signed-off-by: Kate Hsuan --- src/ipa/ipu3/algorithms/af.cpp | 106 ++++++++++++++++++++++++++++----- src/ipa/ipu3/algorithms/af.h | 15 +++++ 2 files changed, 105 insertions(+), 16 deletions(-) diff --git a/src/ipa/ipu3/algorithms/af.cpp b/src/ipa/ipu3/algorithms/af.cpp index 4835a034..c57d3e18 100644 --- a/src/ipa/ipu3/algorithms/af.cpp +++ b/src/ipa/ipu3/algorithms/af.cpp @@ -21,6 +21,8 @@ #include +#include + #include #include "libipa/histogram.h" @@ -109,7 +111,8 @@ static struct ipu3_uapi_af_filter_config afFilterConfigDefault = { */ Af::Af() : focus_(0), bestFocus_(0), currentVariance_(0.0), previousVariance_(0.0), - coarseCompleted_(false), fineCompleted_(false) + coarseCompleted_(false), fineCompleted_(false), maxChange_(kMaxChange), + afMode_(controls::AfModeAuto) { } @@ -194,6 +197,69 @@ int Af::configure(IPAContext &context, const IPAConfigInfo &configInfo) return 0; } +/** + * \brief AF controls handler + * + * Put the control parameter to the corresponding variables when receiving the controls + * from the user. + * \param[in] context The shared IPA context + * \param[in] frame Frame number + * \param[in] controls control list of the request + */ +void Af::queueRequest([[maybe_unused]] IPAContext &context, + [[maybe_unused]] const uint32_t frame, + const ControlList &controls) +{ + for (auto const &ctrl : controls) { + unsigned int ctrlEnum = ctrl.first; + const ControlValue &ctrlValue = ctrl.second; + + switch (ctrlEnum) { + case controls::AF_MODE: + afModeSet(ctrlValue.get()); + break; + case controls::LENS_POSITION: + lensPosition_ = ctrlValue.get(); + } + } +} + +/** + * \brief AF Mode set + * + * Set AF mode, including manual, auto, and continuous. + * + * \param[in] AF operation mode 0, 1, 2 are manual, auto, and continuous, respectively. + */ + +void Af::afModeSet(uint32_t mode) +{ + switch (mode) { + case controls::AfModeManual: + case controls::AfModeAuto: + afMode_ = mode; + break; + case controls::AfModeContinuous: + afMode_ = mode; + maxChange_ = 0.05; + break; + default: + afMode_ = controls::AfModeAuto; + } + + LOG(IPU3Af, Debug) << "AfMode set " << mode; +} + +/** + * \brief Set lens position + * + * Set user-defined lens position to the focus steps. + */ +void Af::afLensPositionSet(IPAContext &context) +{ + context.activeState.af.focus = kMaxFocusSteps * lensPosition_; +} + /** * \brief AF coarse scan * @@ -397,7 +463,7 @@ bool Af::afIsOutOfFocus(IPAContext context) << " Current VCM step: " << context.activeState.af.focus; - if (var_ratio > kMaxChange) + if (var_ratio > maxChange_) return true; else return false; @@ -432,21 +498,29 @@ void Af::process(IPAContext &context, [[maybe_unused]] IPAFrameContext *frameCon Span y_items(reinterpret_cast(&stats->af_raw_buffer.y_table), afRawBufferLen); - /* - * Calculate the mean and the variance of AF statistics for a given grid. - * For coarse: y1 are used. - * For fine: y2 results are used. - */ - currentVariance_ = afEstimateVariance(y_items, !coarseCompleted_); + switch (afMode_) { + case controls::AfModeManual: + afLensPositionSet(context); + break; + case controls::AfModeContinuous: + case controls::AfModeAuto: + default: + /* + * Calculate the mean and the variance of AF statistics for a given grid. + * For coarse: y1 are used. + * For fine: y2 results are used. + */ + currentVariance_ = afEstimateVariance(y_items, !coarseCompleted_); - if (!context.activeState.af.stable) { - afCoarseScan(context); - afFineScan(context); - } else { - if (afIsOutOfFocus(context)) - afReset(context); - else - afIgnoreFrameReset(); + if (!context.activeState.af.stable) { + afCoarseScan(context); + afFineScan(context); + } else { + if (afIsOutOfFocus(context)) + afReset(context); + else + afIgnoreFrameReset(); + } } } diff --git a/src/ipa/ipu3/algorithms/af.h b/src/ipa/ipu3/algorithms/af.h index ccf015f3..77bab2a7 100644 --- a/src/ipa/ipu3/algorithms/af.h +++ b/src/ipa/ipu3/algorithms/af.h @@ -26,6 +26,7 @@ class Af : public Algorithm uint16_t y1_avg; uint16_t y2_avg; } y_table_item_t; + public: Af(); ~Af() = default; @@ -34,6 +35,9 @@ public: int configure(IPAContext &context, const IPAConfigInfo &configInfo) override; void process(IPAContext &context, IPAFrameContext *frameContext, const ipu3_uapi_stats_3a *stats) override; + void queueRequest([[maybe_unused]] IPAContext &context, + [[maybe_unused]] const uint32_t frame, + [[maybe_unused]] const ControlList &controls) override; private: void afCoarseScan(IPAContext &context); @@ -46,6 +50,11 @@ private: bool afIsOutOfFocus(IPAContext context); + void afModeSet(uint32_t mode); + void afModeGet(); + + void afLensPositionSet(IPAContext &context); + /* VCM step configuration. It is the current setting of the VCM step. */ uint32_t focus_; /* The best VCM step. It is a local optimum VCM step during scanning. */ @@ -62,6 +71,12 @@ private: bool coarseCompleted_; /* If the fine scan completes, it is set to true. */ bool fineCompleted_; + /* Max focus change ratio to determine */ + double maxChange_; + /* Relative lens position in percentage. */ + double lensPosition_; + /* Af operation mode. */ + uint32_t afMode_; }; } /* namespace ipa::ipu3::algorithms */