[{"id":36543,"web_url":"https://patchwork.libcamera.org/comment/36543/","msgid":"<176177219531.2017750.14110034732941376998@ping.linuxembedded.co.uk>","date":"2025-10-29T21:09:55","subject":"Re: [PATCH v2 06/13] test: libipa: Add Q4.7 type and tests to match\n\texisting use case tests","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Kieran Bingham (2025-10-29 17:24:31)\n> The existing fixed point test cases utilise a signed Q4.7 format. Add\n> matching tests covering the same values and extend to validate the full\n> type.\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n>  test/ipa/libipa/fixedpoint.cpp | 18 ++++++++++++++++++\n>  1 file changed, 18 insertions(+)\n> \n> diff --git a/test/ipa/libipa/fixedpoint.cpp b/test/ipa/libipa/fixedpoint.cpp\n> index 6f6ef4ce258e..4bffd40f5a63 100644\n> --- a/test/ipa/libipa/fixedpoint.cpp\n> +++ b/test/ipa/libipa/fixedpoint.cpp\n> @@ -20,6 +20,9 @@ using namespace std;\n>  using namespace libcamera;\n>  using namespace ipa;\n>  \n> +/* Q4_7(-8 .. 7.99219)  Min: Q:0x0400 V:-8 -- Max: Q:0x03ff V:7.99219 Step:0.0078125 */\n> +using Q4_7 = Quantized<FixedPointQTraits<4, 7, int16_t>>;\n> +\n>  class FixedPointUtilsTest : public Test\n>  {\n>  protected:\n> @@ -171,6 +174,21 @@ protected:\n>                 fails += quantizedCheck<UQ1_7>(1.0f,   0b1'0000000, 1.0f);              /* Mid */\n>                 fails += quantizedCheck<UQ1_7>(1.992f, 0b1'1111111, 1.99219f);          /* Max */\n>  \n> +               /* Q4_7(-8 .. 7.99219)  Min: Q:0x0400 F:-8 -- Max: Q:0x03FF V:7.99219 Step:0.0078125 */\n> +               introduce<Q4_7>(\"Q4_7\"); /* No Sign Extension */\n\nThis comment is outdated now - it's from when I was trying to make a\nvariation of types for 'no sign extension' because I thought I needed\nthem explicitly - but now I fixed the helpers this is wrong/redundant.\n\n> +               fails += quantizedCheck<Q4_7>(-8.0f,   0b1000'0000000, -8.0f);          /* Min */\n> +               fails += quantizedCheck<Q4_7>(-0.008f, 0b1111'1111111, -0.0078125);     /* -1 step */\n> +               fails += quantizedCheck<Q4_7>( 0.0f,   0b0000'0000000,  0.0f);          /* Zero */\n> +               fails += quantizedCheck<Q4_7>( 0.008f, 0b0000'0000001,  0.0078125f);    /* +1 step */\n> +               fails += quantizedCheck<Q4_7>( 7.992f, 0b0111'1111111,  7.99219f);      /* Max */\n> +\n> +               /* Retain additional tests from original testFixedPoint() */\n> +               fails += quantizedCheck<Q4_7>( 0.2f, 0b0000'0011010,  0.203125f);       /* 0x01a */\n> +               fails += quantizedCheck<Q4_7>(-0.2f, 0b1111'1100110, -0.203125f);       /* 0x7e6 */\n> +               fails += quantizedCheck<Q4_7>(-0.8f, 0b1111'0011010, -0.796875f);       /* 0x79a */\n> +               fails += quantizedCheck<Q4_7>(-0.4f, 0b1111'1001101, -0.398438f);       /* 0x7cd */\n> +               fails += quantizedCheck<Q4_7>(-1.4f, 0b1110'1001101, -1.39844f);        /* 0x74d */\n> +\n>                 /* Test Q12.4 */\n>                 introduce<Q12_4>(\"Q12.4\");\n>  \n> -- \n> 2.50.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 3455FBE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 29 Oct 2025 21:10:01 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C9A7C6086F;\n\tWed, 29 Oct 2025 22:09:59 +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 201C560856\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 29 Oct 2025 22:09:59 +0100 (CET)","from pendragon.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 91B161E1B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 29 Oct 2025 22:08:09 +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=\"wDN0UIEF\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1761772089;\n\tbh=b0oHL50VM1Bu4mJGw3l8+Rw2pAV7rIk2JSQ+LxwRXZ0=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=wDN0UIEFvYlZ6S8nhQ+ZHfqLZppj5hRS9c+BCicXmaqE3Cdn8/XvhALWZ44L8+uuW\n\tb3lnBJt+ZtBgLjYGuc7vmD0a7hNX3f9xtv3AuAXz4auuMTyH5HmQlUcW54cx4RNM5/\n\tWsJDCk9bBgoZU5bhoa0R+i/2sGXONmwOdB1TGX98=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20251029172439.1513907-7-kieran.bingham@ideasonboard.com>","References":"<20251029172439.1513907-1-kieran.bingham@ideasonboard.com>\n\t<20251029172439.1513907-7-kieran.bingham@ideasonboard.com>","Subject":"Re: [PATCH v2 06/13] test: libipa: Add Q4.7 type and tests to match\n\texisting use case tests","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"","To":"libcamera devel <libcamera-devel@lists.libcamera.org>","Date":"Wed, 29 Oct 2025 21:09:55 +0000","Message-ID":"<176177219531.2017750.14110034732941376998@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","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>"}}]