From patchwork Thu May 7 16:03:15 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Tia X-Patchwork-Id: 26681 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 11A16C32F6 for ; Thu, 7 May 2026 16:11:06 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2341563021; Thu, 7 May 2026 18:11:04 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=jetm.me header.i=@jetm.me header.b="w9IJVhYi"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="KBXWuEkn"; dkim-atps=neutral Received: from fout-a4-smtp.messagingengine.com (fout-a4-smtp.messagingengine.com [103.168.172.147]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7F7B062010 for ; Thu, 7 May 2026 18:11:02 +0200 (CEST) Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.phl.internal (Postfix) with ESMTP id 9BC1EEC0308; Thu, 7 May 2026 12:11:01 -0400 (EDT) Received: from phl-imap-07 ([10.202.2.97]) by phl-compute-02.internal (MEProxy); Thu, 07 May 2026 12:11:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jetm.me; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1778170261; x=1778256661; bh=SeD4qlEY7jr+ru8ZGpWvNtjA9ersImqUmwLeC3Y7iAw=; b= w9IJVhYi8ZQGsyoBn4zcX3Ga7E2HlSguHoyLSfWlgABRLZwYHldmntXElvdTaHez ZTbK6MOo6DXGl+gZ9R1TyKCBAOYBLdRgfDq8eJXOCyVAHB8xxQR+JDg7euQSDIEL TutxmR6Z+OVuRDFi/Lu1iv+YMOr1icEGNJDJ3mIczyHnlQlLCC4zCi0aqRpubMET rD1ksw+1uiGDDMNW0xUr6XHBjy+ZkyLWzzZjp1vrVF8OQwGk9UNEaSNP2ojBsK/x DLFvyXO7Rj0eoIwVpDbvfDiWL1T7yLwG+MqSBOvhtirBxATGm6O8/WK8+8HpuUnt SZccUnHWzgjPGMxaFNqXKg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1778170261; x= 1778256661; bh=SeD4qlEY7jr+ru8ZGpWvNtjA9ersImqUmwLeC3Y7iAw=; b=K BXWuEkniPfz9Q8d9RIpdogx0BAYxie6AVPOHLc0CtPjTGBIL9THURSp24C36Icv0 /r1i0uxc9T4N40HNRwGBTZTQbMKu4MLuWUBJz1Z2C3/s3tNalbwprVpjzdBZNwwC USTaL+bYrP7mOrA6kIPcISBy3fbg8TTnuosRZ+QjhrswGvy5eThF9nBb/4Lq5C17 dY1mhhJ7/lrWh0LsRxaHV16fB3+A9N2BvFgHX3RCqwVpacu8gDx6FNdPVOBkRyMY qXDXuCd4D2bphsN/HjoWuVmhEadxoQiJqhPBbXLJHhYGjgUZahM533V9LdkVc5e5 uIarcCEiFfjYvTUvPx6pQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgddutdejledvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucgopfhokfffucdluddtmdenucfjughrpefotggggffhvf ffufevjghfsehtkedttdertdejnecuhfhrohhmpeflrghvihgvrhcuvfhirgcuoehflhho shhssehjvghtmhdrmhgvqeenucggtffrrghtthgvrhhnpedtudejffejkeekteelueefvd ejvdeuhfefteehkeevtddvleduteekleetvdelhfenucevlhhushhtvghrufhiiigvpedt necurfgrrhgrmhepmhgrihhlfhhrohhmpehflhhoshhssehjvghtmhdrmhgvpdhnsggprh gtphhtthhopeehpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegsrghrnhgrsggr shdrphhotgiivgesihguvggrshhonhgsohgrrhgurdgtohhmpdhrtghpthhtohepkhhivg hrrghnrdgsihhnghhhrghmsehiuggvrghsohhnsghorghrugdrtghomhdprhgtphhtthho pehlrghurhgvnhhtrdhpihhntghhrghrthesihguvggrshhonhgsohgrrhgurdgtohhmpd hrtghpthhtoheplhhisggtrghmvghrrgdquggvvhgvlheslhhishhtshdrlhhisggtrghm vghrrgdrohhrghdprhgtphhtthhopehmiigrmhgriigrlhesrhgvughhrghtrdgtohhm X-ME-Proxy: Feedback-ID: i9dde48b3:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 7D2CD1EA006B; Thu, 7 May 2026 12:11:01 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 From: Javier Tia To: libcamera-devel@lists.libcamera.org Date: Thu, 07 May 2026 10:03:15 -0600 Subject: [PATCH v1 1/2] libcamera: software_isp: Drop redundant sumShift_ guard in finishFrame Cc: mzamazal@redhat.com, kieran.bingham@ideasonboard.com, laurent.pinchart@ideasonboard.com, barnabas.pocze@ideasonboard.com In-Reply-To: <177817025814.1112523.8335692307235726369@jetm.me> References: <177817025814.1112523.8335692307235726369@jetm.me> Message-Id: <20260507161101.7D2CD1EA006B@mailuser.phl.internal> 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" Right-shifting by zero is a no-op, so the if (sumShift_) check before the three >>= sumShift_ assignments is unnecessary. Remove it. Suggested-by: Laurent Pinchart Suggested-by: Barnabas Pocze Signed-off-by: Javier Tia --- src/libcamera/software_isp/swstats_cpu.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/libcamera/software_isp/swstats_cpu.cpp b/src/libcamera/software_isp/swstats_cpu.cpp index b40d3334..d9011f41 100644 --- a/src/libcamera/software_isp/swstats_cpu.cpp +++ b/src/libcamera/software_isp/swstats_cpu.cpp @@ -362,11 +362,9 @@ void SwStatsCpu::finishFrame(uint32_t frame, uint32_t bufferId) for (unsigned int j = 0; j < SwIspStats::kYHistogramSize; j++) sharedStats_->yHistogram[j] += s.yHistogram[j]; } - if (sumShift_) { - sharedStats_->sum_.r() >>= sumShift_; - sharedStats_->sum_.g() >>= sumShift_; - sharedStats_->sum_.b() >>= sumShift_; - } + sharedStats_->sum_.r() >>= sumShift_; + sharedStats_->sum_.g() >>= sumShift_; + sharedStats_->sum_.b() >>= sumShift_; } sharedStats_->valid = valid;