From patchwork Thu Sep 8 01:41:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 17311 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 1043BC3272 for ; Thu, 8 Sep 2022 01:42:23 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B37376209B; Thu, 8 Sep 2022 03:42:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1662601342; bh=E9b69VVLHcujLlP+GqAxNm3BvaWK50WgqW9V8xE4yIg=; 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=WswsMMv0vE+wkvbit9BGOtj+fMQsT3ov8wcv/HbHPioUu826iqoqiA/kh/p2Ub4ix TU9xLJevKpv7vf8k/v7Bj1+9wO6FZsrEjmlRXQIln96d1ftEKXH7dab2f/VEbd9k2v TSaJkuO/qrrpFUFC/BXblJtoax5WQT8hRQhfWsNViruZJX39lBHxrphtcOBBC4IRu2 j4eUJqkrOPEmIEC7aGIkT9ZVZaVD2dpA072WVjcgQ6w37X+9P0Uyu/CUGspdcYh36B 8n23kZ7YVQk/ZFmCuUI6cbyRpSo7NWZPyAEqU90QzsYt4BiJQYMUptJK0m2c/+rPdd dC9HRij7kqXdA== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 91A8B6208F for ; Thu, 8 Sep 2022 03:42:20 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="mJTKMlLI"; dkim-atps=neutral Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1A2736CC for ; Thu, 8 Sep 2022 03:42:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1662601340; bh=E9b69VVLHcujLlP+GqAxNm3BvaWK50WgqW9V8xE4yIg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mJTKMlLIH4HCu3n3zcj/lluGQTuhJv2kWkU+CO0i5mlNNpJDW5+7c8ol+UyvwcfGo fNAT+Wo1WPbrLW+Mg37Gjt8aToMeOfHZB6olf6zxB8bfIatFeyRcBKtXC2BGlBi2X6 K6cQbJz4Vg7CtLbj30gFvQvJPT8pWmrXJBec9iXs= To: libcamera-devel@lists.libcamera.org Date: Thu, 8 Sep 2022 04:41:30 +0300 Message-Id: <20220908014200.28728-3-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220908014200.28728-1-laurent.pinchart@ideasonboard.com> References: <20220908014200.28728-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 02/32] ipa: ipu3: af: Pass context reference to afIsOutOfFocus() 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: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Avoid copying the whole IPA context by passing a reference to the Af::afIsOutOfFocus() function. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Jacopo Mondi --- src/ipa/ipu3/algorithms/af.cpp | 2 +- src/ipa/ipu3/algorithms/af.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ipa/ipu3/algorithms/af.cpp b/src/ipa/ipu3/algorithms/af.cpp index 106a7614e2c7..9127c24f1287 100644 --- a/src/ipa/ipu3/algorithms/af.cpp +++ b/src/ipa/ipu3/algorithms/af.cpp @@ -383,7 +383,7 @@ double Af::afEstimateVariance(Span y_items, bool isY1) * \return True if the variance threshold is crossed indicating lost focus, * false otherwise */ -bool Af::afIsOutOfFocus(IPAContext context) +bool Af::afIsOutOfFocus(IPAContext &context) { const uint32_t diff_var = std::abs(currentVariance_ - context.activeState.af.maxVariance); diff --git a/src/ipa/ipu3/algorithms/af.h b/src/ipa/ipu3/algorithms/af.h index ccf015f3f8f5..9b93594898bb 100644 --- a/src/ipa/ipu3/algorithms/af.h +++ b/src/ipa/ipu3/algorithms/af.h @@ -44,7 +44,7 @@ private: void afIgnoreFrameReset(); double afEstimateVariance(Span y_items, bool isY1); - bool afIsOutOfFocus(IPAContext context); + bool afIsOutOfFocus(IPAContext &context); /* VCM step configuration. It is the current setting of the VCM step. */ uint32_t focus_;