{"id":25041,"url":"https://patchwork.libcamera.org/api/patches/25041/?format=json","web_url":"https://patchwork.libcamera.org/patch/25041/","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":"<20251114005428.90024-12-kieran.bingham@ideasonboard.com>","date":"2025-11-14T00:54:15","name":"[v4,11/21] test: libipa: Provide ScaledFixedPoint tests","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"d470eaf0a5dad044ccec4067d78246bf45f1d438","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/?format=json","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/25041/mbox/","series":[{"id":5589,"url":"https://patchwork.libcamera.org/api/series/5589/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5589","date":"2025-11-14T00:54:04","name":"libipa: Introduce a Quantized type","version":4,"mbox":"https://patchwork.libcamera.org/series/5589/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/25041/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/25041/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 628CCC32DC\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 14 Nov 2025 00:55:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AB72460ABA;\n\tFri, 14 Nov 2025 01:55:03 +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 011BC60AAB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 14 Nov 2025 01:54:52 +0100 (CET)","from charm.hippo-penny.ts.net\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 7290A16A8;\n\tFri, 14 Nov 2025 01:52:51 +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=\"dpKB1Se9\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1763081571;\n\tbh=ToNsUOzmKiNF1icAMM5rna9vu6glhImwFOUKNWeZZt0=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=dpKB1Se9+gJpOjSGCHXH1ENrPUHZ9wpR/Bj/UwdQVW9X1w+QAS694qwVJDexm2Ezy\n\t/Q0eok36JdrImckmuMEQ7Rzuzkhr69rzkINTEEXAjKsZ70OhvZ7t/BUaXzAYIPpQg4\n\tCw2nPkfoh2VWMmX3UFostX9nFMMxzOB68rhQzRbc=","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"libcamera devel <libcamera-devel@lists.libcamera.org>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Subject":"[PATCH v4 11/21] test: libipa: Provide ScaledFixedPoint tests","Date":"Fri, 14 Nov 2025 00:54:15 +0000","Message-ID":"<20251114005428.90024-12-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","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":"Use the new ScaledFixedPointQTraits to create a HueQ representing\nthe equivalent scale used by the RKISP1 Hue control to validate\nthe scaling capabilities of the new quantized type.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n test/ipa/libipa/fixedpoint.cpp | 30 ++++++++++++++++++++++++++++++\n 1 file changed, 30 insertions(+)","diff":"diff --git a/test/ipa/libipa/fixedpoint.cpp b/test/ipa/libipa/fixedpoint.cpp\nindex f3773dfe6ad4..e3428272fae5 100644\n--- a/test/ipa/libipa/fixedpoint.cpp\n+++ b/test/ipa/libipa/fixedpoint.cpp\n@@ -235,6 +235,33 @@ protected:\n \t\treturn TestPass;\n \t}\n \n+\tint testScaledFixedPointQuantizers()\n+\t{\n+\t\tunsigned int fails = 0;\n+\t\tcerr << std::endl\n+\t\t     << \"Scaled Fixed-Point Quantizer tests:\" << std::endl;\n+\n+\t\tusing HueQ = Quantized<ScaledFixedPointQTraits<Q1_7::TraitsType, 90>>;\n+\n+\t\t/* HueQ (Scaled Q1_7 * 90) (-90 .. 89.2969)  Min: [0x80:-90] -- Max: [0x7f:89.2969] Step:0.703125 */\n+\t\tfails += introduce<HueQ>(\"HueQ (Scaled Q1_7 * 90) \");\n+\n+\t\t/* clang-format off */\n+\n+\t\tfails += quantizedCheck<HueQ>(-90.0f, -128, -90.0f);\t/* Min */\n+\t\tfails += quantizedCheck<HueQ>(-45.0f,  -64, -45.0f);\t/* Mid negative */\n+\t\tfails += quantizedCheck<HueQ>(  0.0f,    0,   0.0f);\t/* Zero */\n+\t\tfails += quantizedCheck<HueQ>( 45.0f,   64,  45.0f);\t/* Mid positive */\n+\t\tfails += quantizedCheck<HueQ>( 90.0f,  127,  89.2969f);\t/* Max */\n+\n+\t\tfails += quantizedCheck<HueQ>(-99.0f, -128, -90.0f);\t/* Clamp low */\n+\t\tfails += quantizedCheck<HueQ>( 99.0f,  127,  89.2969f);\t/* Clamp high */\n+\n+\t\t/* clang-format on */\n+\n+\t\treturn fails ? TestFail : TestPass;\n+\t}\n+\n \tint run()\n \t{\n \t\tunsigned int fails = 0;\n@@ -246,6 +273,9 @@ protected:\n \t\tif (testFixedPointQuantizers() != TestPass)\n \t\t\tfails++;\n \n+\t\tif (testScaledFixedPointQuantizers() != TestPass)\n+\t\t\tfails++;\n+\n \t\treturn fails ? TestFail : TestPass;\n \t}\n };\n","prefixes":["v4","11/21"]}