From patchwork Fri Oct 15 01:58:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 14155 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 0E712C323E for ; Fri, 15 Oct 2021 01:58:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D448268F52; Fri, 15 Oct 2021 03:58:26 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="S6r3khiY"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CB27B68F4F for ; Fri, 15 Oct 2021 03:58:24 +0200 (CEST) Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 618E8B91; Fri, 15 Oct 2021 03:58:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1634263104; bh=7RLfVZI2/69O9jDyHPlWttlJmBIUPK6ylSME+R9PYN4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S6r3khiY9o7Z+e2b4pFR+aX3D4HuEXiKjaNhiauqREkAuLIlY2dl6p2k8WEEemcz7 VKOvHy6f8ti6PKw+U42oP7VDPxIDTqFa8JQ2f4Pvj3ElPzO0EChUj/E1sJHukuPJ49 oFwvsYKl0L73FknaYdaAs5paVl0en0r8TPvNhl1Q= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Fri, 15 Oct 2021 04:58:04 +0300 Message-Id: <20211015015804.11758-2-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211015015804.11758-1-laurent.pinchart@ideasonboard.com> References: <20211015015804.11758-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/2] ipa: ipu3: agc: Remove "using" directive from agc.h header 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" "using" directives are harmful in headers, as they propagate the namespace short-circuit to all files that include the header, directly or indirectly. Drop the directive from agc.h, and use utils::Duration explicitly. While at it, shorten the namespace qualifier from libcamera::utils:: to utils:: in agc.cpp for Duration. Signed-off-by: Laurent Pinchart Reviewed-by: Jean-Michel Hautbois Reviewed-by: Kieran Bingham Reviewed-by: Paul Elder --- src/ipa/ipu3/algorithms/agc.cpp | 6 +++--- src/ipa/ipu3/algorithms/agc.h | 14 ++++++-------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp index 5eafe82ca404..970ec42419cc 100644 --- a/src/ipa/ipu3/algorithms/agc.cpp +++ b/src/ipa/ipu3/algorithms/agc.cpp @@ -140,20 +140,20 @@ void Agc::lockExposureGain(uint32_t &exposure, double &gain) double newGain = kEvGainTarget * knumHistogramBins / iqMean_; /* extracted from Rpi::Agc::computeTargetExposure */ - libcamera::utils::Duration currentShutter = exposure * lineDuration_; + utils::Duration currentShutter = exposure * lineDuration_; currentExposureNoDg_ = currentShutter * gain; LOG(IPU3Agc, Debug) << "Actual total exposure " << currentExposureNoDg_ << " Shutter speed " << currentShutter << " Gain " << gain; currentExposure_ = currentExposureNoDg_ * newGain; - libcamera::utils::Duration maxTotalExposure = maxExposureTime_ * kMaxGain; + utils::Duration maxTotalExposure = maxExposureTime_ * kMaxGain; currentExposure_ = std::min(currentExposure_, maxTotalExposure); LOG(IPU3Agc, Debug) << "Target total exposure " << currentExposure_; /* \todo: estimate if we need to desaturate */ filterExposure(); - libcamera::utils::Duration newExposure = 0.0s; + utils::Duration newExposure = 0.0s; if (currentShutter < maxExposureTime_) { exposure = std::clamp(static_cast(exposure * currentExposure_ / currentExposureNoDg_), kMinExposure, kMaxExposure); newExposure = currentExposure_ / exposure; diff --git a/src/ipa/ipu3/algorithms/agc.h b/src/ipa/ipu3/algorithms/agc.h index 64b71c65ef00..e0c315fc126c 100644 --- a/src/ipa/ipu3/algorithms/agc.h +++ b/src/ipa/ipu3/algorithms/agc.h @@ -21,8 +21,6 @@ struct IPACameraSensorInfo; namespace ipa::ipu3::algorithms { -using utils::Duration; - class Agc : public Algorithm { public: @@ -43,13 +41,13 @@ private: double iqMean_; - Duration lineDuration_; - Duration maxExposureTime_; + utils::Duration lineDuration_; + utils::Duration maxExposureTime_; - Duration prevExposure_; - Duration prevExposureNoDg_; - Duration currentExposure_; - Duration currentExposureNoDg_; + utils::Duration prevExposure_; + utils::Duration prevExposureNoDg_; + utils::Duration currentExposure_; + utils::Duration currentExposureNoDg_; uint32_t stride_; };