[{"id":36877,"web_url":"https://patchwork.libcamera.org/comment/36877/","msgid":"<176346960530.880260.11324735271774648851@isaac-ThinkPad-T16-Gen-2>","date":"2025-11-18T12:40:05","subject":"Re: [PATCH v4 11/21] test: libipa: Provide ScaledFixedPoint tests","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:15)\n> Use the new ScaledFixedPointQTraits to create a HueQ representing\n> the equivalent scale used by the RKISP1 Hue control to validate\n> the scaling capabilities of the new quantized type.\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n>  test/ipa/libipa/fixedpoint.cpp | 30 ++++++++++++++++++++++++++++++\n>  1 file changed, 30 insertions(+)\n> \n> diff --git a/test/ipa/libipa/fixedpoint.cpp b/test/ipa/libipa/fixedpoint.cpp\n> index f3773dfe6ad4..e3428272fae5 100644\n> --- a/test/ipa/libipa/fixedpoint.cpp\n> +++ b/test/ipa/libipa/fixedpoint.cpp\n> @@ -235,6 +235,33 @@ protected:\n>                 return TestPass;\n>         }\n>  \n> +       int testScaledFixedPointQuantizers()\n> +       {\n> +               unsigned int fails = 0;\n> +               cerr << std::endl\n> +                    << \"Scaled Fixed-Point Quantizer tests:\" << std::endl;\n> +\n> +               using HueQ = Quantized<ScaledFixedPointQTraits<Q1_7::TraitsType, 90>>;\n> +\n> +               /* HueQ (Scaled Q1_7 * 90) (-90 .. 89.2969)  Min: [0x80:-90] -- Max: [0x7f:89.2969] Step:0.703125 */\n> +               fails += introduce<HueQ>(\"HueQ (Scaled Q1_7 * 90) \");\n> +\n> +               /* clang-format off */\n> +\n> +               fails += quantizedCheck<HueQ>(-90.0f, -128, -90.0f);    /* Min */\n> +               fails += quantizedCheck<HueQ>(-45.0f,  -64, -45.0f);    /* Mid negative */\n> +               fails += quantizedCheck<HueQ>(  0.0f,    0,   0.0f);    /* Zero */\n> +               fails += quantizedCheck<HueQ>( 45.0f,   64,  45.0f);    /* Mid positive */\n> +               fails += quantizedCheck<HueQ>( 90.0f,  127,  89.2969f); /* Max */\n> +\n> +               fails += quantizedCheck<HueQ>(-99.0f, -128, -90.0f);    /* Clamp low */\n> +               fails += quantizedCheck<HueQ>( 99.0f,  127,  89.2969f); /* Clamp high */\n> +\n> +               /* clang-format on */\n> +\n> +               return fails ? TestFail : TestPass;\n> +       }\n> +\n>         int run()\n>         {\n>                 unsigned int fails = 0;\n> @@ -246,6 +273,9 @@ protected:\n>                 if (testFixedPointQuantizers() != TestPass)\n>                         fails++;\n>  \n> +               if (testScaledFixedPointQuantizers() != TestPass)\n> +                       fails++;\n> +\n>                 return fails ? TestFail : TestPass;\n>         }\n>  };\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 8A4A1BD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 18 Nov 2025 12:40:10 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3CB4160A8B;\n\tTue, 18 Nov 2025 13:40:10 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CDE07606D5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 18 Nov 2025 13:40:08 +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 1EE511E33;\n\tTue, 18 Nov 2025 13:38:05 +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=\"vL5uN0xt\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1763469485;\n\tbh=gJ440mDiNi9sQJMvxcVSrrgRww5IgdRx8FwNfdGXLfY=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=vL5uN0xt4eEReS44xuNZl4+cW805lEeQfLz4GreseMgj1KKk8EslOMDdVbX7ek2ne\n\tWkedjP0rG5/Ftt57qlTf49eRohUbgy84ck14zIhSbARDkneSovy6nHtaDCyD7cs48/\n\tcE3WfNgmIpOR+xM2dx/w9ha5TFN7qGdDORowla7I=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20251114005428.90024-12-kieran.bingham@ideasonboard.com>","References":"<20251114005428.90024-1-kieran.bingham@ideasonboard.com>\n\t<20251114005428.90024-12-kieran.bingham@ideasonboard.com>","Subject":"Re: [PATCH v4 11/21] test: libipa: Provide ScaledFixedPoint tests","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:40:05 +0000","Message-ID":"<176346960530.880260.11324735271774648851@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>"}}]