From patchwork Fri Nov 14 00:54:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 25051 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 92507C3337 for ; Fri, 14 Nov 2025 00:55:13 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 397F260AAB; Fri, 14 Nov 2025 01:55:13 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="kizGMTfY"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3C74760AB6 for ; Fri, 14 Nov 2025 01:54:55 +0100 (CET) Received: from charm.hippo-penny.ts.net (cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B0C9C21D0; Fri, 14 Nov 2025 01:52:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1763081574; bh=uth9B+Igoo2je6o6stn0vFxruvyE8aKvrJFiExHl6BI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kizGMTfYWU4Rj5YZ6njEzoaAZCIVuVek4naIOuhryvhWCUAAqTLR3n4EYRlRka9oq 4CrEEIKlopwM/I36aETOkv4IsFHvG/Wm74mgW/FQzNk80ier326nGGjXFbCDAXi9CG nWUk361wTSuzXC3SYw7z/8qO0sjd5JJ4GBmDyfaU= From: Kieran Bingham To: libcamera devel Cc: Kieran Bingham Subject: [PATCH v4 21/21] ipa: libipa: fixedpoint: Remove unsigned workaround Date: Fri, 14 Nov 2025 00:54:25 +0000 Message-ID: <20251114005428.90024-22-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251114005428.90024-1-kieran.bingham@ideasonboard.com> References: <20251114005428.90024-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 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" Now that we no longer attempt or allow storing signed negative floats as an unsigned integer representation, remove the workaround which required an intermediate cast when converting floats to fixed point values. Signed-off-by: Kieran Bingham --- src/ipa/libipa/fixedpoint.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/ipa/libipa/fixedpoint.h b/src/ipa/libipa/fixedpoint.h index fe75af16bb54..fd57826d0ac0 100644 --- a/src/ipa/libipa/fixedpoint.h +++ b/src/ipa/libipa/fixedpoint.h @@ -63,12 +63,7 @@ struct FixedPointQTraits { { v = std::clamp(v, min, max); - /* - * The intermediate cast to int is needed on arm platforms to properly - * cast negative values. See - * https://embeddeduse.com/2013/08/25/casting-a-negative-float-to-an-unsigned-int/ - */ - return static_cast(static_cast(std::round(v * (1 << F)))) & BitMask; + return static_cast(std::round(v * (1 << F))) & BitMask; } };