From patchwork Sun Feb 1 19:16:01 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 26064 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 B25EEBD78E for ; Sun, 1 Feb 2026 19:16:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id EE2BC61FE2; Sun, 1 Feb 2026 20:16:26 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="QylHcxKT"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5521561FA0 for ; Sun, 1 Feb 2026 20:16:24 +0100 (CET) Received: from rui-Precision-7560.tail5b760b.ts.net (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id BBD634E1; Sun, 1 Feb 2026 20:15:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1769973344; bh=4J3XXcTct0U5etFo1rTrF1JGLvbkirgPbAP5nYLUd9w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QylHcxKTvt/VEQEA3f5nIQi3adxOieSJhSpqJY270gcETOGf1WlU/ZN8ZP0OlaS0W IhjSez+udcXnfAc+aQtQRrYjAfLtDWwbYRw/W1MfXmbFrhcrRsq6XsJfM1Zljztnv7 Ti1nac0ry5C4LfktXKQGtd6J677BJYBqjuRbAedA= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang , Jacopo Mondi Subject: [PATCH v12 1/7] ipa: rkisp1: algorithms: dpf: refactor DPF parsing and initialization Date: Sun, 1 Feb 2026 14:16:01 -0500 Message-ID: <20260201191607.2740223-2-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260201191607.2740223-1-rui.wang@ideasonboard.com> References: <20260201191607.2740223-1-rui.wang@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" Split DPF configuration parsing and initialization into clearer, self-contained helpers and modernized initialization patterns. Introduce parseSingleConfig() as DPF tuning file parser helper make future extensions and maintenance easier. Change strengthconfig.r/g/b parser from uint16 to uint8 to match rkisp1_cif_isp_dpf_strength_config definition. Signed-off-by: Rui Wang Reviewed-by: Jacopo Mondi --- Changes since v5: - Update typo in commit message No change since v6: Reviewed-by tags from v5 are carried over (no code changes). --- src/ipa/rkisp1/algorithms/dpf.cpp | 52 ++++++++++++++++++++++--------- src/ipa/rkisp1/algorithms/dpf.h | 5 +++ 2 files changed, 42 insertions(+), 15 deletions(-) diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp index 83c1e4b7..3c970171 100644 --- a/src/ipa/rkisp1/algorithms/dpf.cpp +++ b/src/ipa/rkisp1/algorithms/dpf.cpp @@ -46,6 +46,28 @@ Dpf::Dpf() */ int Dpf::init([[maybe_unused]] IPAContext &context, const YamlObject &tuningData) +{ + /* Parse tuning block. */ + int ret = parseConfig(tuningData); + if (ret) + return ret; + + return 0; +} + +int Dpf::parseConfig(const YamlObject &tuningData) +{ + /* Parse base config. */ + int ret = parseSingleConfig(tuningData, config_, strengthConfig_); + if (ret) + return ret; + + return 0; +} + +int Dpf::parseSingleConfig(const YamlObject &tuningData, + rkisp1_cif_isp_dpf_config &config, + rkisp1_cif_isp_dpf_strength_config &strengthConfig) { std::vector values; @@ -82,10 +104,10 @@ int Dpf::init([[maybe_unused]] IPAContext &context, } std::copy_n(values.begin(), values.size(), - std::begin(config_.g_flt.spatial_coeff)); + std::begin(config.g_flt.spatial_coeff)); - config_.g_flt.gr_enable = true; - config_.g_flt.gb_enable = true; + config.g_flt.gr_enable = true; + config.g_flt.gb_enable = true; /* * For the red and blue components, we have the 13x9 kernel specified @@ -119,15 +141,15 @@ int Dpf::init([[maybe_unused]] IPAContext &context, return -EINVAL; } - config_.rb_flt.fltsize = values.size() == RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS - ? RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_13x9 - : RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_9x9; + config.rb_flt.fltsize = values.size() == RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS + ? RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_13x9 + : RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_9x9; std::copy_n(values.begin(), values.size(), - std::begin(config_.rb_flt.spatial_coeff)); + std::begin(config.rb_flt.spatial_coeff)); - config_.rb_flt.r_enable = true; - config_.rb_flt.b_enable = true; + config.rb_flt.r_enable = true; + config.rb_flt.b_enable = true; /* * The range kernel is configured with a noise level lookup table (NLL) @@ -147,13 +169,13 @@ int Dpf::init([[maybe_unused]] IPAContext &context, } std::copy_n(nllValues.begin(), nllValues.size(), - std::begin(config_.nll.coeff)); + std::begin(config.nll.coeff)); std::string scaleMode = rFObject["scale-mode"].get(""); if (scaleMode == "linear") { - config_.nll.scale_mode = RKISP1_CIF_ISP_NLL_SCALE_LINEAR; + config.nll.scale_mode = RKISP1_CIF_ISP_NLL_SCALE_LINEAR; } else if (scaleMode == "logarithmic") { - config_.nll.scale_mode = RKISP1_CIF_ISP_NLL_SCALE_LOGARITHMIC; + config.nll.scale_mode = RKISP1_CIF_ISP_NLL_SCALE_LOGARITHMIC; } else { LOG(RkISP1Dpf, Error) << "Invalid 'RangeFilter:scale-mode': expected " @@ -164,9 +186,9 @@ int Dpf::init([[maybe_unused]] IPAContext &context, const YamlObject &fSObject = tuningData["FilterStrength"]; - strengthConfig_.r = fSObject["r"].get(64); - strengthConfig_.g = fSObject["g"].get(64); - strengthConfig_.b = fSObject["b"].get(64); + strengthConfig.r = fSObject["r"].get().value_or(64); + strengthConfig.g = fSObject["g"].get().value_or(64); + strengthConfig.b = fSObject["b"].get().value_or(64); return 0; } diff --git a/src/ipa/rkisp1/algorithms/dpf.h b/src/ipa/rkisp1/algorithms/dpf.h index 2dd8cd36..39186c55 100644 --- a/src/ipa/rkisp1/algorithms/dpf.h +++ b/src/ipa/rkisp1/algorithms/dpf.h @@ -30,6 +30,11 @@ public: RkISP1Params *params) override; private: + int parseConfig(const YamlObject &tuningData); + int parseSingleConfig(const YamlObject &tuningData, + rkisp1_cif_isp_dpf_config &config, + rkisp1_cif_isp_dpf_strength_config &strengthConfig); + struct rkisp1_cif_isp_dpf_config config_; struct rkisp1_cif_isp_dpf_strength_config strengthConfig_; }; From patchwork Sun Feb 1 19:16:02 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 26065 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 3E316BD78E for ; Sun, 1 Feb 2026 19:16:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8E02A61FD7; Sun, 1 Feb 2026 20:16:27 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="wK/Gfo/0"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0DDF561FA0 for ; Sun, 1 Feb 2026 20:16:25 +0100 (CET) Received: from rui-Precision-7560.tail5b760b.ts.net (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A5A81492; Sun, 1 Feb 2026 20:15:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1769973345; bh=XHVzAdYIF19arqyLXXLmGdEKNmg0MnV1DDM//O4BZUI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wK/Gfo/0J1ZcOHFt/eupCjNnaXh22qAqt7j6ZIgifYC8Ic+JndNeX8rkWHNBm2FgA BpLW32MfHJugj7LUjzjlXoxBVYAPtUOyWJ0PRN+M3jT9ECWqmgj4N2DPQu4prE4nl7 upcCBF977PkpvKSLAmLesYix8PzyuhnCKNgQMzjY= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang Subject: [PATCH v12 2/7] ipa: rkisp1: algorithms: dpf: Implement mode switching Date: Sun, 1 Feb 2026 14:16:02 -0500 Message-ID: <20260201191607.2740223-3-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260201191607.2740223-1-rui.wang@ideasonboard.com> References: <20260201191607.2740223-1-rui.wang@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" Implement support for switching between different noise reduction modes. This allows the DPF algorithm to be configured with different parameters based on the requested noise reduction level (e.g., minimal, fast, high quality). Mode configurations are stored in the tuning data as a list of modes, with each mode specifying its 'type' and corresponding DPF parameters. An optional 'ActiveMode' setting allows defining the default mode at startup, defaulting to "ReductionOff" if not specified. The Dpf class is refactored to store configurations in a vector and track the current mode using an iterator, which avoids data copying during runtime. Signed-off-by: Rui Wang --- changelog since v5: - Update log verbos from Info to Debug in loadReductionConfig - Update log mode value to string to in loadReductionConfig - improving the return value changed like : if (ret != 0) -> if (ret) Reviewed-by tags from v5 are carried over (no function changes). changelog since v6: - add { controls::draft::NoiseReductionModeOff, "off" }, to fix out_of_range issue changelog since v7: - Delete base config parse from parseConfig changelog since v8: - remove config_ strengthConfig_ by replacing activeMode_ iterator to avoiding data copy during config loading - Update kModesMap from std::map std::map for quick search improvement - add ActiveMode as Stefan and Jacopo's review comments - update type : auto -> int for ret value - name change loadRecuctionConfig -> loadConfig - delete parseMode changelog since v9: As Stefan's suggestion - Update dpf reduction mode config structure format from list to dictionary : NoiseReductionMode: NoiseReductionMinimal: *** NoiseReductionZSL: *** changelog since v10: - replace kModeMap with NoiseReductionModeNameValueMap and other accordinglychangelog since v10: changelog since v11: - Change "ActiveMode" to active mode as Jacopo suggestion - Add "Off" to noiseReductionMode_ as init and it can reduce on time one loop - Simple Debug log --- src/ipa/rkisp1/algorithms/dpf.cpp | 96 +++++++++++++++++++++++++++---- src/ipa/rkisp1/algorithms/dpf.h | 12 +++- 2 files changed, 95 insertions(+), 13 deletions(-) diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp index 3c970171..9d7fcc1c 100644 --- a/src/ipa/rkisp1/algorithms/dpf.cpp +++ b/src/ipa/rkisp1/algorithms/dpf.cpp @@ -37,7 +37,7 @@ namespace ipa::rkisp1::algorithms { LOG_DEFINE_CATEGORY(RkISP1Dpf) Dpf::Dpf() - : config_({}), strengthConfig_({}) + : noiseReductionModes_({}), activeMode_(noiseReductionModes_.end()) { } @@ -57,10 +57,62 @@ int Dpf::init([[maybe_unused]] IPAContext &context, int Dpf::parseConfig(const YamlObject &tuningData) { - /* Parse base config. */ - int ret = parseSingleConfig(tuningData, config_, strengthConfig_); - if (ret) - return ret; + /* Parse noise reduction modes. */ + if (!tuningData.contains("NoiseReductionModes")) { + LOG(RkISP1Dpf, Error) << "Missing modes in DPF tuning data"; + return -EINVAL; + } + + const YamlObject &modesObject = tuningData["NoiseReductionModes"]; + if (!modesObject.isDictionary()) { + LOG(RkISP1Dpf, Error) << "NoiseReductionModes must be a dictionary"; + return -EINVAL; + } + + noiseReductionModes_.clear(); + + /* + * Always enable the Off mode, and ensure it is the first one. + * It may be overridden by the tuning data. + */ + ModeConfig offMode{}; + offMode.modeValue = controls::draft::NoiseReductionModeOff; + noiseReductionModes_.push_back(offMode); + + for (const auto &[modeName, modeData] : modesObject.asDict()) { + auto it = controls::draft::NoiseReductionModeNameValueMap.find(modeName); + if (it == controls::draft::NoiseReductionModeNameValueMap.end()) { + LOG(RkISP1Dpf, Error) << "Unknown mode type: " << modeName; + return -EINVAL; + } + + ModeConfig mode; + mode.modeValue = it->second; + int ret = parseSingleConfig(modeData, mode.dpf, mode.strength); + if (ret) { + LOG(RkISP1Dpf, Error) << "Failed to parse mode: " << modeName; + return ret; + } + + noiseReductionModes_.push_back(mode); + } + + /* + * Parse the optional activeMode. + * If not present, default to "NoiseReductionModeOff". + */ + std::string activeMode = + tuningData["activeMode"].get().value_or("NoiseReductionModeOff"); + + auto it = controls::draft::NoiseReductionModeNameValueMap.find(activeMode); + if (it == controls::draft::NoiseReductionModeNameValueMap.end() || it->second == controls::draft::NoiseReductionModeOff) { + LOG(RkISP1Dpf, Warning) << "Invalid activeMode: " << activeMode; + activeMode_ = noiseReductionModes_.end(); + return 0; + } + + if (!loadConfig(it->second)) + return -EINVAL; return 0; } @@ -193,6 +245,25 @@ int Dpf::parseSingleConfig(const YamlObject &tuningData, return 0; } +bool Dpf::loadConfig(int32_t mode) +{ + auto it = std::find_if(noiseReductionModes_.begin(), noiseReductionModes_.end(), + [mode](const ModeConfig &m) { + return m.modeValue == mode; + }); + if (it == noiseReductionModes_.end()) { + LOG(RkISP1Dpf, Warning) + << "No DPF config for reduction mode: " << mode; + return false; + } + + activeMode_ = it; + + LOG(RkISP1Dpf, Debug) << "DPF mode = " << mode; + + return true; +} + /** * \copydoc libcamera::ipa::Algorithm::queueRequest */ @@ -206,8 +277,6 @@ void Dpf::queueRequest(IPAContext &context, const auto &denoise = controls.get(controls::draft::NoiseReductionMode); if (denoise) { - LOG(RkISP1Dpf, Debug) << "Set denoise to " << *denoise; - switch (*denoise) { case controls::draft::NoiseReductionModeOff: if (dpf.denoise) { @@ -218,9 +287,10 @@ void Dpf::queueRequest(IPAContext &context, case controls::draft::NoiseReductionModeMinimal: case controls::draft::NoiseReductionModeHighQuality: case controls::draft::NoiseReductionModeFast: - if (!dpf.denoise) { - dpf.denoise = true; + case controls::draft::NoiseReductionModeZSL: + if (loadConfig(*denoise)) { update = true; + dpf.denoise = true; } break; default: @@ -229,6 +299,8 @@ void Dpf::queueRequest(IPAContext &context, << *denoise; break; } + if (update) + LOG(RkISP1Dpf, Debug) << "Set denoise to " << modeName(*denoise); } frameContext.dpf.denoise = dpf.denoise; @@ -251,8 +323,10 @@ void Dpf::prepare(IPAContext &context, const uint32_t frame, strengthConfig.setEnabled(frameContext.dpf.denoise); if (frameContext.dpf.denoise) { - *config = config_; - *strengthConfig = strengthConfig_; + const ModeConfig &modeConfig = *activeMode_; + + *config = modeConfig.dpf; + *strengthConfig = modeConfig.strength; const auto &awb = context.configuration.awb; const auto &lsc = context.activeState.lsc; diff --git a/src/ipa/rkisp1/algorithms/dpf.h b/src/ipa/rkisp1/algorithms/dpf.h index 39186c55..11fc88e4 100644 --- a/src/ipa/rkisp1/algorithms/dpf.h +++ b/src/ipa/rkisp1/algorithms/dpf.h @@ -30,13 +30,21 @@ public: RkISP1Params *params) override; private: + struct ModeConfig { + int32_t modeValue; + rkisp1_cif_isp_dpf_config dpf; + rkisp1_cif_isp_dpf_strength_config strength; + }; + int parseConfig(const YamlObject &tuningData); int parseSingleConfig(const YamlObject &tuningData, rkisp1_cif_isp_dpf_config &config, rkisp1_cif_isp_dpf_strength_config &strengthConfig); - struct rkisp1_cif_isp_dpf_config config_; - struct rkisp1_cif_isp_dpf_strength_config strengthConfig_; + bool loadConfig(int32_t mode); + + std::vector noiseReductionModes_; + std::vector::const_iterator activeMode_; }; } /* namespace ipa::rkisp1::algorithms */ From patchwork Sun Feb 1 19:16:03 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 26066 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 F3628C328F for ; Sun, 1 Feb 2026 19:16:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4C2BB61FF1; Sun, 1 Feb 2026 20:16:28 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="ZviGWE2X"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id EE9C561FCC for ; Sun, 1 Feb 2026 20:16:25 +0100 (CET) Received: from rui-Precision-7560.tail5b760b.ts.net (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5F6744E1; Sun, 1 Feb 2026 20:15:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1769973346; bh=u65hDl8yP+/MlVqK9viTix+Kmr4Nb8Bt1oS7/K+yeRo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZviGWE2XM1/0LzpYpRsshLDVb7p0foXfr16UR81ISM3GHZNOigxjT38+TKr7lk3Dm 2CVcTD1zRbY3ZfiqJkmM0u28N6uqXNW8M9HZZLjtQ9hynxABal5GoS55EH5j2HnoOa QrHEyCdkdd0bjoiUYLfJbxXTu9IPpyJTB1sxqY/A= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang , Isaac Scott Subject: [PATCH v12 3/7] ipa: rkisp1: algorithms: register noise reduction controls Date: Sun, 1 Feb 2026 14:16:03 -0500 Message-ID: <20260201191607.2740223-4-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260201191607.2740223-1-rui.wang@ideasonboard.com> References: <20260201191607.2740223-1-rui.wang@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" Register NoiseReductionMode controls based on the tuning data and default to the active DPF mode. Remove the static NoiseReductionMode entry from the IPA control map now that DPF owns its registration. Signed-off-by: Rui Wang Reviewed-by: Isaac Scott --- changelog : --No change since v10 changelog since v11: - Simple Debug log --- src/ipa/rkisp1/algorithms/dpf.cpp | 21 +++++++++++++++++++++ src/ipa/rkisp1/algorithms/dpf.h | 1 + src/ipa/rkisp1/rkisp1.cpp | 1 - 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp index 9d7fcc1c..303d5cab 100644 --- a/src/ipa/rkisp1/algorithms/dpf.cpp +++ b/src/ipa/rkisp1/algorithms/dpf.cpp @@ -52,6 +52,9 @@ int Dpf::init([[maybe_unused]] IPAContext &context, if (ret) return ret; + /* Register available controls. */ + registerControls(context); + return 0; } @@ -117,6 +120,24 @@ int Dpf::parseConfig(const YamlObject &tuningData) return 0; } +void Dpf::registerControls(IPAContext &context) +{ + /* + * Populate the control map with the available noise reduction modes. + * This allows applications to query and select from the modes defined + * in the tuning data. + */ + std::vector modes{}; + for (const auto &mode : noiseReductionModes_) { + modes.emplace_back(mode.modeValue); + } + /* + * Set the default mode to the active mode. + */ + context.ctrlMap[&controls::draft::NoiseReductionMode] = + ControlInfo(modes, activeMode_->modeValue); +} + int Dpf::parseSingleConfig(const YamlObject &tuningData, rkisp1_cif_isp_dpf_config &config, rkisp1_cif_isp_dpf_strength_config &strengthConfig) diff --git a/src/ipa/rkisp1/algorithms/dpf.h b/src/ipa/rkisp1/algorithms/dpf.h index 11fc88e4..43effcbe 100644 --- a/src/ipa/rkisp1/algorithms/dpf.h +++ b/src/ipa/rkisp1/algorithms/dpf.h @@ -37,6 +37,7 @@ private: }; int parseConfig(const YamlObject &tuningData); + void registerControls(IPAContext &context); int parseSingleConfig(const YamlObject &tuningData, rkisp1_cif_isp_dpf_config &config, rkisp1_cif_isp_dpf_strength_config &strengthConfig); diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index fbcc3910..402ed62c 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -120,7 +120,6 @@ const IPAHwSettings ipaHwSettingsV12{ /* List of controls handled by the RkISP1 IPA */ const ControlInfoMap::Map rkisp1Controls{ { &controls::DebugMetadataEnable, ControlInfo(false, true, false) }, - { &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) }, }; } /* namespace */ From patchwork Sun Feb 1 19:16:04 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 26067 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 2EE09BD78E for ; Sun, 1 Feb 2026 19:16:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E201261FF5; Sun, 1 Feb 2026 20:16:30 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="I9iZtE/z"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0FA3C61FE7 for ; Sun, 1 Feb 2026 20:16:27 +0100 (CET) Received: from rui-Precision-7560.tail5b760b.ts.net (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5119F492; Sun, 1 Feb 2026 20:15:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1769973347; bh=pbD7xgbEP5lHAekw8fVdNMqXKlq6uNfOrib8JDVqvhY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I9iZtE/zGw2hTML/+lBq7PM3jXP8HmhtCGIWfuNUjcPfhf/eh23KGVp1itsUXQCAi UR9Ic2sKlReshNwy21E1QYxJd7V6HiER5TNkCarPdVhe13dcQIDlSN2XsOlmxNDePa 7OyrL84G4PV/4b7FZhKvRgwQj7tTCxf7vEukEDbo= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang , Jacopo Mondi , Isaac Scott Subject: [PATCH v12 4/7] ipa: rkisp1: algorithms: dpf: Refactor prepare() into helpers Date: Sun, 1 Feb 2026 14:16:04 -0500 Message-ID: <20260201191607.2740223-5-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260201191607.2740223-1-rui.wang@ideasonboard.com> References: <20260201191607.2740223-1-rui.wang@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" Split the prepare() function into prepareDisabledMode() and prepareEnabledMode() to improve readability and maintainability. This separates the logic for disabling and enabling the DPF, making the main prepare() function cleaner and easier to follow. Signed-off-by: Rui Wang Reviewed-by: Jacopo Mondi Reviewed-by: Isaac Scott --- changelog since v5/v6: Nothing changed changelog since v8 : - remove [[maybe_unused] for prepareEnable and prepareDisable Reviewed-by tags from v5 are carried over (no code changes). --- src/ipa/rkisp1/algorithms/dpf.cpp | 80 +++++++++++++++++++------------ src/ipa/rkisp1/algorithms/dpf.h | 3 ++ 2 files changed, 52 insertions(+), 31 deletions(-) diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp index 303d5cab..0d3a9f0e 100644 --- a/src/ipa/rkisp1/algorithms/dpf.cpp +++ b/src/ipa/rkisp1/algorithms/dpf.cpp @@ -337,40 +337,58 @@ void Dpf::prepare(IPAContext &context, const uint32_t frame, if (!frameContext.dpf.update && frame > 0) return; + if (!frameContext.dpf.denoise) { + prepareDisabledMode(params); + return; + } + + prepareEnabledMode(context, params); +} + +void Dpf::prepareDisabledMode(RkISP1Params *params) +{ + auto dpfConfig = params->block(); + dpfConfig.setEnabled(false); + auto dpfStrength = params->block(); + dpfStrength.setEnabled(false); +} + +void Dpf::prepareEnabledMode(IPAContext &context, RkISP1Params *params) +{ + if (activeMode_ == noiseReductionModes_.end()) + return; + + const ModeConfig &modeConfig = *activeMode_; + auto config = params->block(); - config.setEnabled(frameContext.dpf.denoise); + config.setEnabled(true); + *config = modeConfig.dpf; + + const auto &awb = context.configuration.awb; + const auto &lsc = context.activeState.lsc; + + auto &mode = config->gain.mode; + + /* + * The DPF needs to take into account the total amount of + * digital gain, which comes from the AWB and LSC modules. The + * DPF hardware can be programmed with a digital gain value + * manually, but can also use the gains supplied by the AWB and + * LSC modules automatically when they are enabled. Use that + * mode of operation as it simplifies control of the DPF. + */ + if (awb.enabled && lsc.enabled) + mode = RKISP1_CIF_ISP_DPF_GAIN_USAGE_AWB_LSC_GAINS; + else if (awb.enabled) + mode = RKISP1_CIF_ISP_DPF_GAIN_USAGE_AWB_GAINS; + else if (lsc.enabled) + mode = RKISP1_CIF_ISP_DPF_GAIN_USAGE_LSC_GAINS; + else + mode = RKISP1_CIF_ISP_DPF_GAIN_USAGE_DISABLED; auto strengthConfig = params->block(); - strengthConfig.setEnabled(frameContext.dpf.denoise); - - if (frameContext.dpf.denoise) { - const ModeConfig &modeConfig = *activeMode_; - - *config = modeConfig.dpf; - *strengthConfig = modeConfig.strength; - - const auto &awb = context.configuration.awb; - const auto &lsc = context.activeState.lsc; - - auto &mode = config->gain.mode; - - /* - * The DPF needs to take into account the total amount of - * digital gain, which comes from the AWB and LSC modules. The - * DPF hardware can be programmed with a digital gain value - * manually, but can also use the gains supplied by the AWB and - * LSC modules automatically when they are enabled. Use that - * mode of operation as it simplifies control of the DPF. - */ - if (awb.enabled && lsc.enabled) - mode = RKISP1_CIF_ISP_DPF_GAIN_USAGE_AWB_LSC_GAINS; - else if (awb.enabled) - mode = RKISP1_CIF_ISP_DPF_GAIN_USAGE_AWB_GAINS; - else if (lsc.enabled) - mode = RKISP1_CIF_ISP_DPF_GAIN_USAGE_LSC_GAINS; - else - mode = RKISP1_CIF_ISP_DPF_GAIN_USAGE_DISABLED; - } + strengthConfig.setEnabled(true); + *strengthConfig = modeConfig.strength; } REGISTER_IPA_ALGORITHM(Dpf, "Dpf") diff --git a/src/ipa/rkisp1/algorithms/dpf.h b/src/ipa/rkisp1/algorithms/dpf.h index 43effcbe..208d8fe9 100644 --- a/src/ipa/rkisp1/algorithms/dpf.h +++ b/src/ipa/rkisp1/algorithms/dpf.h @@ -44,6 +44,9 @@ private: bool loadConfig(int32_t mode); + void prepareDisabledMode(RkISP1Params *params); + void prepareEnabledMode(IPAContext &context, RkISP1Params *params); + std::vector noiseReductionModes_; std::vector::const_iterator activeMode_; }; From patchwork Sun Feb 1 19:16:05 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 26068 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 10EBFC32E7 for ; Sun, 1 Feb 2026 19:16:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id AD41561FF7; Sun, 1 Feb 2026 20:16:31 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="eArgilwz"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0AB5361FC6 for ; Sun, 1 Feb 2026 20:16:28 +0100 (CET) Received: from rui-Precision-7560.tail5b760b.ts.net (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 88EA178C; Sun, 1 Feb 2026 20:15:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1769973348; bh=+Ken1isu86I18TZobpZ9HZTiZZUzwyKO2QH5MgKcACo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eArgilwzsR7rhqk4cpSu6zzEY9mjeEIyY9eMrlhXQp+ipTMKdGAtHqZJBkkm4Fe5D +Wf9L1JEJXVFLbzMXcUV9xbc7IN8Tv9bKFGcb+c7A1Fp4DVFkVHWXsuCmgpuDfT/vC o7vvz2dgsBWibK1W42MJ2QVz4zoGikaW1eGxiBCI= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang , Jacopo Mondi Subject: [PATCH v12 5/7] ipa: rkisp1: algorithms: dpf: Add detailed config logging Date: Sun, 1 Feb 2026 14:16:05 -0500 Message-ID: <20260201191607.2740223-6-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260201191607.2740223-1-rui.wang@ideasonboard.com> References: <20260201191607.2740223-1-rui.wang@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" Add logConfig() helper function to log DPF configuration updates when they occur. This provides visibility into the active DPF parameters including: - Control mode and denoise enable state - Filter sizes (9x9 vs 13x9 for rb) - NLL scale mode (linear vs logarithmic) - Gain mode - Strength values (r, g, b) - Spatial filter coefficients (g and rb arrays) - Noise level lookup table coefficients The logging is triggered in prepareEnabledMode() whenever the configuration is updated, helping with debugging and tuning. Signed-off-by: Rui Wang Reviewed-by: Jacopo Mondi --- changelog since v5: - remove curly bracket in single state if-else Reviewed-by tags from v5 are carried over (no function changes). changelog since v6: No change changelog since v8: - add logConfi argument : rkisp1_cif_isp_dpf_config rkisp1_cif_isp_dpf_strength_config --- src/ipa/rkisp1/algorithms/dpf.cpp | 53 +++++++++++++++++++++++++++++-- src/ipa/rkisp1/algorithms/dpf.h | 6 +++- 2 files changed, 55 insertions(+), 4 deletions(-) diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp index 0d3a9f0e..9863bfb6 100644 --- a/src/ipa/rkisp1/algorithms/dpf.cpp +++ b/src/ipa/rkisp1/algorithms/dpf.cpp @@ -285,6 +285,49 @@ bool Dpf::loadConfig(int32_t mode) return true; } +void Dpf::logConfig(const IPAFrameContext &frameContext, + const struct rkisp1_cif_isp_dpf_config &config, + const struct rkisp1_cif_isp_dpf_strength_config &strengthConfig) const +{ + std::ostringstream ss; + + ss << "DPF config update: "; + ss << " control mode=" << activeMode_->modeValue; + ss << ", denoise=" << (frameContext.dpf.denoise ? "enabled" : "disabled"); + + ss << ", rb_fltsize=" + << (config.rb_flt.fltsize == RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_13x9 ? "13x9" : "9x9"); + ss << ", nll_scale=" + << (config.nll.scale_mode == RKISP1_CIF_ISP_NLL_SCALE_LOGARITHMIC ? "log" : "linear"); + ss << ", gain_mode=" << config.gain.mode; + ss << ", strength=" << int(strengthConfig.r) << ',' << int(strengthConfig.g) << ',' << int(strengthConfig.b); + + ss << ", g=["; + for (size_t i = 0; i < RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS; ++i) { + if (i) + ss << ','; + ss << int(config.g_flt.spatial_coeff[i]); + } + ss << "]"; + + ss << ", rb=["; + for (size_t i = 0; i < RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS; ++i) { + if (i) + ss << ','; + ss << int(config.rb_flt.spatial_coeff[i]); + } + ss << "]"; + + ss << ", nll=["; + for (size_t i = 0; i < RKISP1_CIF_ISP_DPF_MAX_NLF_COEFFS; ++i) { + if (i) + ss << ','; + ss << int(config.nll.coeff[i]); + } + ss << "]"; + LOG(RkISP1Dpf, Debug) << ss.str(); +} + /** * \copydoc libcamera::ipa::Algorithm::queueRequest */ @@ -321,7 +364,7 @@ void Dpf::queueRequest(IPAContext &context, break; } if (update) - LOG(RkISP1Dpf, Debug) << "Set denoise to " << modeName(*denoise); + LOG(RkISP1Dpf, Debug) << "Set denoise to " << *denoise; } frameContext.dpf.denoise = dpf.denoise; @@ -342,7 +385,7 @@ void Dpf::prepare(IPAContext &context, const uint32_t frame, return; } - prepareEnabledMode(context, params); + prepareEnabledMode(context, frameContext, params); } void Dpf::prepareDisabledMode(RkISP1Params *params) @@ -353,7 +396,8 @@ void Dpf::prepareDisabledMode(RkISP1Params *params) dpfStrength.setEnabled(false); } -void Dpf::prepareEnabledMode(IPAContext &context, RkISP1Params *params) +void Dpf::prepareEnabledMode(IPAContext &context, IPAFrameContext &frameContext, + RkISP1Params *params) { if (activeMode_ == noiseReductionModes_.end()) return; @@ -389,6 +433,9 @@ void Dpf::prepareEnabledMode(IPAContext &context, RkISP1Params *params) auto strengthConfig = params->block(); strengthConfig.setEnabled(true); *strengthConfig = modeConfig.strength; + + if (frameContext.dpf.update) + logConfig(frameContext, *config, *strengthConfig); } REGISTER_IPA_ALGORITHM(Dpf, "Dpf") diff --git a/src/ipa/rkisp1/algorithms/dpf.h b/src/ipa/rkisp1/algorithms/dpf.h index 208d8fe9..66d3f302 100644 --- a/src/ipa/rkisp1/algorithms/dpf.h +++ b/src/ipa/rkisp1/algorithms/dpf.h @@ -43,9 +43,13 @@ private: rkisp1_cif_isp_dpf_strength_config &strengthConfig); bool loadConfig(int32_t mode); + void logConfig(const IPAFrameContext &frameContext, + const struct rkisp1_cif_isp_dpf_config &config, + const struct rkisp1_cif_isp_dpf_strength_config &strengthConfig) const; void prepareDisabledMode(RkISP1Params *params); - void prepareEnabledMode(IPAContext &context, RkISP1Params *params); + void prepareEnabledMode(IPAContext &context, IPAFrameContext &frameContext, + RkISP1Params *params); std::vector noiseReductionModes_; std::vector::const_iterator activeMode_; From patchwork Sun Feb 1 19:16:06 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 26069 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 8C416C328F for ; Sun, 1 Feb 2026 19:16:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3A1BB62001; Sun, 1 Feb 2026 20:16:33 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="mh6xF+ri"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B8DC661FDF for ; Sun, 1 Feb 2026 20:16:28 +0100 (CET) Received: from rui-Precision-7560.tail5b760b.ts.net (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5FC8F1ADF; Sun, 1 Feb 2026 20:15:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1769973348; bh=nGXdQu0N+4jqUCCdhWc8/dxx+73/yIjx1w+F5PveNeY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mh6xF+ri5LQIE9knUqWG0FzChEmuhBD+ydAT37ptSyCSi0rONGPaZehZpzpfY8LqJ wdZ1mNanBcRAzii5NOX/KFFcdpmRtVrtK5fMmhUZAoK9G/aOd5o/KAeFliXXsPQngh dFYNVPiXsfc3y6/nmQnV6ELlBxuBNvKtmRu6cCow= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang Subject: [PATCH v12 6/7] ipa: rkisp1: algorithms: data: enable DPF tuning for sensors Date: Sun, 1 Feb 2026 14:16:06 -0500 Message-ID: <20260201191607.2740223-7-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260201191607.2740223-1-rui.wang@ideasonboard.com> References: <20260201191607.2740223-1-rui.wang@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" Update the RkISP1 denoise pre-filter (DPF) for the ov5640 sensor tuning config by adding the required DPF tuning block. Signed-off-by: Rui Wang --- changelog since v5: No change changelog since v6: add ov5647 as strong noise sensor for verification changelog since v7: - move ov5647 yaml out this commit and will add brand new commit - Update dpf tuning paras format , delete base config following parseConfig code change change log since v8: - move imx219 out to another commit - update DPF tuning paramter for sample change log since v9: - Update imx219/ov5647 dpf tuning structure as new parser required change log since v11: - Change "ActiveMode" to "activemode" --- src/ipa/rkisp1/data/ov5640.yaml | 64 +++++++++++++++++++++++++-------- 1 file changed, 50 insertions(+), 14 deletions(-) diff --git a/src/ipa/rkisp1/data/ov5640.yaml b/src/ipa/rkisp1/data/ov5640.yaml index 4b21d412..9b754afb 100644 --- a/src/ipa/rkisp1/data/ov5640.yaml +++ b/src/ipa/rkisp1/data/ov5640.yaml @@ -232,19 +232,55 @@ algorithms: green: 2 red-blue: 2 - Dpf: - DomainFilter: - g: [ 16, 16, 16, 16, 16, 16 ] - rb: [ 16, 16, 16, 16, 16, 16 ] - NoiseLevelFunction: - coeff: [ - 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, - 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, - 1023 - ] - scale-mode: "linear" - FilterStrength: - r: 64 - g: 64 - b: 64 + NoiseReductionModes: + NoiseReductionModeMinimal: + DomainFilter: + g: [ 14, 10, 7, 4, 2, 1 ] + rb: [ 14, 11, 8, 4, 2, 1 ] + NoiseLevelFunction: + coeff: [ 0, 26, 52, 78, 106, 138, 172, 208, 248, 292, 340, 392, + 448, 508, 572, 640, 712 ] + scale-mode: "linear" + FilterStrength: + r: 60 + g: 60 + b: 60 + NoiseReductionModeHighQuality: + DomainFilter: + g: [ 22, 18, 13, 8, 5, 2 ] + rb: [ 20, 18, 16, 11, 7, 3 ] + NoiseLevelFunction: + coeff: [ 0, 26, 52, 78, 106, 138, 172, 208, 248, 292, 340, 392, + 448, 508, 572, 640, 712 ] + scale-mode: "linear" + FilterStrength: + r: 130 + g: 130 + b: 130 + NoiseReductionModeFast: + DomainFilter: + g: [ 16, 12, 9, 5, 3, 1 ] + rb: [ 16, 13, 10, 6, 4, 2 ] + NoiseLevelFunction: + coeff: [ 0, 16, 32, 48, 66, 86, 108, 132, 160, 192, 228, 268, + 312, 360, 412, 468, 528 ] + scale-mode: "linear" + FilterStrength: + r: 90 + g: 90 + b: 90 + NoiseReductionModeZsl: + DomainFilter: + g: [ 18, 14, 10, 6, 3, 1 ] + rb: [ 18, 16, 13, 9, 5, 3 ] + NoiseLevelFunction: + coeff: [ 0, 20, 40, 60, 82, 106, 132, 160, 192, 228, 268, 312, + 360, 412, 468, 528, 592 ] + scale-mode: "linear" + FilterStrength: + r: 110 + g: 110 + b: 110 + activeMode: "NoiseReductionModeHighQuality" - Filter: ... From patchwork Sun Feb 1 19:16:07 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 26070 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 33B26C32EA for ; Sun, 1 Feb 2026 19:16:34 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E529D61FF6; Sun, 1 Feb 2026 20:16:33 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="ibdt3isX"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8214361FF5 for ; Sun, 1 Feb 2026 20:16:29 +0100 (CET) Received: from rui-Precision-7560.tail5b760b.ts.net (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 136A3492; Sun, 1 Feb 2026 20:15:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1769973349; bh=+631PZj/8JWsQ4cF05xjVyS14K+lj6t+Eutl+CQdFkw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ibdt3isXdPbKMMeAEBOK5iXcC22A1Gf9joSYU99RQ5+plbm6eKwdkgPhzPUCOM4K9 Xiwh+hkaLc03RdiMxeYDGYyKRKVPtHhNWrJ3o+YxT5JKS6hQHzXtxaeGELx0jjLNg3 Z6XzCFrFDBsX3a2zX5WfKJ/L7GG35c4oHQX5JINo= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang Subject: [PATCH v12 7/7] ipa: rkisp1: algorithms: data: Add OV5647/IMX219 tuning file Date: Sun, 1 Feb 2026 14:16:07 -0500 Message-ID: <20260201191607.2740223-8-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260201191607.2740223-1-rui.wang@ideasonboard.com> References: <20260201191607.2740223-1-rui.wang@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" Add a new tuning configuration file for the OmniVision OV5647 sensor. This includes initial settings for DPF algorithms. Register the new tuning file in the build system. Add Dpf tuning config into Imx219 Signed-off-by: Rui Wang --- changelog since v7 : - move imx219 dpf tuning config - update tuning parameters since "key" update changelog since v9: - Update dpf tuning config regarding reduction mode format from list to dictionary - add ActiveMode for dpf default mode changelog since v10: - Modify ReductionMinimal - > NoiseReductionModeMinimal since parser code update changelog since v11: - Change "ActiveMode" to "activeMode" --- src/ipa/rkisp1/data/imx219.yaml | 25 ++++++++++++++++++++++++ src/ipa/rkisp1/data/meson.build | 1 + src/ipa/rkisp1/data/ov5647.yaml | 34 +++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 src/ipa/rkisp1/data/ov5647.yaml diff --git a/src/ipa/rkisp1/data/imx219.yaml b/src/ipa/rkisp1/data/imx219.yaml index 0d99cb52..e8d2acbb 100644 --- a/src/ipa/rkisp1/data/imx219.yaml +++ b/src/ipa/rkisp1/data/imx219.yaml @@ -111,4 +111,29 @@ algorithms: 1438, 1226, 1059, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1025, 1054, 1185, 1326, 1334, 1334, ] + - Dpf: + NoiseReductionModes: + NoiseReductionModeMinimal: + DomainFilter: + g: [ 14, 10, 7, 4, 2, 1 ] + rb: [ 14, 11, 8, 4, 2, 1 ] + NoiseLevelFunction: + coeff: [ 0, 26, 52, 78, 106, 138, 172, 208, 248, 292, 340, 392, 448, 508, 572, 640, 712 ] + scale-mode: "linear" + FilterStrength: + r: 60 + g: 60 + b: 60 + NoiseReductionModeHighQuality: + DomainFilter: + g: [ 22, 18, 13, 8, 5, 2 ] + rb: [ 20, 18, 16, 11, 7, 3 ] + NoiseLevelFunction: + coeff: [ 0, 26, 52, 78, 106, 138, 172, 208, 248, 292, 340, 392, 448, 508, 572, 640, 712 ] + scale-mode: "linear" + FilterStrength: + r: 130 + g: 130 + b: 130 + activeMode: "NoiseReductionModeHighQuality" ... diff --git a/src/ipa/rkisp1/data/meson.build b/src/ipa/rkisp1/data/meson.build index 1e3522b2..6388a8be 100644 --- a/src/ipa/rkisp1/data/meson.build +++ b/src/ipa/rkisp1/data/meson.build @@ -6,6 +6,7 @@ conf_files = files([ 'ov2685.yaml', 'ov4689.yaml', 'ov5640.yaml', + 'ov5647.yaml', 'ov5695.yaml', 'ov8858.yaml', 'uncalibrated.yaml', diff --git a/src/ipa/rkisp1/data/ov5647.yaml b/src/ipa/rkisp1/data/ov5647.yaml new file mode 100644 index 00000000..3d8a0be0 --- /dev/null +++ b/src/ipa/rkisp1/data/ov5647.yaml @@ -0,0 +1,34 @@ +# SPDX-License-Identifier: CC0-1.0 +%YAML 1.1 +--- +version: 1 +algorithms: + - Agc: + - Awb: + - Dpf: + NoiseReductionModes: + NoiseReductionModeFast: + DomainFilter: + g: [ 16, 12, 9, 5, 3, 1 ] + rb: [ 16, 13, 10, 6, 4, 2 ] + NoiseLevelFunction: + coeff: [ 0, 16, 32, 48, 66, 86, 108, 132, 160, 192, 228, 268, 312, 360, 412, 468, 528 ] + scale-mode: "linear" + FilterStrength: + r: 90 + g: 90 + b: 90 + NoiseReductionModeZsl: + DomainFilter: + g: [ 18, 14, 10, 6, 3, 1 ] + rb: [ 18, 16, 13, 9, 5, 3 ] + NoiseLevelFunction: + coeff: [ 0, 20, 40, 60, 82, 106, 132, 160, 192, 228, 268, 312, 360, 412, 468, 528, 592 ] + scale-mode: "linear" + FilterStrength: + r: 110 + g: 110 + b: 110 + activeMode: "NoiseReductionModeHighQuality" + - Filter: +...