[{"id":31205,"web_url":"https://patchwork.libcamera.org/comment/31205/","msgid":"<172621891058.3474483.2551175496649849755@ping.linuxembedded.co.uk>","date":"2024-09-13T09:15:10","subject":"Re: [PATCH v2 4/9] ipa: rkisp1: Remove MatrixInterpolator","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Stefan Klug (2024-09-13 08:57:22)\n> The MatrixInterpolator is no longer used. Remove it.\n\nThat's an easy one.\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> ---\n>  src/ipa/libipa/matrix_interpolator.cpp | 103 ---------------------\n>  src/ipa/libipa/matrix_interpolator.h   | 120 -------------------------\n>  src/ipa/libipa/meson.build             |   2 -\n>  3 files changed, 225 deletions(-)\n>  delete mode 100644 src/ipa/libipa/matrix_interpolator.cpp\n>  delete mode 100644 src/ipa/libipa/matrix_interpolator.h\n> \n> diff --git a/src/ipa/libipa/matrix_interpolator.cpp b/src/ipa/libipa/matrix_interpolator.cpp\n> deleted file mode 100644\n> index d5188f8aa4e9..000000000000\n> --- a/src/ipa/libipa/matrix_interpolator.cpp\n> +++ /dev/null\n> @@ -1,103 +0,0 @@\n> -/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> -/*\n> - * Copyright (C) 2024, Paul Elder <paul.elder@ideasonboard.com>\n> - *\n> - * Helper class for interpolating maps of matrices\n> - */\n> -#include \"matrix_interpolator.h\"\n> -\n> -#include <libcamera/base/log.h>\n> -\n> -/**\n> - * \\file matrix_interpolator.h\n> - * \\brief Helper class for interpolating maps of matrices\n> - */\n> -\n> -namespace libcamera {\n> -\n> -LOG_DEFINE_CATEGORY(MatrixInterpolator)\n> -\n> -namespace ipa {\n> -\n> -/**\n> - * \\class MatrixInterpolator\n> - * \\brief Class for storing, retrieving, and interpolating matrices\n> - * \\tparam T Type of numerical values to be stored in the matrices\n> - * \\tparam R Number of rows in the matrices\n> - * \\tparam C Number of columns in the matrices\n> - *\n> - * The main use case is to pass a map from color temperatures to corresponding\n> - * matrices (eg. color correction), and then requesting a matrix for a specific\n> - * color temperature. This class will abstract away the interpolation portion.\n> - */\n> -\n> -/**\n> - * \\fn MatrixInterpolator::MatrixInterpolator(const std::map<unsigned int, Matrix<T, R, C>> &matrices)\n> - * \\brief Construct a matrix interpolator from a map of matrices\n> - * \\param matrices Map from which to construct the matrix interpolator\n> - */\n> -\n> -/**\n> - * \\fn MatrixInterpolator::reset()\n> - * \\brief Reset the matrix interpolator content to a single identity matrix\n> - */\n> -\n> -/**\n> - * \\fn int MatrixInterpolator<T, R, C>::readYaml()\n> - * \\brief Initialize an MatrixInterpolator instance from yaml\n> - * \\tparam T Type of data stored in the matrices\n> - * \\tparam R Number of rows of the matrices\n> - * \\tparam C Number of columns of the matrices\n> - * \\param[in] yaml The yaml object that contains the map of unsigned integers to matrices\n> - * \\param[in] key_name The name of the key in the yaml object\n> - * \\param[in] matrix_name The name of the matrix in the yaml object\n> - *\n> - * The yaml object is expected to be a list of maps. Each map has two or more\n> - * pairs: one of \\a key_name to the key value (usually color temperature), and\n> - * one or more of \\a matrix_name to the matrix. This is a bit difficult to\n> - * explain, so here is an example (in python, as it is easier to parse than\n> - * yaml):\n> - *       [\n> - *               {\n> - *                   'ct': 2860,\n> - *                   'ccm': [ 2.12089, -0.52461, -0.59629,\n> - *                           -0.85342,  2.80445, -0.95103,\n> - *                           -0.26897, -1.14788,  2.41685 ],\n> - *                   'offsets': [ 0, 0, 0 ]\n> - *               },\n> - *\n> - *               {\n> - *                   'ct': 2960,\n> - *                   'ccm': [ 2.26962, -0.54174, -0.72789,\n> - *                           -0.77008,  2.60271, -0.83262,\n> - *                           -0.26036, -1.51254,  2.77289 ],\n> - *                   'offsets': [ 0, 0, 0 ]\n> - *               },\n> - *\n> - *               {\n> - *                   'ct': 3603,\n> - *                   'ccm': [ 2.18644, -0.66148, -0.52496,\n> - *                           -0.77828,  2.69474, -0.91645,\n> - *                           -0.25239, -0.83059,  2.08298 ],\n> - *                   'offsets': [ 0, 0, 0 ]\n> - *               },\n> - *       ]\n> - *\n> - * In this case, \\a key_name would be 'ct', and \\a matrix_name can be either\n> - * 'ccm' or 'offsets'. This way multiple matrix interpolators can be defined in\n> - * one set of color temperature ranges in the tuning file, and they can be\n> - * retrieved separately with the \\a matrix_name parameter.\n> - *\n> - * \\return Zero on success, negative error code otherwise\n> - */\n> -\n> -/**\n> - * \\fn Matrix<T, R, C> MatrixInterpolator<T, R, C>::get(unsigned int key)\n> - * \\brief Retrieve a matrix from the list of matrices, interpolating if necessary\n> - * \\param[in] key The unsigned integer key of the matrix to retrieve\n> - * \\return The matrix corresponding to the color temperature\n> - */\n> -\n> -} /* namespace ipa */\n> -\n> -} /* namespace libcamera */\n> diff --git a/src/ipa/libipa/matrix_interpolator.h b/src/ipa/libipa/matrix_interpolator.h\n> deleted file mode 100644\n> index afbce5386b06..000000000000\n> --- a/src/ipa/libipa/matrix_interpolator.h\n> +++ /dev/null\n> @@ -1,120 +0,0 @@\n> -/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> -/*\n> - * Copyright (C) 2024, Paul Elder <paul.elder@ideasonboard.com>\n> - *\n> - * Helper class for interpolating maps of matrices\n> - */\n> -\n> -#pragma once\n> -\n> -#include <map>\n> -#include <string>\n> -\n> -#include <libcamera/base/log.h>\n> -\n> -#include \"libcamera/internal/yaml_parser.h\"\n> -\n> -#include \"matrix.h\"\n> -\n> -namespace libcamera {\n> -\n> -LOG_DECLARE_CATEGORY(MatrixInterpolator)\n> -\n> -namespace ipa {\n> -\n> -#ifndef __DOXYGEN__\n> -template<typename T, unsigned int R, unsigned int C,\n> -        std::enable_if_t<std::is_arithmetic_v<T>> * = nullptr>\n> -#else\n> -template<typename T, unsigned int R, unsigned int C>\n> -#endif /* __DOXYGEN__ */\n> -class MatrixInterpolator\n> -{\n> -public:\n> -       MatrixInterpolator()\n> -       {\n> -               reset();\n> -       }\n> -\n> -       MatrixInterpolator(const std::map<unsigned int, Matrix<T, R, C>> &matrices)\n> -       {\n> -               for (const auto &pair : matrices)\n> -                       matrices_[pair.first] = pair.second;\n> -       }\n> -\n> -       ~MatrixInterpolator() {}\n> -\n> -       void reset()\n> -       {\n> -               matrices_.clear();\n> -               matrices_[0] = Matrix<T, R, C>::identity();\n> -       }\n> -\n> -       int readYaml(const libcamera::YamlObject &yaml,\n> -                    const std::string &key_name,\n> -                    const std::string &matrix_name)\n> -       {\n> -               matrices_.clear();\n> -\n> -               if (!yaml.isList()) {\n> -                       LOG(MatrixInterpolator, Error) << \"yaml object must be a list\";\n> -                       return -EINVAL;\n> -               }\n> -\n> -               for (const auto &value : yaml.asList()) {\n> -                       unsigned int ct = std::stoul(value[key_name].get<std::string>(\"\"));\n> -                       std::optional<Matrix<T, R, C>> matrix =\n> -                               value[matrix_name].get<Matrix<T, R, C>>();\n> -                       if (!matrix) {\n> -                               LOG(MatrixInterpolator, Error) << \"Failed to read matrix\";\n> -                               return -EINVAL;\n> -                       }\n> -\n> -                       matrices_[ct] = *matrix;\n> -\n> -                       LOG(MatrixInterpolator, Debug)\n> -                               << \"Read matrix '\" << matrix_name << \"' for key '\"\n> -                               << key_name << \"' \" << ct << \": \"\n> -                               << matrices_[ct].toString();\n> -               }\n> -\n> -               if (matrices_.size() < 1) {\n> -                       LOG(MatrixInterpolator, Error) << \"Need at least one matrix\";\n> -                       return -EINVAL;\n> -               }\n> -\n> -               return 0;\n> -       }\n> -\n> -       Matrix<T, R, C> get(unsigned int ct)\n> -       {\n> -               ASSERT(matrices_.size() > 0);\n> -\n> -               if (matrices_.size() == 1 ||\n> -                   ct <= matrices_.begin()->first)\n> -                       return matrices_.begin()->second;\n> -\n> -               if (ct >= matrices_.rbegin()->first)\n> -                       return matrices_.rbegin()->second;\n> -\n> -               if (matrices_.find(ct) != matrices_.end())\n> -                       return matrices_[ct];\n> -\n> -               /* The above four guarantee that this will succeed */\n> -               auto iter = matrices_.upper_bound(ct);\n> -               unsigned int ctUpper = iter->first;\n> -               unsigned int ctLower = (--iter)->first;\n> -\n> -               double lambda = (ct - ctLower) / static_cast<double>(ctUpper - ctLower);\n> -               Matrix<T, R, C> ret =\n> -                       lambda * matrices_[ctUpper] + (1.0 - lambda) * matrices_[ctLower];\n> -               return ret;\n> -       }\n> -\n> -private:\n> -       std::map<unsigned int, Matrix<T, R, C>> matrices_;\n> -};\n> -\n> -} /* namespace ipa */\n> -\n> -} /* namespace libcamera */\n> diff --git a/src/ipa/libipa/meson.build b/src/ipa/libipa/meson.build\n> index 2c2712a7d252..3740178b2909 100644\n> --- a/src/ipa/libipa/meson.build\n> +++ b/src/ipa/libipa/meson.build\n> @@ -9,7 +9,6 @@ libipa_headers = files([\n>      'histogram.h',\n>      'interpolator.h',\n>      'matrix.h',\n> -    'matrix_interpolator.h',\n>      'module.h',\n>      'pwl.h',\n>      'vector.h',\n> @@ -24,7 +23,6 @@ libipa_sources = files([\n>      'histogram.cpp',\n>      'interpolator.cpp',\n>      'matrix.cpp',\n> -    'matrix_interpolator.cpp',\n>      'module.cpp',\n>      'pwl.cpp',\n>      'vector.cpp',\n> -- \n> 2.43.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 BBF01C324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 13 Sep 2024 09:15:15 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 61E00634F8;\n\tFri, 13 Sep 2024 11:15:15 +0200 (CEST)","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 7DCAF634F4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 13 Sep 2024 11:15:13 +0200 (CEST)","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 A5DC75A5;\n\tFri, 13 Sep 2024 11:13:54 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"pkmuEGpF\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1726218834;\n\tbh=4gRiM3pH0nfX0Uo/gePtFZuHumTiS9WCihUqkV7NBwo=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=pkmuEGpFp7UEJTKKllUrsGBSG63fgg81QUHKO4OeWdCoXQmF1ir/GAedeqciaN15M\n\tFzWiMkyflFyszWR9uFN/XNYimP88CwiA6ednie7HIes+i+hs8bpsDSBEMBe+pwYDYk\n\tvDrHSEPKJTgEX0xkQTwqtjm1ZsekYvhq55XJslYU=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240913075750.35115-5-stefan.klug@ideasonboard.com>","References":"<20240913075750.35115-1-stefan.klug@ideasonboard.com>\n\t<20240913075750.35115-5-stefan.klug@ideasonboard.com>","Subject":"Re: [PATCH v2 4/9] ipa: rkisp1: Remove MatrixInterpolator","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":"Fri, 13 Sep 2024 10:15:10 +0100","Message-ID":"<172621891058.3474483.2551175496649849755@ping.linuxembedded.co.uk>","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>"}},{"id":31213,"web_url":"https://patchwork.libcamera.org/comment/31213/","msgid":"<ZuQRts_rxLKwj0RX@pyrite.rasen.tech>","date":"2024-09-13T10:19:34","subject":"Re: [PATCH v2 4/9] ipa: rkisp1: Remove MatrixInterpolator","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"On Fri, Sep 13, 2024 at 09:57:22AM +0200, Stefan Klug wrote:\n> The MatrixInterpolator is no longer used. Remove it.\n> \n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> ---\n>  src/ipa/libipa/matrix_interpolator.cpp | 103 ---------------------\n>  src/ipa/libipa/matrix_interpolator.h   | 120 -------------------------\n>  src/ipa/libipa/meson.build             |   2 -\n>  3 files changed, 225 deletions(-)\n>  delete mode 100644 src/ipa/libipa/matrix_interpolator.cpp\n>  delete mode 100644 src/ipa/libipa/matrix_interpolator.h\n> \n> diff --git a/src/ipa/libipa/matrix_interpolator.cpp b/src/ipa/libipa/matrix_interpolator.cpp\n> deleted file mode 100644\n> index d5188f8aa4e9..000000000000\n> --- a/src/ipa/libipa/matrix_interpolator.cpp\n> +++ /dev/null\n> @@ -1,103 +0,0 @@\n> -/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> -/*\n> - * Copyright (C) 2024, Paul Elder <paul.elder@ideasonboard.com>\n> - *\n> - * Helper class for interpolating maps of matrices\n> - */\n> -#include \"matrix_interpolator.h\"\n> -\n> -#include <libcamera/base/log.h>\n> -\n> -/**\n> - * \\file matrix_interpolator.h\n> - * \\brief Helper class for interpolating maps of matrices\n> - */\n> -\n> -namespace libcamera {\n> -\n> -LOG_DEFINE_CATEGORY(MatrixInterpolator)\n> -\n> -namespace ipa {\n> -\n> -/**\n> - * \\class MatrixInterpolator\n> - * \\brief Class for storing, retrieving, and interpolating matrices\n> - * \\tparam T Type of numerical values to be stored in the matrices\n> - * \\tparam R Number of rows in the matrices\n> - * \\tparam C Number of columns in the matrices\n> - *\n> - * The main use case is to pass a map from color temperatures to corresponding\n> - * matrices (eg. color correction), and then requesting a matrix for a specific\n> - * color temperature. This class will abstract away the interpolation portion.\n> - */\n> -\n> -/**\n> - * \\fn MatrixInterpolator::MatrixInterpolator(const std::map<unsigned int, Matrix<T, R, C>> &matrices)\n> - * \\brief Construct a matrix interpolator from a map of matrices\n> - * \\param matrices Map from which to construct the matrix interpolator\n> - */\n> -\n> -/**\n> - * \\fn MatrixInterpolator::reset()\n> - * \\brief Reset the matrix interpolator content to a single identity matrix\n> - */\n> -\n> -/**\n> - * \\fn int MatrixInterpolator<T, R, C>::readYaml()\n> - * \\brief Initialize an MatrixInterpolator instance from yaml\n> - * \\tparam T Type of data stored in the matrices\n> - * \\tparam R Number of rows of the matrices\n> - * \\tparam C Number of columns of the matrices\n> - * \\param[in] yaml The yaml object that contains the map of unsigned integers to matrices\n> - * \\param[in] key_name The name of the key in the yaml object\n> - * \\param[in] matrix_name The name of the matrix in the yaml object\n> - *\n> - * The yaml object is expected to be a list of maps. Each map has two or more\n> - * pairs: one of \\a key_name to the key value (usually color temperature), and\n> - * one or more of \\a matrix_name to the matrix. This is a bit difficult to\n> - * explain, so here is an example (in python, as it is easier to parse than\n> - * yaml):\n> - *       [\n> - *               {\n> - *                   'ct': 2860,\n> - *                   'ccm': [ 2.12089, -0.52461, -0.59629,\n> - *                           -0.85342,  2.80445, -0.95103,\n> - *                           -0.26897, -1.14788,  2.41685 ],\n> - *                   'offsets': [ 0, 0, 0 ]\n> - *               },\n> - *\n> - *               {\n> - *                   'ct': 2960,\n> - *                   'ccm': [ 2.26962, -0.54174, -0.72789,\n> - *                           -0.77008,  2.60271, -0.83262,\n> - *                           -0.26036, -1.51254,  2.77289 ],\n> - *                   'offsets': [ 0, 0, 0 ]\n> - *               },\n> - *\n> - *               {\n> - *                   'ct': 3603,\n> - *                   'ccm': [ 2.18644, -0.66148, -0.52496,\n> - *                           -0.77828,  2.69474, -0.91645,\n> - *                           -0.25239, -0.83059,  2.08298 ],\n> - *                   'offsets': [ 0, 0, 0 ]\n> - *               },\n> - *       ]\n> - *\n> - * In this case, \\a key_name would be 'ct', and \\a matrix_name can be either\n> - * 'ccm' or 'offsets'. This way multiple matrix interpolators can be defined in\n> - * one set of color temperature ranges in the tuning file, and they can be\n> - * retrieved separately with the \\a matrix_name parameter.\n> - *\n> - * \\return Zero on success, negative error code otherwise\n> - */\n> -\n> -/**\n> - * \\fn Matrix<T, R, C> MatrixInterpolator<T, R, C>::get(unsigned int key)\n> - * \\brief Retrieve a matrix from the list of matrices, interpolating if necessary\n> - * \\param[in] key The unsigned integer key of the matrix to retrieve\n> - * \\return The matrix corresponding to the color temperature\n> - */\n> -\n> -} /* namespace ipa */\n> -\n> -} /* namespace libcamera */\n> diff --git a/src/ipa/libipa/matrix_interpolator.h b/src/ipa/libipa/matrix_interpolator.h\n> deleted file mode 100644\n> index afbce5386b06..000000000000\n> --- a/src/ipa/libipa/matrix_interpolator.h\n> +++ /dev/null\n> @@ -1,120 +0,0 @@\n> -/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> -/*\n> - * Copyright (C) 2024, Paul Elder <paul.elder@ideasonboard.com>\n> - *\n> - * Helper class for interpolating maps of matrices\n> - */\n> -\n> -#pragma once\n> -\n> -#include <map>\n> -#include <string>\n> -\n> -#include <libcamera/base/log.h>\n> -\n> -#include \"libcamera/internal/yaml_parser.h\"\n> -\n> -#include \"matrix.h\"\n> -\n> -namespace libcamera {\n> -\n> -LOG_DECLARE_CATEGORY(MatrixInterpolator)\n> -\n> -namespace ipa {\n> -\n> -#ifndef __DOXYGEN__\n> -template<typename T, unsigned int R, unsigned int C,\n> -\t std::enable_if_t<std::is_arithmetic_v<T>> * = nullptr>\n> -#else\n> -template<typename T, unsigned int R, unsigned int C>\n> -#endif /* __DOXYGEN__ */\n> -class MatrixInterpolator\n> -{\n> -public:\n> -\tMatrixInterpolator()\n> -\t{\n> -\t\treset();\n> -\t}\n> -\n> -\tMatrixInterpolator(const std::map<unsigned int, Matrix<T, R, C>> &matrices)\n> -\t{\n> -\t\tfor (const auto &pair : matrices)\n> -\t\t\tmatrices_[pair.first] = pair.second;\n> -\t}\n> -\n> -\t~MatrixInterpolator() {}\n> -\n> -\tvoid reset()\n> -\t{\n> -\t\tmatrices_.clear();\n> -\t\tmatrices_[0] = Matrix<T, R, C>::identity();\n> -\t}\n> -\n> -\tint readYaml(const libcamera::YamlObject &yaml,\n> -\t\t     const std::string &key_name,\n> -\t\t     const std::string &matrix_name)\n> -\t{\n> -\t\tmatrices_.clear();\n> -\n> -\t\tif (!yaml.isList()) {\n> -\t\t\tLOG(MatrixInterpolator, Error) << \"yaml object must be a list\";\n> -\t\t\treturn -EINVAL;\n> -\t\t}\n> -\n> -\t\tfor (const auto &value : yaml.asList()) {\n> -\t\t\tunsigned int ct = std::stoul(value[key_name].get<std::string>(\"\"));\n> -\t\t\tstd::optional<Matrix<T, R, C>> matrix =\n> -\t\t\t\tvalue[matrix_name].get<Matrix<T, R, C>>();\n> -\t\t\tif (!matrix) {\n> -\t\t\t\tLOG(MatrixInterpolator, Error) << \"Failed to read matrix\";\n> -\t\t\t\treturn -EINVAL;\n> -\t\t\t}\n> -\n> -\t\t\tmatrices_[ct] = *matrix;\n> -\n> -\t\t\tLOG(MatrixInterpolator, Debug)\n> -\t\t\t\t<< \"Read matrix '\" << matrix_name << \"' for key '\"\n> -\t\t\t\t<< key_name << \"' \" << ct << \": \"\n> -\t\t\t\t<< matrices_[ct].toString();\n> -\t\t}\n> -\n> -\t\tif (matrices_.size() < 1) {\n> -\t\t\tLOG(MatrixInterpolator, Error) << \"Need at least one matrix\";\n> -\t\t\treturn -EINVAL;\n> -\t\t}\n> -\n> -\t\treturn 0;\n> -\t}\n> -\n> -\tMatrix<T, R, C> get(unsigned int ct)\n> -\t{\n> -\t\tASSERT(matrices_.size() > 0);\n> -\n> -\t\tif (matrices_.size() == 1 ||\n> -\t\t    ct <= matrices_.begin()->first)\n> -\t\t\treturn matrices_.begin()->second;\n> -\n> -\t\tif (ct >= matrices_.rbegin()->first)\n> -\t\t\treturn matrices_.rbegin()->second;\n> -\n> -\t\tif (matrices_.find(ct) != matrices_.end())\n> -\t\t\treturn matrices_[ct];\n> -\n> -\t\t/* The above four guarantee that this will succeed */\n> -\t\tauto iter = matrices_.upper_bound(ct);\n> -\t\tunsigned int ctUpper = iter->first;\n> -\t\tunsigned int ctLower = (--iter)->first;\n> -\n> -\t\tdouble lambda = (ct - ctLower) / static_cast<double>(ctUpper - ctLower);\n> -\t\tMatrix<T, R, C> ret =\n> -\t\t\tlambda * matrices_[ctUpper] + (1.0 - lambda) * matrices_[ctLower];\n> -\t\treturn ret;\n> -\t}\n> -\n> -private:\n> -\tstd::map<unsigned int, Matrix<T, R, C>> matrices_;\n> -};\n> -\n> -} /* namespace ipa */\n> -\n> -} /* namespace libcamera */\n> diff --git a/src/ipa/libipa/meson.build b/src/ipa/libipa/meson.build\n> index 2c2712a7d252..3740178b2909 100644\n> --- a/src/ipa/libipa/meson.build\n> +++ b/src/ipa/libipa/meson.build\n> @@ -9,7 +9,6 @@ libipa_headers = files([\n>      'histogram.h',\n>      'interpolator.h',\n>      'matrix.h',\n> -    'matrix_interpolator.h',\n>      'module.h',\n>      'pwl.h',\n>      'vector.h',\n> @@ -24,7 +23,6 @@ libipa_sources = files([\n>      'histogram.cpp',\n>      'interpolator.cpp',\n>      'matrix.cpp',\n> -    'matrix_interpolator.cpp',\n>      'module.cpp',\n>      'pwl.cpp',\n>      'vector.cpp',\n> -- \n> 2.43.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 AF8B3C324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 13 Sep 2024 10:19:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3E63D634FC;\n\tFri, 13 Sep 2024 12:19:41 +0200 (CEST)","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 0F739634F8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 13 Sep 2024 12:19:39 +0200 (CEST)","from pyrite.rasen.tech (213-229-8-243.static.upcbusiness.at\n\t[213.229.8.243])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 29CE54AD;\n\tFri, 13 Sep 2024 12:18:20 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Q+z95NS7\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1726222700;\n\tbh=tq7oTV1s5CbMPEfaF1NyOMybZm5v6CJyX9y2lw3FscQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Q+z95NS7hod+QZm/Fg7wZ4WS1M8AYzGxBU+hDQkxtKNE9rEqKxOphRTEdxgExMyhv\n\tbUxP8dXKt+UXZyWmfc5QlEwqfYtHMjklbF6KHM50jEFH4dk+AcjPBtqwyWLcgkp9hc\n\tGdLENxr7B/uOuCXTwZhZskAPPwB/uym8Swde9/Lc=","Date":"Fri, 13 Sep 2024 12:19:34 +0200","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"Stefan Klug <stefan.klug@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v2 4/9] ipa: rkisp1: Remove MatrixInterpolator","Message-ID":"<ZuQRts_rxLKwj0RX@pyrite.rasen.tech>","References":"<20240913075750.35115-1-stefan.klug@ideasonboard.com>\n\t<20240913075750.35115-5-stefan.klug@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20240913075750.35115-5-stefan.klug@ideasonboard.com>","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>"}}]