From patchwork Fri Sep 20 13:39:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 21298 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id A14B5C32D5 for ; Fri, 20 Sep 2024 13:40:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 43248634FE; Fri, 20 Sep 2024 15:39:59 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="ACPRBgnk"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 65F42634FE for ; Fri, 20 Sep 2024 15:39:54 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:8ade:938d:48b1:cede]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6842A8D4; Fri, 20 Sep 2024 15:38:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1726839510; bh=SObUGLKEjrP7vAkdP9aQ5ht6PhTPZcge9BousO6ESNI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ACPRBgnkjcRtrHzpCMkxhd5hOgIGK53mvyXthcTEogTqEhmcOk+Siu5LUz84AmbPM +QPzxuwqL0ghG+IYDkQqTlP7V/GbLG46IdRfSiQvsvAnLFkuOMzZeNn66yjI+V67L2 8Jfc076aaNzpbOyj6w41/VNTH0kjuHz5a1JL8iFc= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug , Kieran Bingham , Paul Elder 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 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Replace all occurrences of the MatrixInterpolator with the generic one. Signed-off-by: Stefan Klug Reviewed-by: Kieran Bingham Reviewed-by: Paul Elder --- Changes in v3: - Collected tags --- 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 1ca0e73f81ad..6b7d2e2cd5b3 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 9daadb6834b1..46a1416e6be5 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 */