From patchwork Fri May 8 16:51:31 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Javier Tia X-Patchwork-Id: 26698 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 5D6D1BE173 for ; Fri, 8 May 2026 17:17:25 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D83386301A; Fri, 8 May 2026 19:17:22 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=jetm.me header.i=@jetm.me header.b="S6hOQHRD"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="W4KMnp58"; dkim-atps=neutral Received: from fout-a6-smtp.messagingengine.com (fout-a6-smtp.messagingengine.com [103.168.172.149]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9982862FD3 for ; Fri, 8 May 2026 19:17:21 +0200 (CEST) Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.phl.internal (Postfix) with ESMTP id BE71EEC031B; Fri, 8 May 2026 13:17:20 -0400 (EDT) Received: from phl-imap-07 ([10.202.2.97]) by phl-compute-02.internal (MEProxy); Fri, 08 May 2026 13:17:20 -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=1778260640; x=1778347040; bh=WGp5pPWv3ZJWioyHVGrRotRTUE9E6dv0omfYBxarq/I=; b= S6hOQHRDq9mI9pjmNqspJbBR47p6ZYc/k3NZGud9ZKxdd+XuYKtB5NFaPsfZ4a4C TZcWR0Q0Ieyshcm5l4+XpDOCza+2KB/BHbcA4DJ0v20fOKUNw/r6pl6bIncEqkCQ t4kIywLkOidpRIodupxLkOMdT3aNbA7r+uvPn9P7FYl4VqkDU5NG0uo4MAYsp2NM snqCi1guX3zkgUofckbZ1JmDAuHLf5jOgKOFguQWKeK+pvw1JB7+ty9fq8o9G9Qa WLHljtibIj4xaUFHEwMh0/G24AVhpapoWmmy8/fTjqqd0NcfGiv2GQqsEAMraceT s97F97/Ujk8U9651klCWAw== 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=1778260640; x= 1778347040; bh=WGp5pPWv3ZJWioyHVGrRotRTUE9E6dv0omfYBxarq/I=; b=W 4KMnp58XNw7Z50aqKAJQ1f3RxPGfmMjxLyAUNQduEk7aJgptq1tug/GU+VhB5Z5A R+4bufewh2TdfwV8KYMBBLmW1KLGhWfGo5KUbyUQFfZ01qtJO40xHUEVxci0ChVM NYCU4GK74Cmvu1kTRLYzJT3dLOIk8k7APcuAGXBuKKbA59gTUv8LGisMxyQKT9Qo cDl8o92Z2dO7r6rQZiDJHqkBmDfRUlgjiMqnxGeSBPIK4Fmh+AiutZof/JGu+MfS yjDAwzaFRZlzocZHcBEy/Jxv9sm7E1GYVjLMkzQfyjVAxiQGFEQTg/lzspmSacOL 6XIs3/BUdiyuVILK5Q/5A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdduuddtledvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucgopfhokfffucdluddtmdenucfjughrpefotggggffhvf ffufevjghfsehtkedttdertdejnecuhfhrohhmpeflrghvihgvrhcuvfhirgcuoehflhho shhssehjvghtmhdrmhgvqeenucggtffrrghtthgvrhhnpedtudejffejkeekteelueefvd ejvdeuhfefteehkeevtddvleduteekleetvdelhfenucevlhhushhtvghrufhiiigvpedt necurfgrrhgrmhepmhgrihhlfhhrohhmpehflhhoshhssehjvghtmhdrmhgvpdhnsggprh gtphhtthhopeejpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehrohgsvghrthdr mhgruggvrhestgholhhlrggsohhrrgdrtghomhdprhgtphhtthhopegsrghrnhgrsggrsh drphhotgiivgesihguvggrshhonhgsohgrrhgurdgtohhmpdhrtghpthhtohepkhhivghr rghnrdgsihhnghhhrghmsehiuggvrghsohhnsghorghrugdrtghomhdprhgtphhtthhope hlrghurhgvnhhtrdhpihhntghhrghrthesihguvggrshhonhgsohgrrhgurdgtohhmpdhr tghpthhtoheplhhisggtrghmvghrrgdquggvvhgvlheslhhishhtshdrlhhisggtrghmvg hrrgdrohhrghdprhgtphhtthhopehjohhhrghnnhgvshdrghhovgguvgesohhsshdrqhhu rghltghomhhmrdgtohhmpdhrtghpthhtohepmhiirghmrgiirghlsehrvgguhhgrthdrtg homh X-ME-Proxy: Feedback-ID: i9dde48b3:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 9B9D61EA006C; Fri, 8 May 2026 13:17:20 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 From: Javier Tia To: libcamera-devel@lists.libcamera.org Date: Fri, 08 May 2026 10:51:31 -0600 Subject: [PATCH v2 1/3] 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, johannes.goede@oss.qualcomm.com, robert.mader@collabora.com In-Reply-To: <177826063718.39714.13674874482653763631@jetm.me> References: <177826063718.39714.13674874482653763631@jetm.me> Message-Id: <20260508171720.9B9D61EA006C@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 Reviewed-by: Laurent Pinchart Reviewed-by: Barnabás Pőcze --- src/libcamera/software_isp/swstats_cpu.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/libcamera/software_isp/swstats_cpu.cpp b/src/libcamera/software_isp/swstats_cpu.cpp index b40d3334..2e020e62 100644 --- a/src/libcamera/software_isp/swstats_cpu.cpp +++ b/src/libcamera/software_isp/swstats_cpu.cpp @@ -362,11 +362,10 @@ 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;