From patchwork Wed Feb 10 17:58:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 11209 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 23CF9BD160 for ; Wed, 10 Feb 2021 17:58:39 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E4B6D61646; Wed, 10 Feb 2021 18:58:38 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="h8nxRuoh"; dkim-atps=neutral Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 08A1C6162E for ; Wed, 10 Feb 2021 18:58:36 +0100 (CET) Received: by mail-ej1-x636.google.com with SMTP id w1so5706301ejf.11 for ; Wed, 10 Feb 2021 09:58:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=W6MmJZJLGnwy72pggNNug9dowL58ofDKZhSOvEPLblo=; b=h8nxRuoh1SARBZMvIbkIUJtjZ3mv+G93EB0YtsDMHD2TmfL3K/BaE9FCr2XwsCalZ2 /MVSZ6IWqJAp/VmCP1R3JZDPs27t9JxADDZoI+KQci92ANsvx9GeunnCnhPe/C2NSI5I lfjG/19LxdiBRSkR5Cx/WBLMTI3re9ZzdhUxDw4Jeuxv5nDBJZGZFuonfXKECCZ0/U8V uMZRaUiCmGxhrwrAHSuyC0gvgJSfoU2ZG8X6wb0sL2AoAvde6wq6qbssfyMB7wjOU3GT ednNPUm8DCuAPMuvDbtw09Pu3+HaRysAZcnG9dOvpGJ2DnS/Yz6slDaxujr8Z7BpQilJ /CCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=W6MmJZJLGnwy72pggNNug9dowL58ofDKZhSOvEPLblo=; b=DvDdm2fGczXUzZM5aWubnkn5tCVQ4+4MG3OovfYGucW0MR3Z8UPkUWGhLBs226Ka75 TAAyDS6VgnAshCxGnrXOl0YDyFc33qWbhUNoY2ztSl0wsLAI8cPCaGCf5ws7LmkqKRq7 Wvjtjbm6nqk3cG4ER6/dmSNVANUtDcP6GhUyFdSHoZsQ16jeeHYK2KcgeTTDXC6xhPbQ 1MP0hVEsZtq1XlQbFSrtX7nYIkX8+E7xwTyvN7l79wiBz1qiWnBgOozqXgCae2h1WOrY Gy/SvowX+Gqvfnop3xJTPgjdHnWWk5EpGsGF/Z/69NnTN4vkIhw4EQPRfmeI3FlMfUca Mfdg== X-Gm-Message-State: AOAM531zYOzBTKfxbSL5TcIK+L+Z3aWC3vJ6t2WHcTrS8P/SFjJr7QiT nDQWHr2dxpzKRS+bAeXfyQUMNYhddW/JfVTd X-Google-Smtp-Source: ABdhPJyT8/ys/+BEdL3pXcuAb+cMB+4xo49RL9kSr2oFw4yXT+DYVxprW4PrTQcOgnPHt3I20WybFg== X-Received: by 2002:a17:906:d19b:: with SMTP id c27mr4159864ejz.234.1612979915186; Wed, 10 Feb 2021 09:58:35 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id hc13sm1660483ejc.5.2021.02.10.09.58.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Feb 2021 09:58:34 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Wed, 10 Feb 2021 17:58:29 +0000 Message-Id: <20210210175830.32038-2-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210210175830.32038-1-david.plowman@raspberrypi.com> References: <20210210175830.32038-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 1/2] ipa: raspberrypi: AWB: Remove unnecessary frame count variable 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" The variable frame_count2_ is not needed as Prepare() and Process() always run in lock step one after the other. Signed-off-by: David Plowman Reviewed-by: Laurent Pinchart Reviewed-by: Naushir Patuck --- src/ipa/raspberrypi/controller/rpi/awb.cpp | 6 ++---- src/ipa/raspberrypi/controller/rpi/awb.hpp | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/ipa/raspberrypi/controller/rpi/awb.cpp b/src/ipa/raspberrypi/controller/rpi/awb.cpp index 791b5108..1c65eda8 100644 --- a/src/ipa/raspberrypi/controller/rpi/awb.cpp +++ b/src/ipa/raspberrypi/controller/rpi/awb.cpp @@ -153,7 +153,7 @@ void Awb::Read(boost::property_tree::ptree const ¶ms) void Awb::Initialise() { - frame_count2_ = frame_count_ = frame_phase_ = 0; + frame_count_ = frame_phase_ = 0; // Put something sane into the status that we are filtering towards, // just in case the first few frames don't have anything meaningful in // them. @@ -288,11 +288,9 @@ void Awb::Process(StatisticsPtr &stats, Metadata *image_metadata) // Count frames since we last poked the async thread. if (frame_phase_ < (int)config_.frame_period) frame_phase_++; - if (frame_count2_ < (int)config_.startup_frames) - frame_count2_++; LOG(RPiAwb, Debug) << "frame_phase " << frame_phase_; if (frame_phase_ >= (int)config_.frame_period || - frame_count2_ < (int)config_.startup_frames) { + frame_count_ < (int)config_.startup_frames) { // Update any settings and any image metadata that we need. struct LuxStatus lux_status = {}; lux_status.lux = 400; // in case no metadata diff --git a/src/ipa/raspberrypi/controller/rpi/awb.hpp b/src/ipa/raspberrypi/controller/rpi/awb.hpp index 1b39ab4b..f113c642 100644 --- a/src/ipa/raspberrypi/controller/rpi/awb.hpp +++ b/src/ipa/raspberrypi/controller/rpi/awb.hpp @@ -130,7 +130,6 @@ private: // counts up to frame_period before restarting the async thread int frame_phase_; int frame_count_; // counts up to startup_frames - int frame_count2_; // counts up to startup_frames for Process method AwbStatus sync_results_; AwbStatus prev_sync_results_; std::string mode_name_;