{"id":25854,"url":"https://patchwork.libcamera.org/api/patches/25854/?format=json","web_url":"https://patchwork.libcamera.org/patch/25854/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260120083952.15338-1-jacopo.mondi@ideasonboard.com>","date":"2026-01-20T08:39:49","name":"ipa: libipa: fixedpoint: Expand documentation on sign bit","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"5ec7744c7d74779cc9ad16089d47a14b92c59347","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/?format=json","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/25854/mbox/","series":[{"id":5719,"url":"https://patchwork.libcamera.org/api/series/5719/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5719","date":"2026-01-20T08:39:49","name":"ipa: libipa: fixedpoint: Expand documentation on sign bit","version":1,"mbox":"https://patchwork.libcamera.org/series/5719/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/25854/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/25854/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 0076EC3220\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 20 Jan 2026 08:40:01 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DA3DB61FBF;\n\tTue, 20 Jan 2026 09:40:00 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 46DBC61F84\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 20 Jan 2026 09:39:59 +0100 (CET)","from ideasonboard.com (unknown\n\t[IPv6:2001:b07:6462:5de2:520d:d7a3:63ca:99e8])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D00971733;\n\tTue, 20 Jan 2026 09:39:27 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"OKYV0Zee\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1768898368;\n\tbh=nhBEs/vulo4lXzSxImOJXBozPzzWK9oolqgqUjJbqac=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=OKYV0ZeefAPIdtqU0IIwPSW6evxtE2DgKo5kv5G9wiRIrf4+ZMs3InwH6P70kpEDl\n\tNHJgsI/7nQjkVdr/Ir09HBd0lxenC9IXg8sTEQNuaIzcPM877Zx+Xrmv7J8hC74it0\n\tdonUnadRobvgvjLTDNM8qjERBRbi60EsC/oSXclI=","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tPaul Elder <paul.elder@ideasonboard.com>","Subject":"[PATCH] ipa: libipa: fixedpoint: Expand documentation on sign bit","Date":"Tue, 20 Jan 2026 09:39:49 +0100","Message-ID":"<20260120083952.15338-1-jacopo.mondi@ideasonboard.com>","X-Mailer":"git-send-email 2.52.0","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Converting numbers with a signed fixed-point representation to\nthe corresponding float value requires to include the sign bit in the\nwidth of the fixed-point integral part.\n\nClearly specify it in documentation.\n\nSigned-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n---\n src/ipa/libipa/fixedpoint.cpp | 22 +++++++++++++++++++++-\n 1 file changed, 21 insertions(+), 1 deletion(-)\n\n--\n2.52.0","diff":"diff --git a/src/ipa/libipa/fixedpoint.cpp b/src/ipa/libipa/fixedpoint.cpp\nindex 6b698fc5d680..b37cdc43936f 100644\n--- a/src/ipa/libipa/fixedpoint.cpp\n+++ b/src/ipa/libipa/fixedpoint.cpp\n@@ -29,11 +29,31 @@ namespace ipa {\n /**\n  * \\fn R fixedToFloatingPoint(T number)\n  * \\brief Convert a fixed-point number to a floating point representation\n- * \\tparam I Bit width of the integer part of the fixed-point\n+ * \\tparam I Bit width of the integer part of the fixed-point including the\n+ * optional sign bit\n  * \\tparam F Bit width of the fractional part of the fixed-point\n  * \\tparam R Return type of the floating point representation\n  * \\tparam T Input type of the fixed-point representation\n  * \\param number The fixed point number to convert to floating point\n+ *\n+ * If the fixed-point representation is signed, the sign bit shall be included\n+ * in the \\a I template parameter that specifies the number of bits of the\n+ * integral part of the fixed-point representation.\n+ *\n+ * As an example, a value represented as signed fixed-point Q4.8 format can be\n+ * converted to its corresponding floating point representation as:\n+ *\n+ * \\code{.cpp}\n+ * double d = fixedToFloatingPoint<5, 8, double, uint16_t>(fixed);\n+ * \\endcode\n+ *\n+ * While a value represented as unsigned fixed-point Q4.8 format can be\n+ * converted as:\n+ *\n+ * \\code{.cpp}\n+ * double d = fixedToFloatingPoint<4, 8, double, uint16_t>(fixed);\n+ * \\endcode\n+ *\n  * \\return The converted value\n  */\n\n","prefixes":[]}