From patchwork Tue Sep 27 02:36:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 17413 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 7B97EC327E for ; Tue, 27 Sep 2022 02:37:06 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D6C9A6226B; Tue, 27 Sep 2022 04:37:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1664246225; bh=IgPj/hYSSVv10M89+TU/t0ubOGRQoRKP/Tzn90mvxxg=; 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=wK83TBhyZ37ao8F1Lkb+7NcpM6V7Y1WZ/GDnf1wq9Z/RGkQ3PjOp5y/bfrveLVESE zbVtIrwXrg3uBhA0hgc3v5sPThqGZeWXmu4LLtF1cszlbptux19dLOTDLyRFzidS5I XjecL8h8w1PD0oqsN/fsdQyhl2lO0q0yiyXenZhWFiQ8PL4g+fXT2cmn5eUuSKsd51 CvHlOlBgcFmQ+FU7iVr8x5gQUczTa5gTEs5LLz4F89DGcuC5RTg7CHFOGNy9dwhBD3 Gi1ALCzwz9lBx0zsCkj9YJdN4GBx6Ff4r/VbpKVTupF2K55RVw2wSjxKKePicMyC4h 4oHTurHewwlYQ== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 110AC6225C for ; Tue, 27 Sep 2022 04:37:03 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="EOdkiwny"; 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 756C9E5 for ; Tue, 27 Sep 2022 04:37:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1664246222; bh=IgPj/hYSSVv10M89+TU/t0ubOGRQoRKP/Tzn90mvxxg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=EOdkiwnynJwP5eFU+nDcIfmnlFmIf7OhorXw29Tz2wz7bylmVhMN1Ger2fLM6/iq+ M0R8RvGbSZ0A5mBFziAzzsQJ60nuYnjCkRJ8QJ7Gyg4mtxDKjM6F7jmd8nIIdvEJfQ 14SGNJXKqa/y3v4HyE8v1JKWtOwKEbwLkrnjL6+8= To: libcamera-devel@lists.libcamera.org Date: Tue, 27 Sep 2022 05:36:11 +0300 Message-Id: <20220927023642.12341-3-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220927023642.12341-1-laurent.pinchart@ideasonboard.com> References: <20220927023642.12341-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 02/33] 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_;