[{"id":37533,"web_url":"https://patchwork.libcamera.org/comment/37533/","msgid":"<176790336973.4091855.5432609901252306180@ping.linuxembedded.co.uk>","date":"2026-01-08T20:16:09","subject":"Re: [PATCH v2 10/15] ipa: libipa: interpolator: Drop key\n\tquantization","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Stefan Klug (2026-01-08 16:05:53)\n> The quantization of the interpolation key was only used by the LSC\n> algorithm. There it lead to difficult to read code was removed. As there\n> is no remaining user of it, drop it from the Interpolator class.\n> \n> While at it, cleanup the includes.\n> \nSigned-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nPaul, I think you wrote this. Any objections?\n\n--\nKieran\n\n> \n> ---\n> \n> Changes 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(-)\n> \n> diff --git a/src/ipa/libipa/interpolator.cpp b/src/ipa/libipa/interpolator.cpp\n> index 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>  /**\n> diff --git a/src/ipa/libipa/interpolator.h b/src/ipa/libipa/interpolator.h\n> index 7880db6976d15aa033678f4aeb4934f5cd785bd9..fb2c611d186ed2bc8a733bdbb4273fca47942565 100644\n> --- a/src/ipa/libipa/interpolator.h\n> +++ b/src/ipa/libipa/interpolator.h\n> @@ -70,11 +70,6 @@ public:\n>                 return 0;\n>         }\n>  \n> -       void setQuantization(const unsigned int q)\n> -       {\n> -               quantization_ = q;\n> -       }\n> -\n>         void setData(std::map<unsigned int, T> &&data)\n>         {\n>                 data_ = std::move(data);\n> @@ -86,16 +81,10 @@ public:\n>                 return data_;\n>         }\n>  \n> -       const T &getInterpolated(unsigned int key, unsigned int *quantizedKey = nullptr)\n> +       const T &getInterpolated(unsigned int key)\n>         {\n>                 ASSERT(data_.size() > 0);\n>  \n> -               if (quantization_ > 0)\n> -                       key = std::lround(key / static_cast<double>(quantization_)) * quantization_;\n> -\n> -               if (quantizedKey)\n> -                       *quantizedKey = key;\n> -\n>                 if (lastInterpolatedKey_.has_value() &&\n>                     *lastInterpolatedKey_ == key)\n>                         return lastInterpolatedValue_;\n> @@ -128,7 +117,6 @@ private:\n>         std::map<unsigned int, T> data_;\n>         T lastInterpolatedValue_;\n>         std::optional<unsigned int> lastInterpolatedKey_;\n> -       unsigned int quantization_ = 0;\n>  };\n>  \n>  } /* namespace ipa */\n> diff --git a/test/ipa/libipa/interpolator.cpp b/test/ipa/libipa/interpolator.cpp\n> index 6abb776060d43b8339cf9b632cac1806a9c5f9b0..03b7089a7a05fb1a2b6ee568ad8e92ad7ac716ee 100644\n> --- a/test/ipa/libipa/interpolator.cpp\n> +++ b/test/ipa/libipa/interpolator.cpp\n> @@ -40,13 +40,6 @@ protected:\n>                 ASSERT_EQ(interpolator.getInterpolated(30), 300);\n>                 ASSERT_EQ(interpolator.getInterpolated(40), 300);\n>  \n> -               interpolator.setQuantization(10);\n> -               unsigned int q = 0;\n> -               ASSERT_EQ(interpolator.getInterpolated(25, &q), 300);\n> -               ASSERT_EQ(q, 30);\n> -               ASSERT_EQ(interpolator.getInterpolated(24, &q), 200);\n> -               ASSERT_EQ(q, 20);\n> -\n>                 return TestPass;\n>         }\n>  };\n> \n> -- \n> 2.51.0\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 1ACD9BE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  8 Jan 2026 20:16:15 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5263061FA0;\n\tThu,  8 Jan 2026 21:16:14 +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 557C8615B2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  8 Jan 2026 21:16:12 +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 86280103D;\n\tThu,  8 Jan 2026 21:15:49 +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=\"ikSI4NDC\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1767903349;\n\tbh=FCmu5yShCng3Jfr8RTtFw8nINCv6TjJ3z2voPfTLgMc=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=ikSI4NDCxF2zFC0zLHPKsOxAkosqmm6BN21TSHYO8a6HaMyPLekF1sj9jKpy0QrYP\n\td/0pi7AkGPrB7P7qnC3FejcVz/jUNDy4Ai4TDt5g4Pz24PLKz4lF7Kn6PuK9kB4dtt\n\tDjx4ec0ahhJy0BJub9lxUtZ+7hLdJn4RepqMcgkk=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20260108-sklug-lsc-resampling-v2-dev-v2-10-e682ec4b9893@ideasonboard.com>","References":"<20260108-sklug-lsc-resampling-v2-dev-v2-0-e682ec4b9893@ideasonboard.com>\n\t<20260108-sklug-lsc-resampling-v2-dev-v2-10-e682ec4b9893@ideasonboard.com>","Subject":"Re: [PATCH v2 10/15] ipa: libipa: interpolator: Drop key\n\tquantization","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Stefan Klug <stefan.klug@ideasonboard.com>","To":"Stefan Klug <stefan.klug@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 08 Jan 2026 20:16:09 +0000","Message-ID":"<176790336973.4091855.5432609901252306180@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>"}},{"id":37536,"web_url":"https://patchwork.libcamera.org/comment/37536/","msgid":"<176795138760.21455.6900241234929749161@localhost>","date":"2026-01-09T09:36:27","subject":"Re: [PATCH v2 10/15] ipa: libipa: interpolator: Drop key\n\tquantization","submitter":{"id":184,"url":"https://patchwork.libcamera.org/api/people/184/","name":"Stefan Klug","email":"stefan.klug@ideasonboard.com"},"content":"Quoting Kieran Bingham (2026-01-08 21:16:09)\n> Quoting Stefan Klug (2026-01-08 16:05:53)\n> > The quantization of the interpolation key was only used by the LSC\n> > algorithm. There it lead to difficult to read code was removed. As there\n> > is no remaining user of it, drop it from the Interpolator class.\n> > \n> > While at it, cleanup the includes.\n> > \n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> \n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> Paul, I think you wrote this. Any objections?\n\nI created the Interpolator pased on Pauls MatrixInterpolator. But the\nquantization was added by me, so I drop my own bad idea :-)\n\nCheers,\nStefan\n\n> \n> --\n> Kieran\n> \n> > \n> > ---\n> > \n> > Changes 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(-)\n> > \n> > diff --git a/src/ipa/libipa/interpolator.cpp b/src/ipa/libipa/interpolator.cpp\n> > index 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> >  /**\n> > diff --git a/src/ipa/libipa/interpolator.h b/src/ipa/libipa/interpolator.h\n> > index 7880db6976d15aa033678f4aeb4934f5cd785bd9..fb2c611d186ed2bc8a733bdbb4273fca47942565 100644\n> > --- a/src/ipa/libipa/interpolator.h\n> > +++ b/src/ipa/libipa/interpolator.h\n> > @@ -70,11 +70,6 @@ public:\n> >                 return 0;\n> >         }\n> >  \n> > -       void setQuantization(const unsigned int q)\n> > -       {\n> > -               quantization_ = q;\n> > -       }\n> > -\n> >         void setData(std::map<unsigned int, T> &&data)\n> >         {\n> >                 data_ = std::move(data);\n> > @@ -86,16 +81,10 @@ public:\n> >                 return data_;\n> >         }\n> >  \n> > -       const T &getInterpolated(unsigned int key, unsigned int *quantizedKey = nullptr)\n> > +       const T &getInterpolated(unsigned int key)\n> >         {\n> >                 ASSERT(data_.size() > 0);\n> >  \n> > -               if (quantization_ > 0)\n> > -                       key = std::lround(key / static_cast<double>(quantization_)) * quantization_;\n> > -\n> > -               if (quantizedKey)\n> > -                       *quantizedKey = key;\n> > -\n> >                 if (lastInterpolatedKey_.has_value() &&\n> >                     *lastInterpolatedKey_ == key)\n> >                         return lastInterpolatedValue_;\n> > @@ -128,7 +117,6 @@ private:\n> >         std::map<unsigned int, T> data_;\n> >         T lastInterpolatedValue_;\n> >         std::optional<unsigned int> lastInterpolatedKey_;\n> > -       unsigned int quantization_ = 0;\n> >  };\n> >  \n> >  } /* namespace ipa */\n> > diff --git a/test/ipa/libipa/interpolator.cpp b/test/ipa/libipa/interpolator.cpp\n> > index 6abb776060d43b8339cf9b632cac1806a9c5f9b0..03b7089a7a05fb1a2b6ee568ad8e92ad7ac716ee 100644\n> > --- a/test/ipa/libipa/interpolator.cpp\n> > +++ b/test/ipa/libipa/interpolator.cpp\n> > @@ -40,13 +40,6 @@ protected:\n> >                 ASSERT_EQ(interpolator.getInterpolated(30), 300);\n> >                 ASSERT_EQ(interpolator.getInterpolated(40), 300);\n> >  \n> > -               interpolator.setQuantization(10);\n> > -               unsigned int q = 0;\n> > -               ASSERT_EQ(interpolator.getInterpolated(25, &q), 300);\n> > -               ASSERT_EQ(q, 30);\n> > -               ASSERT_EQ(interpolator.getInterpolated(24, &q), 200);\n> > -               ASSERT_EQ(q, 20);\n> > -\n> >                 return TestPass;\n> >         }\n> >  };\n> > \n> > -- \n> > 2.51.0\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 1F93FBDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  9 Jan 2026 09:36:33 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1F47861FBB;\n\tFri,  9 Jan 2026 10:36:32 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EF269606D5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  9 Jan 2026 10:36:30 +0100 (CET)","from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:88eb:da0f:96d2:b6cd])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id C5C3463B;\n\tFri,  9 Jan 2026 10:36:07 +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=\"S50Sw2Ka\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1767951367;\n\tbh=4Wb/T8AA5gnJ4fEcVCgsMwaVkrj7lwIXUipI7NHkJp4=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=S50Sw2KaYPagdIadXYAcWd6i8VXMKW7GdlrIEnndjx1wnHjDMFC9DQ252NN2cbPUJ\n\tN9JgFP1zPR3n0xhWu1wN4E1G3mxuMwpe4V/uz1robqiUpj3/a9aK2MyL3wpSiOELLE\n\tEVc/4kmq2UDUpzVFHqp+1JCfwFItj3WmkPynMyZM=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<176790336973.4091855.5432609901252306180@ping.linuxembedded.co.uk>","References":"<20260108-sklug-lsc-resampling-v2-dev-v2-0-e682ec4b9893@ideasonboard.com>\n\t<20260108-sklug-lsc-resampling-v2-dev-v2-10-e682ec4b9893@ideasonboard.com>\n\t<176790336973.4091855.5432609901252306180@ping.linuxembedded.co.uk>","Subject":"Re: [PATCH v2 10/15] ipa: libipa: interpolator: Drop key\n\tquantization","From":"Stefan Klug <stefan.klug@ideasonboard.com>","Cc":"","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Fri, 09 Jan 2026 10:36:27 +0100","Message-ID":"<176795138760.21455.6900241234929749161@localhost>","User-Agent":"alot/0.12.dev8+g2c003385c862.d20250602","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>"}},{"id":37539,"web_url":"https://patchwork.libcamera.org/comment/37539/","msgid":"<96973148-c16c-4205-84e9-f97a32cad061@ideasonboard.com>","date":"2026-01-09T10:07:23","subject":"Re: [PATCH v2 10/15] ipa: libipa: interpolator: Drop key\n\tquantization","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2026. 01. 08. 17:05 keltezéssel, Stefan Klug írta:\n> The quantization of the interpolation key was only used by the LSC\n> algorithm. There it lead to difficult to read code was removed. As there\n> is no remaining user of it, drop it from the Interpolator class.\n> \n> While at it, cleanup the includes.\n> \n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> \n> ---\n\nReviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n\n\n> \n> Changes 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(-)\n> \n> diff --git a/src/ipa/libipa/interpolator.cpp b/src/ipa/libipa/interpolator.cpp\n> index 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>   /**\n> diff --git a/src/ipa/libipa/interpolator.h b/src/ipa/libipa/interpolator.h\n> index 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 */\n> diff --git a/test/ipa/libipa/interpolator.cpp b/test/ipa/libipa/interpolator.cpp\n> index 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>","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 D5D40BDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  9 Jan 2026 10:07:28 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DEC8D61FA0;\n\tFri,  9 Jan 2026 11:07:27 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AFE6F606D5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  9 Jan 2026 11:07:26 +0100 (CET)","from [192.168.33.17] (185.221.143.114.nat.pool.zt.hu\n\t[185.221.143.114])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9B80E63B;\n\tFri,  9 Jan 2026 11:07:03 +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=\"SY7y+TCK\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1767953223;\n\tbh=ZsbkHIMy03e46saPxbV08vgSf8eLwUUzoOE8aQE+W/c=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=SY7y+TCKvgK9e6nOButP8gDyjeK9GzG0XRcFgRc0NoLwiGeHs94UZRWiG58x5yzCh\n\tkBX/EOrBxKBsMTuMruCt9vLzHXpyXspBaCWGhXZMH/pJ876ZkaOOyOwzwoc9ssw4Ur\n\tVBu63xolFZ/ibsoX52/AV898JW9xpsGAPFAflPqI=","Message-ID":"<96973148-c16c-4205-84e9-f97a32cad061@ideasonboard.com>","Date":"Fri, 9 Jan 2026 11:07:23 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v2 10/15] ipa: libipa: interpolator: Drop key\n\tquantization","To":"Stefan Klug <stefan.klug@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20260108-sklug-lsc-resampling-v2-dev-v2-0-e682ec4b9893@ideasonboard.com>\n\t<20260108-sklug-lsc-resampling-v2-dev-v2-10-e682ec4b9893@ideasonboard.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20260108-sklug-lsc-resampling-v2-dev-v2-10-e682ec4b9893@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","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>"}},{"id":37540,"web_url":"https://patchwork.libcamera.org/comment/37540/","msgid":"<176795358370.3486172.18284921385030032260@ping.linuxembedded.co.uk>","date":"2026-01-09T10:13:03","subject":"Re: [PATCH v2 10/15] ipa: libipa: interpolator: Drop key\n\tquantization","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Stefan Klug (2026-01-09 09:36:27)\n> Quoting Kieran Bingham (2026-01-08 21:16:09)\n> > Quoting Stefan Klug (2026-01-08 16:05:53)\n> > > The quantization of the interpolation key was only used by the LSC\n> > > algorithm. There it lead to difficult to read code was removed. As there\n> > > is no remaining user of it, drop it from the Interpolator class.\n> > > \n> > > While at it, cleanup the includes.\n> > > \n> > Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> > \n> > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > \n> > Paul, I think you wrote this. Any objections?\n> \n> I created the Interpolator pased on Pauls MatrixInterpolator. But the\n> quantization was added by me, so I drop my own bad idea :-)\n\nAha, sorry - well in that case ... Stefan - do you have any objections\nhere ;-)\n\n--\nKieran\n\n\n> \n> Cheers,\n> Stefan\n> \n> > \n> > --\n> > Kieran\n> > \n> > > \n> > > ---\n> > > \n> > > Changes 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(-)\n> > > \n> > > diff --git a/src/ipa/libipa/interpolator.cpp b/src/ipa/libipa/interpolator.cpp\n> > > index 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> > >  /**\n> > > diff --git a/src/ipa/libipa/interpolator.h b/src/ipa/libipa/interpolator.h\n> > > index 7880db6976d15aa033678f4aeb4934f5cd785bd9..fb2c611d186ed2bc8a733bdbb4273fca47942565 100644\n> > > --- a/src/ipa/libipa/interpolator.h\n> > > +++ b/src/ipa/libipa/interpolator.h\n> > > @@ -70,11 +70,6 @@ public:\n> > >                 return 0;\n> > >         }\n> > >  \n> > > -       void setQuantization(const unsigned int q)\n> > > -       {\n> > > -               quantization_ = q;\n> > > -       }\n> > > -\n> > >         void setData(std::map<unsigned int, T> &&data)\n> > >         {\n> > >                 data_ = std::move(data);\n> > > @@ -86,16 +81,10 @@ public:\n> > >                 return data_;\n> > >         }\n> > >  \n> > > -       const T &getInterpolated(unsigned int key, unsigned int *quantizedKey = nullptr)\n> > > +       const T &getInterpolated(unsigned int key)\n> > >         {\n> > >                 ASSERT(data_.size() > 0);\n> > >  \n> > > -               if (quantization_ > 0)\n> > > -                       key = std::lround(key / static_cast<double>(quantization_)) * quantization_;\n> > > -\n> > > -               if (quantizedKey)\n> > > -                       *quantizedKey = key;\n> > > -\n> > >                 if (lastInterpolatedKey_.has_value() &&\n> > >                     *lastInterpolatedKey_ == key)\n> > >                         return lastInterpolatedValue_;\n> > > @@ -128,7 +117,6 @@ private:\n> > >         std::map<unsigned int, T> data_;\n> > >         T lastInterpolatedValue_;\n> > >         std::optional<unsigned int> lastInterpolatedKey_;\n> > > -       unsigned int quantization_ = 0;\n> > >  };\n> > >  \n> > >  } /* namespace ipa */\n> > > diff --git a/test/ipa/libipa/interpolator.cpp b/test/ipa/libipa/interpolator.cpp\n> > > index 6abb776060d43b8339cf9b632cac1806a9c5f9b0..03b7089a7a05fb1a2b6ee568ad8e92ad7ac716ee 100644\n> > > --- a/test/ipa/libipa/interpolator.cpp\n> > > +++ b/test/ipa/libipa/interpolator.cpp\n> > > @@ -40,13 +40,6 @@ protected:\n> > >                 ASSERT_EQ(interpolator.getInterpolated(30), 300);\n> > >                 ASSERT_EQ(interpolator.getInterpolated(40), 300);\n> > >  \n> > > -               interpolator.setQuantization(10);\n> > > -               unsigned int q = 0;\n> > > -               ASSERT_EQ(interpolator.getInterpolated(25, &q), 300);\n> > > -               ASSERT_EQ(q, 30);\n> > > -               ASSERT_EQ(interpolator.getInterpolated(24, &q), 200);\n> > > -               ASSERT_EQ(q, 20);\n> > > -\n> > >                 return TestPass;\n> > >         }\n> > >  };\n> > > \n> > > -- \n> > > 2.51.0\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 34405BE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  9 Jan 2026 10:13:09 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 00A9B61FBB;\n\tFri,  9 Jan 2026 11:13:07 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AA2C8606D5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  9 Jan 2026 11:13:06 +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 8A9D863B;\n\tFri,  9 Jan 2026 11:12:43 +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=\"nEQHOjwm\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1767953563;\n\tbh=5ntLuLnJ+ZxzILBu/Ra3aGiQE/RFvNU0OsvGc69iS6M=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=nEQHOjwmd2sMbXrSUj8gGIhfacwOBqIA5Jkmsj4vpg+IF/xcgTGuxU0b9tIx5VL8/\n\t/O5pc9+fzGaVLRMa9yq3k+1noHw7D1jdVyKIe9zYrrBg9dlMjWfE2KKyrKdylwjkfD\n\t3vWdVRJAgGM3bM6292TA7xgaEJmimMUwbKltEP1Q=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<176795138760.21455.6900241234929749161@localhost>","References":"<20260108-sklug-lsc-resampling-v2-dev-v2-0-e682ec4b9893@ideasonboard.com>\n\t<20260108-sklug-lsc-resampling-v2-dev-v2-10-e682ec4b9893@ideasonboard.com>\n\t<176790336973.4091855.5432609901252306180@ping.linuxembedded.co.uk>\n\t<176795138760.21455.6900241234929749161@localhost>","Subject":"Re: [PATCH v2 10/15] ipa: libipa: interpolator: Drop key\n\tquantization","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"","To":"Stefan Klug <stefan.klug@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Fri, 09 Jan 2026 10:13:03 +0000","Message-ID":"<176795358370.3486172.18284921385030032260@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>"}}]