{"id":21298,"url":"https://patchwork.libcamera.org/api/1.1/patches/21298/?format=json","web_url":"https://patchwork.libcamera.org/patch/21298/","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":"<20240920133941.90629-4-stefan.klug@ideasonboard.com>","date":"2024-09-20T13:39:18","name":"[v3,3/9] ipa: rkisp1: Use generic Interpolator class","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"607cc6cc80c9e97639e6b78d9347f2089d475f92","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/21298/mbox/","series":[{"id":4609,"url":"https://patchwork.libcamera.org/api/1.1/series/4609/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4609","date":"2024-09-20T13:39:15","name":"Implement polynomial lsc support","version":3,"mbox":"https://patchwork.libcamera.org/series/4609/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/21298/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/21298/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 A14B5C32D5\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 20 Sep 2024 13:40:00 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 43248634FE;\n\tFri, 20 Sep 2024 15:39:59 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 65F42634FE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 20 Sep 2024 15:39:54 +0200 (CEST)","from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:8ade:938d:48b1:cede])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 6842A8D4;\n\tFri, 20 Sep 2024 15:38:30 +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=\"ACPRBgnk\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1726839510;\n\tbh=SObUGLKEjrP7vAkdP9aQ5ht6PhTPZcge9BousO6ESNI=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=ACPRBgnkjcRtrHzpCMkxhd5hOgIGK53mvyXthcTEogTqEhmcOk+Siu5LUz84AmbPM\n\t+QPzxuwqL0ghG+IYDkQqTlP7V/GbLG46IdRfSiQvsvAnLFkuOMzZeNn66yjI+V67L2\n\t8Jfc076aaNzpbOyj6w41/VNTH0kjuHz5a1JL8iFc=","From":"Stefan Klug <stefan.klug@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Stefan Klug <stefan.klug@ideasonboard.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tPaul Elder <paul.elder@ideasonboard.com>","Subject":"[PATCH v3 3/9] ipa: rkisp1: Use generic Interpolator class","Date":"Fri, 20 Sep 2024 15:39:18 +0200","Message-ID":"<20240920133941.90629-4-stefan.klug@ideasonboard.com>","X-Mailer":"git-send-email 2.43.0","In-Reply-To":"<20240920133941.90629-1-stefan.klug@ideasonboard.com>","References":"<20240920133941.90629-1-stefan.klug@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":"Replace all occurrences of the MatrixInterpolator with the generic one.\n\nSigned-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n---\n\nChanges in v3:\n- Collected tags\n---\n src/ipa/rkisp1/algorithms/ccm.cpp | 18 ++++++------------\n src/ipa/rkisp1/algorithms/ccm.h   |  6 +++---\n 2 files changed, 9 insertions(+), 15 deletions(-)","diff":"diff --git a/src/ipa/rkisp1/algorithms/ccm.cpp b/src/ipa/rkisp1/algorithms/ccm.cpp\nindex 1ca0e73f81ad..6b7d2e2cd5b3 100644\n--- a/src/ipa/rkisp1/algorithms/ccm.cpp\n+++ b/src/ipa/rkisp1/algorithms/ccm.cpp\n@@ -19,7 +19,7 @@\n #include \"libcamera/internal/yaml_parser.h\"\n \n #include \"../utils.h\"\n-#include \"libipa/matrix_interpolator.h\"\n+#include \"libipa/interpolator.h\"\n \n /**\n  * \\file ccm.h\n@@ -46,7 +46,7 @@ int Ccm::init([[maybe_unused]] IPAContext &context, const YamlObject &tuningData\n \t\tLOG(RkISP1Ccm, Warning)\n \t\t\t<< \"Failed to parse 'ccm' \"\n \t\t\t<< \"parameter from tuning file; falling back to unit matrix\";\n-\t\tccm_.reset();\n+\t\tccm_.setData({ { 0, Matrix<float, 3, 3>::identity() } });\n \t}\n \n \tret = offsets_.readYaml(tuningData[\"ccms\"], \"ct\", \"offsets\");\n@@ -54,14 +54,8 @@ int Ccm::init([[maybe_unused]] IPAContext &context, const YamlObject &tuningData\n \t\tLOG(RkISP1Ccm, Warning)\n \t\t\t<< \"Failed to parse 'offsets' \"\n \t\t\t<< \"parameter from tuning file; falling back to zero offsets\";\n-\t\t/*\n-\t\t * MatrixInterpolator::reset() resets to identity matrices\n-\t\t * while here we need zero matrices so we need to construct it\n-\t\t * ourselves.\n-\t\t */\n-\t\tMatrix<int16_t, 3, 1> m({ 0, 0, 0 });\n-\t\tstd::map<unsigned int, Matrix<int16_t, 3, 1>> matrices = { { 0, m } };\n-\t\toffsets_ = MatrixInterpolator<int16_t, 3, 1>(matrices);\n+\n+\t\toffsets_.setData({ { 0, Matrix<int16_t, 3, 1>({ 0, 0, 0 }) } });\n \t}\n \n \treturn 0;\n@@ -106,8 +100,8 @@ void Ccm::prepare(IPAContext &context, const uint32_t frame,\n \t}\n \n \tct_ = ct;\n-\tMatrix<float, 3, 3> ccm = ccm_.get(ct);\n-\tMatrix<int16_t, 3, 1> offsets = offsets_.get(ct);\n+\tMatrix<float, 3, 3> ccm = ccm_.getInterpolated(ct);\n+\tMatrix<int16_t, 3, 1> offsets = offsets_.getInterpolated(ct);\n \n \tcontext.activeState.ccm.ccm = ccm;\n \tframeContext.ccm.ccm = ccm;\ndiff --git a/src/ipa/rkisp1/algorithms/ccm.h b/src/ipa/rkisp1/algorithms/ccm.h\nindex 9daadb6834b1..46a1416e6be5 100644\n--- a/src/ipa/rkisp1/algorithms/ccm.h\n+++ b/src/ipa/rkisp1/algorithms/ccm.h\n@@ -9,8 +9,8 @@\n \n #include <linux/rkisp1-config.h>\n \n+#include \"libipa/interpolator.h\"\n #include \"libipa/matrix.h\"\n-#include \"libipa/matrix_interpolator.h\"\n \n #include \"algorithm.h\"\n \n@@ -40,8 +40,8 @@ private:\n \t\t\t   const Matrix<int16_t, 3, 1> &offsets);\n \n \tunsigned int ct_;\n-\tMatrixInterpolator<float, 3, 3> ccm_;\n-\tMatrixInterpolator<int16_t, 3, 1> offsets_;\n+\tInterpolator<Matrix<float, 3, 3>> ccm_;\n+\tInterpolator<Matrix<int16_t, 3, 1>> offsets_;\n };\n \n } /* namespace ipa::rkisp1::algorithms */\n","prefixes":["v3","3/9"]}