[{"id":36874,"web_url":"https://patchwork.libcamera.org/comment/36874/","msgid":"<176346955167.880260.14478465597974059630@isaac-ThinkPad-T16-Gen-2>","date":"2025-11-18T12:39:11","subject":"Re: [PATCH v4 08/21] ipa: libipa: Provide Q5.8 FixedPoint support","submitter":{"id":215,"url":"https://patchwork.libcamera.org/api/people/215/","name":"Isaac Scott","email":"isaac.scott@ideasonboard.com"},"content":"Hi Kieran,\n\nThank you for the patch!\n\nReviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>\n\nQuoting Kieran Bingham (2025-11-14 00:54:12)\n> Provide a FixedPoint Quantized type to support the Q5.8 format\n> representing values in the range [0 .. 31.9961] with a resolution of\n> 1/256.\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> ---\n> This type is used by the Mali-C55 Digital Gain component.\n> \n>  src/ipa/libipa/fixedpoint.cpp  | 9 +++++++++\n>  src/ipa/libipa/fixedpoint.h    | 1 +\n>  test/ipa/libipa/fixedpoint.cpp | 5 +++++\n>  3 files changed, 15 insertions(+)\n> \n> diff --git a/src/ipa/libipa/fixedpoint.cpp b/src/ipa/libipa/fixedpoint.cpp\n> index 967b00bcd7c2..a6f8ef351c32 100644\n> --- a/src/ipa/libipa/fixedpoint.cpp\n> +++ b/src/ipa/libipa/fixedpoint.cpp\n> @@ -148,6 +148,15 @@ namespace ipa {\n>   * values in the range [-16.0, 15.9375] with a resolution of 1/16.\n>   */\n>  \n> +/**\n> + * \\typedef UQ5_8\n> + * \\brief 5.8 unsigned fixed-point quantizer\n> + *\n> + * A Quantized type using 5 bits for the integer part and 8 bits for the\n> + * fractional part, stored in an unsigned 16-bit integer (\\c uint16_t). Represents\n> + * values in the range [0.0, 31.9961] with a resolution of 1/256.\n> + */\n> +\n>  /**\n>   * \\typedef Q12_4\n>   * \\brief 12.4 signed fixed-point quantizer\n> diff --git a/src/ipa/libipa/fixedpoint.h b/src/ipa/libipa/fixedpoint.h\n> index ce621cb01a5a..8f095210a918 100644\n> --- a/src/ipa/libipa/fixedpoint.h\n> +++ b/src/ipa/libipa/fixedpoint.h\n> @@ -106,6 +106,7 @@ using Q1_7 = Quantized<FixedPointQTraits<1, 7, int8_t>>;\n>  using UQ1_7 = Quantized<FixedPointQTraits<1, 7, uint8_t>>;\n>  \n>  using Q5_4 = Quantized<FixedPointQTraits<5, 4, int16_t>>;\n> +using UQ5_8 = Quantized<FixedPointQTraits<5, 8, uint16_t>>;\n>  \n>  using Q12_4 = Quantized<FixedPointQTraits<12, 4, int16_t>>;\n>  using UQ12_4 = Quantized<FixedPointQTraits<12, 4, uint16_t>>;\n> diff --git a/test/ipa/libipa/fixedpoint.cpp b/test/ipa/libipa/fixedpoint.cpp\n> index 1d018c0128df..c830b5f05a19 100644\n> --- a/test/ipa/libipa/fixedpoint.cpp\n> +++ b/test/ipa/libipa/fixedpoint.cpp\n> @@ -195,6 +195,11 @@ protected:\n>                 fails += quantizedCheck<Q5_4>(-16.00f, 0b10000'0000, -16.00f);\n>                 fails += quantizedCheck<Q5_4>( 15.94f, 0b01111'1111,  15.9375f);\n>  \n> +               /* UQ5_8(0 .. 31.9961)  Min: [0x0000:0] -- Max: [0x1fff:31.9961] Step:0.00390625 */\n> +               introduce<UQ5_8>(\"UQ5_8\");\n> +               fails += quantizedCheck<UQ5_8>( 0.00f, 0b00000'00000000,  0.00f);\n> +               fails += quantizedCheck<UQ5_8>(32.00f, 0b11111'11111111, 31.9961f);\n> +\n>                 /* Q12.4(-2048 .. 2047.94)  Min: [0x8000:-2048] -- Max: [0x7fff:2047.94] Step:0.0625 */\n>                 introduce<Q12_4>(\"Q12_4\");\n>                 fails += quantizedCheck<Q12_4>(0.0f, 0b000000000000'0000, 0.0f);\n> -- \n> 2.51.1\n>","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 77497BD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 18 Nov 2025 12:39:16 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 26EAE60AA6;\n\tTue, 18 Nov 2025 13:39:16 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0E1E560A80\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 18 Nov 2025 13:39:15 +0100 (CET)","from thinkpad.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 56829D52;\n\tTue, 18 Nov 2025 13:37:11 +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=\"ncWz7rNy\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1763469431;\n\tbh=UY8m836Rpwtqcc7a2Aiy4Jodx9TPPc61pnFm3qevHjc=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=ncWz7rNy0W5J9HZ/5wfMXJ3FnIe3nD1KaVFa0E1RFKpQudZYBwL4jHcfLRrVpSbTd\n\tWBhrRJytjjZ7FRFISeHPZuiTRveEg5e8aVBDVeCSfMzPNBE++4inutL4x8qZRCU5Ai\n\t0Ckc1UrfM/G3LCl+FX3M9t0daHoT7Z/Ef8vGTBIs=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20251114005428.90024-9-kieran.bingham@ideasonboard.com>","References":"<20251114005428.90024-1-kieran.bingham@ideasonboard.com>\n\t<20251114005428.90024-9-kieran.bingham@ideasonboard.com>","Subject":"Re: [PATCH v4 08/21] ipa: libipa: Provide Q5.8 FixedPoint support","From":"Isaac Scott <isaac.scott@ideasonboard.com>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera devel <libcamera-devel@lists.libcamera.org>","Date":"Tue, 18 Nov 2025 12:39:11 +0000","Message-ID":"<176346955167.880260.14478465597974059630@isaac-ThinkPad-T16-Gen-2>","User-Agent":"alot/0.10","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>"}}]