From 91e6491fa0fd45c94ee592042910c100f424670e Mon Sep 17 00:00:00 2001 From: Stefan Klug Date: Mon, 26 Aug 2024 15:09:58 +0200 Subject: ipa: rkisp1: Use generic Interpolator class Replace all occurrences of the MatrixInterpolator with the generic one. Signed-off-by: Stefan Klug Reviewed-by: Kieran Bingham Reviewed-by: Paul Elder --- src/ipa/rkisp1/algorithms/ccm.cpp | 18 ++++++------------ src/ipa/rkisp1/algorithms/ccm.h | 6 +++--- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/ipa/rkisp1/algorithms/ccm.cpp b/src/ipa/rkisp1/algorithms/ccm.cpp index 1ca0e73f..6b7d2e2c 100644 --- a/src/ipa/rkisp1/algorithms/ccm.cpp +++ b/src/ipa/rkisp1/algorithms/ccm.cpp @@ -19,7 +19,7 @@ #include "libcamera/internal/yaml_parser.h" #include "../utils.h" -#include "libipa/matrix_interpolator.h" +#include "libipa/interpolator.h" /** * \file ccm.h @@ -46,7 +46,7 @@ int Ccm::init([[maybe_unused]] IPAContext &context, const YamlObject &tuningData LOG(RkISP1Ccm, Warning) << "Failed to parse 'ccm' " << "parameter from tuning file; falling back to unit matrix"; - ccm_.reset(); + ccm_.setData({ { 0, Matrix::identity() } }); } ret = offsets_.readYaml(tuningData["ccms"], "ct", "offsets"); @@ -54,14 +54,8 @@ int Ccm::init([[maybe_unused]] IPAContext &context, const YamlObject &tuningData LOG(RkISP1Ccm, Warning) << "Failed to parse 'offsets' " << "parameter from tuning file; falling back to zero offsets"; - /* - * MatrixInterpolator::reset() resets to identity matrices - * while here we need zero matrices so we need to construct it - * ourselves. - */ - Matrix m({ 0, 0, 0 }); - std::map> matrices = { { 0, m } }; - offsets_ = MatrixInterpolator(matrices); + + offsets_.setData({ { 0, Matrix({ 0, 0, 0 }) } }); } return 0; @@ -106,8 +100,8 @@ void Ccm::prepare(IPAContext &context, const uint32_t frame, } ct_ = ct; - Matrix ccm = ccm_.get(ct); - Matrix offsets = offsets_.get(ct); + Matrix ccm = ccm_.getInterpolated(ct); + Matrix offsets = offsets_.getInterpolated(ct); context.activeState.ccm.ccm = ccm; frameContext.ccm.ccm = ccm; diff --git a/src/ipa/rkisp1/algorithms/ccm.h b/src/ipa/rkisp1/algorithms/ccm.h index 9daadb68..46a1416e 100644 --- a/src/ipa/rkisp1/algorithms/ccm.h +++ b/src/ipa/rkisp1/algorithms/ccm.h @@ -9,8 +9,8 @@ #include +#include "libipa/interpolator.h" #include "libipa/matrix.h" -#include "libipa/matrix_interpolator.h" #include "algorithm.h" @@ -40,8 +40,8 @@ private: const Matrix &offsets); unsigned int ct_; - MatrixInterpolator ccm_; - MatrixInterpolator offsets_; + Interpolator> ccm_; + Interpolator> offsets_; }; } /* namespace ipa::rkisp1::algorithms */ -- cgit v1.2.1