From patchwork Thu Jan 22 23:47: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: 25947 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 B7EC2BDCBF for ; Thu, 22 Jan 2026 23:47:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C2F2861FC5; Fri, 23 Jan 2026 00:47:28 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Fwz5925H"; 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 541D761FC4 for ; Fri, 23 Jan 2026 00:47:27 +0100 (CET) Received: from rui-Precision-7560.local (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E727982E; Fri, 23 Jan 2026 00:46:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1769125614; bh=thh0AlTx71H+mocsY8DN6956B5cG5XiW1tYyjeRYSSU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fwz5925HJgBQDBt1fOQXQl/kbky0dAorRUdOATu2yT3m4QmKXrAKwXBF6pPkJvS00 0VbODWrVxtaZ4eCqCsJk15GbMpwxsePL8mwpRHyYf/EUsEt+3GaMn8ADMzluzOJsai BR1WaVW506jMbgF8Ebbyn1gAGPTkCEHtBEqkZc+w= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang , Jacopo Mondi Subject: [PATCH v11 1/7] ipa: rkisp1: algorithms: dpf: refactor DPF parsing and initialization Date: Thu, 22 Jan 2026 18:47:03 -0500 Message-ID: <20260122234709.2061370-2-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260122234709.2061370-1-rui.wang@ideasonboard.com> References: <20260122234709.2061370-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 Thu Jan 22 23:47: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: 25948 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 247BFC327D for ; Thu, 22 Jan 2026 23:47:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B2FCB61FD7; Fri, 23 Jan 2026 00:47:29 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="ECjga4fj"; 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 EED5461FC3 for ; Fri, 23 Jan 2026 00:47:27 +0100 (CET) Received: from rui-Precision-7560.local (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C9672B3; Fri, 23 Jan 2026 00:46:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1769125615; bh=/GmJ78B3ZstXzl8zoCfRLP/XWtRZn7rhy4fX1Bq5S3k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ECjga4fjmiXClChhLBH037tcMK9Pc0frDhkSXip3VEvU8W2QRCEPZLZ9BrvzrVPXw xLnJogJkhusV0mUXxdojiC3lyXd4+n4GZWYEupaOEx2yO3G9Ezn1KRDWAVOvXHIMDb v/hOh3VmG/WzydRmH16SvGQTkXP0NJn+HZMCuTDQ= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang Subject: [PATCH v11 2/7] ipa: rkisp1: algorithms: dpf: Implement mode switching Date: Thu, 22 Jan 2026 18:47:04 -0500 Message-ID: <20260122234709.2061370-3-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260122234709.2061370-1-rui.wang@ideasonboard.com> References: <20260122234709.2061370-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 accordingly --- src/ipa/rkisp1/algorithms/dpf.cpp | 93 +++++++++++++++++++++++++++---- src/ipa/rkisp1/algorithms/dpf.h | 12 +++- 2 files changed, 92 insertions(+), 13 deletions(-) diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp index dd3effa1..78a79fa5 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,57 @@ 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 = 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()) { + LOG(RkISP1Dpf, Warning) << "Invalid ActiveMode: " << activeMode; + activeMode_ = noiseReductionModes_.end(); + return 0; + } + + if (!loadConfig(it->second)) { + /* If the default "NoiseReductionModeOff" mode is requested but not configured, disable DPF. */ + if (it->second == controls::draft::NoiseReductionModeOff) + activeMode_ = noiseReductionModes_.end(); + else + return -EINVAL; + } return 0; } @@ -193,6 +240,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: " << mode; + return false; + } + + activeMode_ = it; + + LOG(RkISP1Dpf, Debug) + << "DPF mode=Reduction (config loaded)" + << " mode= " << mode; + + return true; +} + /** * \copydoc libcamera::ipa::Algorithm::queueRequest */ @@ -206,8 +274,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 +284,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 +296,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 +320,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 Thu Jan 22 23:47: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: 25949 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 32631BDCBF for ; Thu, 22 Jan 2026 23:47:34 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2DD4361FDC; Fri, 23 Jan 2026 00:47:33 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="lvcTOwtI"; 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 1606261FD6 for ; Fri, 23 Jan 2026 00:47:28 +0100 (CET) Received: from rui-Precision-7560.local (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 936A3B3; Fri, 23 Jan 2026 00:46:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1769125616; bh=AyW3qXFXU8qdJwKkp+o/TSyoK1oIzkLke5Uk0huDKP8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lvcTOwtI848O2We9vJP/e5wei5osEEsjNZ0G47W0kp5fC+AcffjjYqYsfu8K8pe6s +nKQj8VgZBwiSZTmKze9cqVLc/KgYRes8z1yPBhNcqo8xRMI1eR4uxZoyH5w4x9aO+ AsOLGej2WeakqZDNhg3PSgS3rNUXMpco06ms0w14= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang , Isaac Scott Subject: [PATCH v11 3/7] ipa: rkisp1: algorithms: register noise reduction controls Date: Thu, 22 Jan 2026 18:47:05 -0500 Message-ID: <20260122234709.2061370-4-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260122234709.2061370-1-rui.wang@ideasonboard.com> References: <20260122234709.2061370-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 --- 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 78a79fa5..282b8672 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; } @@ -112,6 +115,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 Thu Jan 22 23:47: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: 25950 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 1A613C327D for ; Thu, 22 Jan 2026 23:47:35 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8CE3361FD2; Fri, 23 Jan 2026 00:47:34 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="wEHejeE8"; 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 03EF961FC7 for ; Fri, 23 Jan 2026 00:47:30 +0100 (CET) Received: from rui-Precision-7560.local (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7B05D82E; Fri, 23 Jan 2026 00:46:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1769125617; bh=r6Gtqs5tk3ri6uZIsHEOt87ILIniJ7gn1VkX557rwiE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wEHejeE8Nm8Q6ocQFMrPQZb1FbeANQbn+L09VoVCDkFSwibUqY+AthQ9kifiukl+t S9p2x5t72jPjkYQ0skf6gQycLHWGDQv+3oJ2/qiN/H/pdYSwrcZU3eqVQjI/i6XeDx +52xCP/oRi4Vy3B5I/g7yn3NXV6ygKXH6ceerhPA= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang , Jacopo Mondi , Isaac Scott Subject: [PATCH v11 4/7] ipa: rkisp1: algorithms: dpf: Refactor prepare() into helpers Date: Thu, 22 Jan 2026 18:47:06 -0500 Message-ID: <20260122234709.2061370-5-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260122234709.2061370-1-rui.wang@ideasonboard.com> References: <20260122234709.2061370-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 282b8672..977998b3 100644 --- a/src/ipa/rkisp1/algorithms/dpf.cpp +++ b/src/ipa/rkisp1/algorithms/dpf.cpp @@ -334,40 +334,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 Thu Jan 22 23:47: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: 25951 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 9C82FBDCBF for ; Thu, 22 Jan 2026 23:47:36 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3D95F61FE2; Fri, 23 Jan 2026 00:47:35 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="C2sYS4kZ"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CEA5C61FD9 for ; Fri, 23 Jan 2026 00:47:30 +0100 (CET) Received: from rui-Precision-7560.local (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 80C0E14C7; Fri, 23 Jan 2026 00:46:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1769125618; bh=FEeLIEjCboP9TTPCKxwjr7JI0zpumT0bFWRn3yenx3M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C2sYS4kZlbM+lHrrd/jsizKxRfjugbSqmNMdM+f8cXa8/nVwosqNfUWzpwPXVMHmi FvYfQnOsySK7tuSOvqTj6eTr6tC256qaZLN1W88CRA08GEAuNlNHSWYRzh7ghs+T9c U9E1z8nUFWTwpUP+1NuyezCMufwNN2HM7aleoXWs= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang , Jacopo Mondi Subject: [PATCH v11 5/7] ipa: rkisp1: algorithms: dpf: Add detailed config logging Date: Thu, 22 Jan 2026 18:47:07 -0500 Message-ID: <20260122234709.2061370-6-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260122234709.2061370-1-rui.wang@ideasonboard.com> References: <20260122234709.2061370-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 977998b3..d19173fe 100644 --- a/src/ipa/rkisp1/algorithms/dpf.cpp +++ b/src/ipa/rkisp1/algorithms/dpf.cpp @@ -282,6 +282,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 */ @@ -318,7 +361,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; @@ -339,7 +382,7 @@ void Dpf::prepare(IPAContext &context, const uint32_t frame, return; } - prepareEnabledMode(context, params); + prepareEnabledMode(context, frameContext, params); } void Dpf::prepareDisabledMode(RkISP1Params *params) @@ -350,7 +393,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; @@ -386,6 +430,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 Thu Jan 22 23:47:08 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 25952 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 50BFCC327D for ; Thu, 22 Jan 2026 23:47:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1712661FDC; Fri, 23 Jan 2026 00:47:38 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="oYu5lrqM"; 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 75CF261FCC for ; Fri, 23 Jan 2026 00:47:31 +0100 (CET) Received: from rui-Precision-7560.local (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4A44382E; Fri, 23 Jan 2026 00:46:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1769125618; bh=H6QLX3JmDSgO3S30M5sws0Fyqbl6nuV22xathvJgWuY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oYu5lrqMSvpKZU2n1hGpAi0FKLgN6/hFeVVZ1CsDd7uY/xIloMRmmdtevEaiDJG7+ coQk0/u35XcD2qzxH+sWyZOaCHDhdRXMUAa08T7vISMBhdhpUTySv503IRSnfvz7+7 bAaphM+VM3/YsM+Lt14tEavUcWOtOa6oZoj6Gdgs= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang Subject: [PATCH v11 6/7] ipa: rkisp1: algorithms: data: enable DPF tuning for sensors Date: Thu, 22 Jan 2026 18:47:08 -0500 Message-ID: <20260122234709.2061370-7-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260122234709.2061370-1-rui.wang@ideasonboard.com> References: <20260122234709.2061370-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..00568f8d 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 Thu Jan 22 23:47:09 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 25953 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 67D2FC32E7 for ; Thu, 22 Jan 2026 23:47:39 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 113E761FDA; Fri, 23 Jan 2026 00:47:39 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="XsMHYlg2"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2CF5061FD1 for ; Fri, 23 Jan 2026 00:47:32 +0100 (CET) Received: from rui-Precision-7560.local (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id F22CF82E; Fri, 23 Jan 2026 00:46:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1769125619; bh=l9BHPDC/sU/VWHBMs/P1kIRjMnlUxaQOKkDyiBh/q3Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XsMHYlg2RAZu14bK+GIw9N11Z2+6z00fi8olj0Sx8HDg3ZNuzdA3LwZbejdzCnBqQ 2vVM1O4caSA3xJ63Kjz03r6nB++vVztnMyVKdH04tMtsi2jSrzrQc28AzIU6B0GGQa Ds1ic3HF0QZX1ryajoQraYCOUEYX+QBr7FAcYjH4= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang Subject: [PATCH v11 7/7] ipa: rkisp1: algorithms: data: Add OV5647/IMX219 tuning file Date: Thu, 22 Jan 2026 18:47:09 -0500 Message-ID: <20260122234709.2061370-8-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260122234709.2061370-1-rui.wang@ideasonboard.com> References: <20260122234709.2061370-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 --- 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..ef3468a1 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..1fc5e6d4 --- /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: +...