{"id":25882,"url":"https://patchwork.libcamera.org/api/1.1/patches/25882/?format=json","web_url":"https://patchwork.libcamera.org/patch/25882/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20260120-sklug-lsc-resampling-v2-dev-v5-10-ef5cec7b299f@ideasonboard.com>","date":"2026-01-20T12:26:15","name":"[v5,10/15] ipa: libipa: interpolator: Drop key quantization","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"de94cfb41660f8022afbc1182b98f186643484b5","submitter":{"id":184,"url":"https://patchwork.libcamera.org/api/1.1/people/184/?format=json","name":"Stefan Klug","email":"stefan.klug@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/25882/mbox/","series":[{"id":5722,"url":"https://patchwork.libcamera.org/api/1.1/series/5722/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5722","date":"2026-01-20T12:26:05","name":"Add resampling support for polynomial LSC data","version":5,"mbox":"https://patchwork.libcamera.org/series/5722/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/25882/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/25882/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 D97E7BDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 20 Jan 2026 12:26:42 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 998DA61FDE;\n\tTue, 20 Jan 2026 13:26:42 +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 E17B261A35\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 20 Jan 2026 13:26:40 +0100 (CET)","from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:b09a:fcc3:e9a4:a9a8])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id C5C2B2169; \n\tTue, 20 Jan 2026 13:26: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=\"mnkcuBUd\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1768911969;\n\tbh=MOI5N6IRma7MhEbzHhWpvQFpFqWsD3F/bk/CxbcJ024=;\n\th=From:Date:Subject:References:In-Reply-To:To:Cc:From;\n\tb=mnkcuBUdxXTV5NdTGNaOwyDIT59apvMXh2MRqM2UUe0HdZc6XN6S/PFJUU6L8p2Kp\n\t3+TgKUyIyn6G33DS6wNXWDZpb1Rd/rzaNhnB1nTsd35+/E2FnKrNOEA24MaaNT6qR0\n\tyKMIPkw1lf/Ed9pFC5ciXsdGSKBLb9D1RstACJyU=","From":"Stefan Klug <stefan.klug@ideasonboard.com>","Date":"Tue, 20 Jan 2026 13:26:15 +0100","Subject":"[PATCH v5 10/15] ipa: libipa: interpolator: Drop key quantization","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"8bit","Message-Id":"<20260120-sklug-lsc-resampling-v2-dev-v5-10-ef5cec7b299f@ideasonboard.com>","References":"<20260120-sklug-lsc-resampling-v2-dev-v5-0-ef5cec7b299f@ideasonboard.com>","In-Reply-To":"<20260120-sklug-lsc-resampling-v2-dev-v5-0-ef5cec7b299f@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Stefan Klug <stefan.klug@ideasonboard.com>, Kieran Bingham\n\t<kieran.bingham@ideasonboard.com>, =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?=\n\t<barnabas.pocze@ideasonboard.com>","X-Mailer":"b4 0.14.2","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":"The quantization of the interpolation key was only used by the LSC\nalgorithm. There it lead to difficult to read code was removed. As there\nis no remaining user of it, drop it from the Interpolator class.\n\nWhile at it, cleanup the includes.\n\nSigned-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n\n---\n\nChanges in v3:\n- Collected tags\n\nChanges in v2:\n- Added this patch\n---\n src/ipa/libipa/interpolator.cpp  | 25 +------------------------\n src/ipa/libipa/interpolator.h    | 14 +-------------\n test/ipa/libipa/interpolator.cpp |  7 -------\n 3 files changed, 2 insertions(+), 44 deletions(-)","diff":"diff --git a/src/ipa/libipa/interpolator.cpp b/src/ipa/libipa/interpolator.cpp\nindex f901a86e4c74db6708a61e5491aa68f231e4a318..00bf66b6c2af3ce2cd9a94d5e02290c14fa3ba50 100644\n--- a/src/ipa/libipa/interpolator.cpp\n+++ b/src/ipa/libipa/interpolator.cpp\n@@ -6,15 +6,8 @@\n  */\n #include \"interpolator.h\"\n \n-#include <algorithm>\n-#include <string>\n-\n #include <libcamera/base/log.h>\n \n-#include \"libcamera/internal/yaml_parser.h\"\n-\n-#include \"interpolator.h\"\n-\n /**\n  * \\file interpolator.h\n  * \\brief Helper class for linear interpolating a set of objects\n@@ -104,20 +97,6 @@ namespace ipa {\n  * \\return Zero on success, negative error code otherwise\n  */\n \n-/**\n- * \\fn void Interpolator<T>::setQuantization(const unsigned int q)\n- * \\brief Set the quantization value\n- * \\param[in] q The quantization value\n- *\n- * Sets the quantization value. When this is set, 'key' gets quantized to this\n- * size, before doing the interpolation. This can help in reducing the number of\n- * updates pushed to the hardware.\n- *\n- * Note that normally a threshold needs to be combined with quantization.\n- * Otherwise a value that swings around the edge of the quantization step will\n- * lead to constant updates.\n- */\n-\n /**\n  * \\fn void Interpolator<T>::setData(std::map<unsigned int, T> &&data)\n  * \\brief Set the internal map\n@@ -136,10 +115,8 @@ namespace ipa {\n  * \\fn const T& Interpolator<T>::getInterpolated()\n  * \\brief Retrieve an interpolated value for the given key\n  * \\param[in] key The unsigned integer key of the object to retrieve\n- * \\param[out] quantizedKey If provided, the key value after quantization\n  * \\return The object corresponding to the key. The object is cached internally,\n- * so on successive calls with the same key (after quantization) interpolation\n- * is not recalculated.\n+ * so on successive calls with the same key interpolation is not recalculated.\n  */\n \n /**\ndiff --git a/src/ipa/libipa/interpolator.h b/src/ipa/libipa/interpolator.h\nindex 7880db6976d15aa033678f4aeb4934f5cd785bd9..fb2c611d186ed2bc8a733bdbb4273fca47942565 100644\n--- a/src/ipa/libipa/interpolator.h\n+++ b/src/ipa/libipa/interpolator.h\n@@ -70,11 +70,6 @@ public:\n \t\treturn 0;\n \t}\n \n-\tvoid setQuantization(const unsigned int q)\n-\t{\n-\t\tquantization_ = q;\n-\t}\n-\n \tvoid setData(std::map<unsigned int, T> &&data)\n \t{\n \t\tdata_ = std::move(data);\n@@ -86,16 +81,10 @@ public:\n \t\treturn data_;\n \t}\n \n-\tconst T &getInterpolated(unsigned int key, unsigned int *quantizedKey = nullptr)\n+\tconst T &getInterpolated(unsigned int key)\n \t{\n \t\tASSERT(data_.size() > 0);\n \n-\t\tif (quantization_ > 0)\n-\t\t\tkey = std::lround(key / static_cast<double>(quantization_)) * quantization_;\n-\n-\t\tif (quantizedKey)\n-\t\t\t*quantizedKey = key;\n-\n \t\tif (lastInterpolatedKey_.has_value() &&\n \t\t    *lastInterpolatedKey_ == key)\n \t\t\treturn lastInterpolatedValue_;\n@@ -128,7 +117,6 @@ private:\n \tstd::map<unsigned int, T> data_;\n \tT lastInterpolatedValue_;\n \tstd::optional<unsigned int> lastInterpolatedKey_;\n-\tunsigned int quantization_ = 0;\n };\n \n } /* namespace ipa */\ndiff --git a/test/ipa/libipa/interpolator.cpp b/test/ipa/libipa/interpolator.cpp\nindex 6abb776060d43b8339cf9b632cac1806a9c5f9b0..03b7089a7a05fb1a2b6ee568ad8e92ad7ac716ee 100644\n--- a/test/ipa/libipa/interpolator.cpp\n+++ b/test/ipa/libipa/interpolator.cpp\n@@ -40,13 +40,6 @@ protected:\n \t\tASSERT_EQ(interpolator.getInterpolated(30), 300);\n \t\tASSERT_EQ(interpolator.getInterpolated(40), 300);\n \n-\t\tinterpolator.setQuantization(10);\n-\t\tunsigned int q = 0;\n-\t\tASSERT_EQ(interpolator.getInterpolated(25, &q), 300);\n-\t\tASSERT_EQ(q, 30);\n-\t\tASSERT_EQ(interpolator.getInterpolated(24, &q), 200);\n-\t\tASSERT_EQ(q, 20);\n-\n \t\treturn TestPass;\n \t}\n };\n","prefixes":["v5","10/15"]}