From patchwork Wed Feb 10 11:17:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 11205 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 1E1BCBD16C for ; Wed, 10 Feb 2021 11:17:51 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DC14461631; Wed, 10 Feb 2021 12:17:50 +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="ppX+AkQA"; dkim-atps=neutral Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2FF7760300 for ; Wed, 10 Feb 2021 12:17:49 +0100 (CET) Received: by mail-ej1-x62a.google.com with SMTP id w1so3391505ejf.11 for ; Wed, 10 Feb 2021 03:17:49 -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=2uPjPtRGwcM8UxYCkq6ukzmkPLRNZbgsghs2S7MjZSI=; b=ppX+AkQAiTlxp+VZzmI8rm60cAm/fb7weGpNj7GKQMeP0UvQb8N1Rya329ltnAZRTC UwDEJ7oF+46RjFBDsIWRFb1b9ciLm/gVwHeD1AWz5XP/v3lsGiDAVUNWg79n4I/b2dqF 8Q5hyBPyyy/Ip6ACOqiZ3L82LB8G1+Mx9fwPS94XVjWUyEc6OM47M9cRPd0qghjz4Ftg +0Fe7Sy9C4B6OTNbOlDc5vtsDEPgQ7u1x/nIda9pmiu+Gx+NjkpQmKJBzPVNahR0RNya 5v2wctEYVZYvIxgANrg02w56Y9pVfcV2gqzy3dkXXtRfxy54PFdPsB/hDzWvN7DLxFQS 6Q1w== 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=2uPjPtRGwcM8UxYCkq6ukzmkPLRNZbgsghs2S7MjZSI=; b=A+mMZ3BiEDcnHoDz8ZYzuhNl+wmmscZcPk74Mfgy+6S2ve10WpSvX4qh7ggGUqxWtt VnKuTQ4CrVUOVNnW/2w5HTZJlWsFtrKLFS0huPZnxJe24Q9KuYJMBRRuUdt+df5axfMI IgvHfVyv+fK3hCPSUd/eWTaalZPcrHE8dHGkD91tDhcGLRIavBkjv7afD0pEVGP4rsHg Trhh1sgJgsZj4cup2DfOPP6gVQw43WocpIGuwrtvNxKcWT07D0Qt8f0a3d52udtl2CPz AejKvN8vQBb/6z7Bacb+Y1V3miLO7F3jV6vHsptrBTCfDCgsWZbBhGDVLE2PjBuHpzCK 51zQ== X-Gm-Message-State: AOAM531dynWRHjyc8RENhfzZibVYmLP8knZcbIGchWhmm0yoZ3ecqAga qqfHYP4WjiY4pxQQQqbGBTTFAjfgdObeQ8zY X-Google-Smtp-Source: ABdhPJyeB0nrjZXlI0hch8rdJtOioMFNI1LrLSxaEYH48/AVwzpVdrTicfiCY/LIzzkyZdLmH5M6Jw== X-Received: by 2002:a17:907:2058:: with SMTP id pg24mr2381793ejb.441.1612955868540; Wed, 10 Feb 2021 03:17:48 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id dt17sm892659ejb.70.2021.02.10.03.17.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Feb 2021 03:17:48 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Wed, 10 Feb 2021 11:17:42 +0000 Message-Id: <20210210111743.14374-2-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210210111743.14374-1-david.plowman@raspberrypi.com> References: <20210210111743.14374-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/2] ipa: raspberrypi: AWB: Remove unecessary 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_;