From patchwork Tue Jan 20 15:30:51 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 25891 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 BBC1FBDCBF for ; Tue, 20 Jan 2026 15:31:22 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 19F0861FD1; Tue, 20 Jan 2026 16:31:21 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="E0yENkWc"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 419F061A35 for ; Tue, 20 Jan 2026 16:31:17 +0100 (CET) Received: from rui-Precision-7560.local (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5E21D2169; Tue, 20 Jan 2026 16:30:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1768923046; bh=thh0AlTx71H+mocsY8DN6956B5cG5XiW1tYyjeRYSSU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E0yENkWcT3dSVT/BZe5642vDbG0+ddvpGVO05athpK/z20glBO8yZ7Qopm8IMk1tD fLH5GLyw9qlW6WdQrIzGobyV+onW/1ndCB7s5bv5eaHizSzBuqxdGhDZKEO+iSrxNC O5/W/TuRUvfzz2iLhj9cV9+M4gv1S4JzQ20OlBFw= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang , Jacopo Mondi Subject: [PATCH v10 1/7] ipa: rkisp1: algorithms: dpf: refactor DPF parsing and initialization Date: Tue, 20 Jan 2026 10:30:51 -0500 Message-ID: <20260120153057.1703714-2-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260120153057.1703714-1-rui.wang@ideasonboard.com> References: <20260120153057.1703714-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 39f3e461..dd3effa1 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 Tue Jan 20 15:30:52 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 25892 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 185A5BDCBF for ; Tue, 20 Jan 2026 15:31:25 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C088661FC9; Tue, 20 Jan 2026 16:31:24 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="EYzUPYCQ"; 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 72A8861FCC for ; Tue, 20 Jan 2026 16:31:18 +0100 (CET) Received: from rui-Precision-7560.local (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 73FFB2147; Tue, 20 Jan 2026 16:30:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1768923046; bh=qMjXqoxxBpwnNP/RS4+CRTqDn6lTBkSSS4ar7XYpP9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EYzUPYCQvTTyyBqFY6BRIMPWQQU/chULFjVspoPIAlXAT2QT0zP9e0c0apXCdjgRj DCS2tkW6kG3JdcfX0F4Ogd98RlcuyVZ2dQg4VUv+hIme1MBKSp5l+eqxefZbKAd4UW T5ZhXL8wfRbu52NXwzWwaFfHoFa2j88LUXwYNxNQ= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang Subject: [PATCH v10 2/7] ipa: rkisp1: algorithms: dpf: Implement mode switching Date: Tue, 20 Jan 2026 10:30:52 -0500 Message-ID: <20260120153057.1703714-3-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260120153057.1703714-1-rui.wang@ideasonboard.com> References: <20260120153057.1703714-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: *** --- src/ipa/rkisp1/algorithms/dpf.cpp | 117 +++++++++++++++++++++++++++--- src/ipa/rkisp1/algorithms/dpf.h | 12 ++- 2 files changed, 116 insertions(+), 13 deletions(-) diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp index dd3effa1..659a1a82 100644 --- a/src/ipa/rkisp1/algorithms/dpf.cpp +++ b/src/ipa/rkisp1/algorithms/dpf.cpp @@ -8,6 +8,7 @@ #include "dpf.h" #include +#include #include #include @@ -36,8 +37,32 @@ namespace ipa::rkisp1::algorithms { LOG_DEFINE_CATEGORY(RkISP1Dpf) +namespace { + +const std::map kModesMap = { + { "ReductionMinimal", controls::draft::NoiseReductionModeMinimal }, + { "ReductionFast", controls::draft::NoiseReductionModeFast }, + { "ReductionHighQuality", controls::draft::NoiseReductionModeHighQuality }, + { "ReductionZSL", controls::draft::NoiseReductionModeZSL }, + { "ReductionOff", controls::draft::NoiseReductionModeOff }, +}; + +std::string modeName(int32_t mode) +{ + auto it = std::find_if(kModesMap.begin(), kModesMap.end(), + [mode](const auto &pair) { + return pair.second == mode; + }); + + if (it != kModesMap.end()) + return it->first; + + return "ReductionUnknown"; +} +} /* namespace */ + Dpf::Dpf() - : config_({}), strengthConfig_({}) + : noiseReductionModes_({}), activeMode_(noiseReductionModes_.end()) { } @@ -57,10 +82,56 @@ 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(); + for (const auto &[modeName, modeData] : modesObject.asDict()) { + auto it = kModesMap.find(modeName); + if (it == kModesMap.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 "ReductionOff". + */ + std::string activeMode = tuningData["ActiveMode"].get().value_or("ReductionOff"); + auto it = kModesMap.find(activeMode); + if (it == kModesMap.end()) { + LOG(RkISP1Dpf, Warning) << "Invalid ActiveMode: " << activeMode; + activeMode_ = noiseReductionModes_.end(); + return 0; + } + + if (!loadConfig(it->second)) { + /* If the default "ReductionOff" mode is requested but not configured, disable DPF. */ + if (it->second == controls::draft::NoiseReductionModeOff) + activeMode_ = noiseReductionModes_.end(); + else + return -EINVAL; + } return 0; } @@ -193,6 +264,27 @@ 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: " << modeName(mode); + return false; + } + + activeMode_ = it; + + LOG(RkISP1Dpf, Debug) + << "DPF mode=Reduction (config loaded)" + << " mode= " << modeName(mode); + + return true; +} + /** * \copydoc libcamera::ipa::Algorithm::queueRequest */ @@ -206,8 +298,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 +308,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 +320,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 +344,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.configuration.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 Tue Jan 20 15:30:53 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 25893 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 21FE4BDCBF for ; Tue, 20 Jan 2026 15:31:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D4C6E61FC7; Tue, 20 Jan 2026 16:31:25 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="QAshlnIV"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A6AEC61FBF for ; Tue, 20 Jan 2026 16:31:18 +0100 (CET) Received: from rui-Precision-7560.local (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 227212169; Tue, 20 Jan 2026 16:30:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1768923047; bh=cDbOWw+rhpoHqV0DVQ/wd9xIlgJXtvfMFeexp4vVYxE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QAshlnIVjKR+bymzeJpcJAqPSEglVWL/SPinf74erpTS99/UNxfqvojdiTviAD3Da ebbh5EvSHDYjNXfF6qTw8WZ17dJBUj4ma6W6O3rxIY7mifyOVBSOVQh8oG54FABgyu iqsP7jrO8w1oLVk9VD/33KkjE4PiED/LlsGkbZvo= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang Subject: [PATCH v10 3/7] ipa: rkisp1: algorithms: register noise reduction controls Date: Tue, 20 Jan 2026 10:30:53 -0500 Message-ID: <20260120153057.1703714-4-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260120153057.1703714-1-rui.wang@ideasonboard.com> References: <20260120153057.1703714-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 --- 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 659a1a82..21ce8ace 100644 --- a/src/ipa/rkisp1/algorithms/dpf.cpp +++ b/src/ipa/rkisp1/algorithms/dpf.cpp @@ -77,6 +77,9 @@ int Dpf::init([[maybe_unused]] IPAContext &context, if (ret) return ret; + /* Register available controls. */ + registerControls(context); + return 0; } @@ -136,6 +139,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{ controls::draft::NoiseReductionModeOff }; + 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 Tue Jan 20 15:30:54 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 25894 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 0C9B9BDCBF for ; Tue, 20 Jan 2026 15:31:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8FABC61FC0; Tue, 20 Jan 2026 16:31:27 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="gj5uEwIc"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BA7C661FC4 for ; Tue, 20 Jan 2026 16:31:19 +0100 (CET) Received: from rui-Precision-7560.local (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CF0962147; Tue, 20 Jan 2026 16:30:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1768923048; bh=kidW2pGy0cE/9z0Q0icVTy7rVOnQrPu4siusLgmZ29E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gj5uEwIcAeBBCly2sC9kwO8KHIVNVjPk94vmCAJi27FUj0IhwnK4ibhPPQCT5sb+p yUoOPoI+gD6uRy+w6+wn/OxhUXb6YWzIAPc0p90qj+N2rZXkEnGyXjc566PT4x9UBt hTWnG6v5J4Pdzk1VgrDFzalqCf/pEoX4Aopa+1KI= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang , Jacopo Mondi Subject: [PATCH v10 4/7] ipa: rkisp1: algorithms: dpf: Refactor prepare() into helpers Date: Tue, 20 Jan 2026 10:30:54 -0500 Message-ID: <20260120153057.1703714-5-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260120153057.1703714-1-rui.wang@ideasonboard.com> References: <20260120153057.1703714-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 --- 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 21ce8ace..ff2cbc28 100644 --- a/src/ipa/rkisp1/algorithms/dpf.cpp +++ b/src/ipa/rkisp1/algorithms/dpf.cpp @@ -358,40 +358,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.configuration.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.configuration.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 Tue Jan 20 15:30:55 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 25895 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 A74D5BDCBF for ; Tue, 20 Jan 2026 15:31:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 74E8161FCF; Tue, 20 Jan 2026 16:31:29 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="tKfbSySP"; 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 8C69661FC0 for ; Tue, 20 Jan 2026 16:31:20 +0100 (CET) Received: from rui-Precision-7560.local (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id F3DA22147; Tue, 20 Jan 2026 16:30:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1768923049; bh=5XY0qVegJwHcZO1Wc7xpT45qPVEH4bQiDkjUtB1iiEo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tKfbSySP5kp170iAC/Ko69VHPtD5G98qeI66KzYUCkGfTUfQuusx8CbtFSzR4B1ba vxqVgs86ywV83ISNijxBjnLvkg8JZFHBOOktrSvsAxEjg7MDom2NN5Kqs5MOph3uf8 PJiwNFH+qy6muVG+9gzJa6Q7A6K5MJJYBsE/bLW4= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang , Jacopo Mondi Subject: [PATCH v10 5/7] ipa: rkisp1: algorithms: dpf: Add detailed config logging Date: Tue, 20 Jan 2026 10:30:55 -0500 Message-ID: <20260120153057.1703714-6-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260120153057.1703714-1-rui.wang@ideasonboard.com> References: <20260120153057.1703714-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 | 51 +++++++++++++++++++++++++++++-- src/ipa/rkisp1/algorithms/dpf.h | 6 +++- 2 files changed, 54 insertions(+), 3 deletions(-) diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp index ff2cbc28..726bb4ec 100644 --- a/src/ipa/rkisp1/algorithms/dpf.cpp +++ b/src/ipa/rkisp1/algorithms/dpf.cpp @@ -306,6 +306,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=" << modeName(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 */ @@ -363,7 +406,7 @@ void Dpf::prepare(IPAContext &context, const uint32_t frame, return; } - prepareEnabledMode(context, params); + prepareEnabledMode(context, frameContext, params); } void Dpf::prepareDisabledMode(RkISP1Params *params) @@ -374,7 +417,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; @@ -410,6 +454,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 Tue Jan 20 15:30:56 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 25896 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 3AF3DBDCBF for ; Tue, 20 Jan 2026 15:31:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7383061FCC; Tue, 20 Jan 2026 16:31:30 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="kLGTUivb"; 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 45E4061FD2 for ; Tue, 20 Jan 2026 16:31:21 +0100 (CET) Received: from rui-Precision-7560.local (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id BB79D21AB; Tue, 20 Jan 2026 16:30:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1768923050; bh=gSSBcUPY92JvpbPZsUrAu7fs3md3WWDBPl5gtEFHDCM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kLGTUivbFN0T5zo4BmUdxw325e+jf8BHM3OS9iAKQQsDWgr5N5pcB0/MU7Uh4u/Q9 Nossyup2wZjPa7GYFTgbzxPU2wepnDCUoY4dVCQVq7lB1IfErjUk4ynYIZUnn3NKYp tA3ySKBtHwbUdfwZSMgCYxIZa3Rz6lJ1uWO+4iaM= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang Subject: [PATCH v10 6/7] ipa: rkisp1: algorithms: data: enable DPF tuning for sensors Date: Tue, 20 Jan 2026 10:30:56 -0500 Message-ID: <20260120153057.1703714-7-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260120153057.1703714-1-rui.wang@ideasonboard.com> References: <20260120153057.1703714-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 --- 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..a396a071 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: + ReductionMinimal: + 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 + ReductionHighQuality: + 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 + ReductionFast: + 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 + ReductionZsl: + 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: "ReductionHighQuality" - Filter: ... From patchwork Tue Jan 20 15:30:57 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 25897 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 E8938BDCBF for ; Tue, 20 Jan 2026 15:31:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0714361FCF; Tue, 20 Jan 2026 16:31:33 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="qms5yRh4"; 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 E0C9A61FD0 for ; Tue, 20 Jan 2026 16:31:21 +0100 (CET) Received: from rui-Precision-7560.local (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6DE782147; Tue, 20 Jan 2026 16:30:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1768923050; bh=Ko2dntPPR3U2ecWx/6Tode8drHFwk4tXXnjFVlpxV1s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qms5yRh4r3ESBMqhyUZD0X+nLMbWc0cUyFeBv4N7tX5hlap8NeyuB0+f92dcTzHXP GmuHEhYwGLdEFfOgQMRBBGlpv1yRTylJK0MeK5ymbU9sfiWvVeeJbzaZnIgV/d4QAz RF+9aRuwvHJxqfCPKxAkrb7dlelhvV9sQDhB4Am0= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang Subject: [PATCH v10 7/7] ipa: rkisp1: algorithms: data: Add OV5647/IMX219 tuning file Date: Tue, 20 Jan 2026 10:30:57 -0500 Message-ID: <20260120153057.1703714-8-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260120153057.1703714-1-rui.wang@ideasonboard.com> References: <20260120153057.1703714-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 --- 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..37702f33 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: + ReductionMinimal: + 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 + ReductionHighQuality: + 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: "ReductionHighQuality" ... 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..9807bd8d --- /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: + ReductionFast: + 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 + ReductionZsl: + 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: "ReductionHighQuality" + - Filter: +...