From patchwork Thu Jan 15 16:33:12 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 25817 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 EAAEEBDCBF for ; Thu, 15 Jan 2026 16:33:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id AA62B61FC2; Thu, 15 Jan 2026 17:33:38 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="efmcmxKf"; 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 35D0A61FBB for ; Thu, 15 Jan 2026 17:33:37 +0100 (CET) Received: from rui-Precision-7560.local (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3A8532E0; Thu, 15 Jan 2026 17:33:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1768494789; bh=thh0AlTx71H+mocsY8DN6956B5cG5XiW1tYyjeRYSSU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=efmcmxKfoa0iNUeshWhGCI3x6PadNTE2mAOMSnEedy3ZASN7vHkFDQfY+BW9+fOv0 6tRdxV76py6knZpc3b7FXdRGxoCbnNFbguAX7uOrGpDuKlfANIjM+jsMGUGz8eB06+ d5igU7im1r8HfCjNACu4HnbUhZoEmPl8bnBLbdEY= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang , Jacopo Mondi Subject: [PATCH v8 1/7] ipa: rkisp1: algorithms: dpf: refactor DPF parsing and initialization Date: Thu, 15 Jan 2026 11:33:12 -0500 Message-ID: <20260115163318.1339354-2-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260115163318.1339354-1-rui.wang@ideasonboard.com> References: <20260115163318.1339354-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 15 16:33:13 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 25818 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 C4988BDCBF for ; Thu, 15 Jan 2026 16:33:40 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7A51A61FC1; Thu, 15 Jan 2026 17:33:40 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="rl4PVJxe"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CF93B61F84 for ; Thu, 15 Jan 2026 17:33:39 +0100 (CET) Received: from rui-Precision-7560.local (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id DFE4E2E0; Thu, 15 Jan 2026 17:33:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1768494792; bh=Vvf7nRAHasiuOef6rwR0wVJwYQw3YmJWB2d+r0ynsws=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rl4PVJxeXm9Q8aeNj9wNeCzUDhzzK9HSCyyS+ZPpRK0T3RMkJGN5nkcGpspHO3dFR LmOaJPndRJCEMCBihPnO7YZyJjsZeQSz0kYGI+EPlq8sGJCd0Sw5MKXSZFao1OC4fO Y33vAX/Sf8VRm9hGJ5nCYsaCdwFemL59Xw3ooBco= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang , Jacopo Mondi Subject: [PATCH v8 2/7] ipa: rkisp1: algorithms: dpf: Implement mode switching Date: Thu, 15 Jan 2026 11:33:13 -0500 Message-ID: <20260115163318.1339354-3-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260115163318.1339354-1-rui.wang@ideasonboard.com> References: <20260115163318.1339354-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 support for switching between different noise reduction modes. Introduce `noiseReductionModes_` to store mode-specific configs. LoadReductionConfig() select specific config from configs. Signed-off-by: Rui Wang Reviewed-by: Jacopo Mondi --- 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 --- src/ipa/rkisp1/algorithms/dpf.cpp | 90 +++++++++++++++++++++++++++---- src/ipa/rkisp1/algorithms/dpf.h | 11 ++++ 2 files changed, 92 insertions(+), 9 deletions(-) diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp index dd3effa1..9b663831 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,21 @@ namespace ipa::rkisp1::algorithms { LOG_DEFINE_CATEGORY(RkISP1Dpf) +namespace { + +const std::map kModesMap = { + { controls::draft::NoiseReductionModeMinimal, "minimal" }, + { controls::draft::NoiseReductionModeFast, "fast" }, + { controls::draft::NoiseReductionModeHighQuality, "highquality" }, + { controls::draft::NoiseReductionModeZSL, "zsl" }, + { controls::draft::NoiseReductionModeOff, "off" }, +}; + +} /* namespace */ + Dpf::Dpf() - : config_({}), strengthConfig_({}) + : config_({}), strengthConfig_({}), noiseReductionModes_({}), + runningMode_(controls::draft::NoiseReductionModeOff) { } @@ -57,10 +71,43 @@ 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 modes. */ + return parseModes(tuningData); +} + +int Dpf::parseModes(const YamlObject &tuningData) +{ + /* Parse noise reduction modes. */ + if (!tuningData.contains("modes")) + return -EINVAL; + + noiseReductionModes_.clear(); + for (const auto &entry : tuningData["modes"].asList()) { + std::optional typeOpt = + entry["type"].get(); + if (!typeOpt) { + LOG(RkISP1Dpf, Error) << "Modes entry missing type"; + return -EINVAL; + } + + ModeConfig mode; + auto it = std::find_if(kModesMap.begin(), kModesMap.end(), + [&typeOpt](const auto &pair) { + return pair.second == *typeOpt; + }); + + if (it == kModesMap.end()) { + LOG(RkISP1Dpf, Error) << "Unknown mode type: " << *typeOpt; + return -EINVAL; + } + + mode.modeValue = it->first; + auto ret = parseSingleConfig(entry, mode.dpf, mode.strength); + if (ret) + return ret; + + noiseReductionModes_.push_back(mode); + } return 0; } @@ -193,6 +240,28 @@ int Dpf::parseSingleConfig(const YamlObject &tuningData, return 0; } +bool Dpf::loadReductionConfig(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: " << kModesMap.at(mode); + return false; + } + + config_ = it->dpf; + strengthConfig_ = it->strength; + + LOG(RkISP1Dpf, Debug) + << "DPF mode=Reduction (config loaded)" + << " mode=" << kModesMap.at(mode); + + return true; +} + /** * \copydoc libcamera::ipa::Algorithm::queueRequest */ @@ -206,8 +275,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 +285,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 (loadReductionConfig(*denoise)) { update = true; + dpf.denoise = true; } break; default: @@ -229,6 +297,10 @@ void Dpf::queueRequest(IPAContext &context, << *denoise; break; } + if (update) { + runningMode_ = *denoise; + LOG(RkISP1Dpf, Debug) << "Set denoise to " << kModesMap.at(runningMode_); + } } frameContext.dpf.denoise = dpf.denoise; diff --git a/src/ipa/rkisp1/algorithms/dpf.h b/src/ipa/rkisp1/algorithms/dpf.h index 39186c55..2a2c7052 100644 --- a/src/ipa/rkisp1/algorithms/dpf.h +++ b/src/ipa/rkisp1/algorithms/dpf.h @@ -30,13 +30,24 @@ 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 parseModes(const YamlObject &tuningData); int parseSingleConfig(const YamlObject &tuningData, rkisp1_cif_isp_dpf_config &config, rkisp1_cif_isp_dpf_strength_config &strengthConfig); + bool loadReductionConfig(int32_t mode); + struct rkisp1_cif_isp_dpf_config config_; struct rkisp1_cif_isp_dpf_strength_config strengthConfig_; + std::vector noiseReductionModes_; + int32_t runningMode_; }; } /* namespace ipa::rkisp1::algorithms */ From patchwork Thu Jan 15 16:33:14 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 25819 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 82900BDCBF for ; Thu, 15 Jan 2026 16:33:44 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3AB7661FCA; Thu, 15 Jan 2026 17:33:44 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="E/8uIeyc"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 53C7E61FBB for ; Thu, 15 Jan 2026 17:33:42 +0100 (CET) Received: from rui-Precision-7560.local (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4DD2828F7; Thu, 15 Jan 2026 17:33:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1768494794; bh=dVO7CM9MENrFpa2gStAyN95pLdOEa+h2Ek4sdv4vtGc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E/8uIeyc9tjbOxSJ3L8DF6XmU+Jt4KCHjR406cY/EDUHg9X544H3h5vKcW4WPlBIj WM/B2pZ+DETHyP0eGHXnCG9AfKQ2/X2nLQjfz9A26JJdef/tJ3wJ182sMnQ7g4Vg0a vIAX5528IIxi1JopZCjAtynWVOO+o3wJrYYso3pQ= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang , Jacopo Mondi Subject: [PATCH v8 3/7] ipa: rkisp1: algorithms: dpf: Refactor prepare() into helpers Date: Thu, 15 Jan 2026 11:33:14 -0500 Message-ID: <20260115163318.1339354-4-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260115163318.1339354-1-rui.wang@ideasonboard.com> References: <20260115163318.1339354-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 v5i/v6: Nothing changed Reviewed-by tags from v5 are carried over (no code changes). --- src/ipa/rkisp1/algorithms/dpf.cpp | 80 ++++++++++++++++++++----------- src/ipa/rkisp1/algorithms/dpf.h | 7 +++ 2 files changed, 58 insertions(+), 29 deletions(-) diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp index 9b663831..09f2bcbd 100644 --- a/src/ipa/rkisp1/algorithms/dpf.cpp +++ b/src/ipa/rkisp1/algorithms/dpf.cpp @@ -316,38 +316,60 @@ void Dpf::prepare(IPAContext &context, const uint32_t frame, if (!frameContext.dpf.update && frame > 0) return; + if (!frameContext.dpf.denoise) { + prepareDisabledMode(context, frame, frameContext, params); + return; + } + + prepareEnabledMode(context, frame, frameContext, params); +} + +void Dpf::prepareDisabledMode([[maybe_unused]] IPAContext &context, + [[maybe_unused]] const uint32_t frame, + [[maybe_unused]] IPAFrameContext &frameContext, + RkISP1Params *params) +{ + auto dpfConfig = params->block(); + dpfConfig.setEnabled(false); + auto dpfStrength = params->block(); + dpfStrength.setEnabled(false); +} + +void Dpf::prepareEnabledMode(IPAContext &context, [[maybe_unused]] const uint32_t frame, + [[maybe_unused]] IPAFrameContext &frameContext, + RkISP1Params *params) +{ auto config = params->block(); - config.setEnabled(frameContext.dpf.denoise); + config.setEnabled(true); + *config = config_; + + 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; + + config_.gain.mode = mode; auto strengthConfig = params->block(); - strengthConfig.setEnabled(frameContext.dpf.denoise); - - if (frameContext.dpf.denoise) { - *config = config_; - *strengthConfig = strengthConfig_; - - 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 = strengthConfig_; } REGISTER_IPA_ALGORITHM(Dpf, "Dpf") diff --git a/src/ipa/rkisp1/algorithms/dpf.h b/src/ipa/rkisp1/algorithms/dpf.h index 2a2c7052..fcf121cb 100644 --- a/src/ipa/rkisp1/algorithms/dpf.h +++ b/src/ipa/rkisp1/algorithms/dpf.h @@ -44,6 +44,13 @@ private: bool loadReductionConfig(int32_t mode); + void prepareDisabledMode(IPAContext &context, const uint32_t frame, + IPAFrameContext &frameContext, + RkISP1Params *params); + void prepareEnabledMode(IPAContext &context, const uint32_t frame, + IPAFrameContext &frameContext, + RkISP1Params *params); + struct rkisp1_cif_isp_dpf_config config_; struct rkisp1_cif_isp_dpf_strength_config strengthConfig_; std::vector noiseReductionModes_; From patchwork Thu Jan 15 16:33:15 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 25820 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 F0C3FBDCBF for ; Thu, 15 Jan 2026 16:33:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B5EF361FC2; Thu, 15 Jan 2026 17:33:46 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Zf3st2eO"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C848E61FC1 for ; Thu, 15 Jan 2026 17:33:44 +0100 (CET) Received: from rui-Precision-7560.local (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A798C28F9; Thu, 15 Jan 2026 17:33:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1768494797; bh=YQpX6IacSIV8H6g8WKaN+cngPwAojyH/uVIfbd2VmRc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zf3st2eOLBPf7Du41IyqZO67mOiG+dcUzS6QPUfZbhyC1nmuIqIXbjmkp0bUpTMv/ w6ExmCKW7er4a2FgTg1oJYqhsWsTPbbBtlgszk32i2d42nhO/VoOh3zFfoSZknPT0I sqe/nuIs7c6wHvVV1vkZEbYWa9NiKqhDoI/jB8S8= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang , Jacopo Mondi Subject: [PATCH v8 4/7] ipa: rkisp1: algorithms: dpf: Simplify YAML key names Date: Thu, 15 Jan 2026 11:33:15 -0500 Message-ID: <20260115163318.1339354-5-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260115163318.1339354-1-rui.wang@ideasonboard.com> References: <20260115163318.1339354-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" Rename DPF tuning file keys to shorter, more concise names: - DomainFilter -> filter - NoiseLevelFunction -> nll - FilterStrength -> strength This improves readability and reduces verbosity in tuning files while maintaining the same functionality. Error messages are updated accordingly to reflect the new key names. Signed-off-by: Rui Wang Reviewed-by: Jacopo Mondi --- changelog since v5/v6: Nothing changed --- src/ipa/rkisp1/algorithms/dpf.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp index 09f2bcbd..c7d7ade0 100644 --- a/src/ipa/rkisp1/algorithms/dpf.cpp +++ b/src/ipa/rkisp1/algorithms/dpf.cpp @@ -122,7 +122,7 @@ int Dpf::parseSingleConfig(const YamlObject &tuningData, * The domain kernel is configured with a 9x9 kernel for the green * pixels, and a 13x9 or 9x9 kernel for red and blue pixels. */ - const YamlObject &dFObject = tuningData["DomainFilter"]; + const YamlObject &dFObject = tuningData["filter"]; /* * For the green component, we have the 9x9 kernel specified @@ -144,7 +144,7 @@ int Dpf::parseSingleConfig(const YamlObject &tuningData, values = dFObject["g"].getList().value_or(std::vector{}); if (values.size() != RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS) { LOG(RkISP1Dpf, Error) - << "Invalid 'DomainFilter:g': expected " + << "Invalid 'filter:g': expected " << RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS << " elements, got " << values.size(); return -EINVAL; @@ -181,7 +181,7 @@ int Dpf::parseSingleConfig(const YamlObject &tuningData, if (values.size() != RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS && values.size() != RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS - 1) { LOG(RkISP1Dpf, Error) - << "Invalid 'DomainFilter:rb': expected " + << "Invalid 'filter:rb': expected " << RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS - 1 << " or " << RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS << " elements, got " << values.size(); @@ -203,13 +203,13 @@ int Dpf::parseSingleConfig(const YamlObject &tuningData, * which stores a piecewise linear function that characterizes the * sensor noise profile as a noise level function curve (NLF). */ - const YamlObject &rFObject = tuningData["NoiseLevelFunction"]; + const YamlObject &rFObject = tuningData["nll"]; std::vector nllValues; nllValues = rFObject["coeff"].getList().value_or(std::vector{}); if (nllValues.size() != RKISP1_CIF_ISP_DPF_MAX_NLF_COEFFS) { LOG(RkISP1Dpf, Error) - << "Invalid 'RangeFilter:coeff': expected " + << "Invalid 'nll:coeff': expected " << RKISP1_CIF_ISP_DPF_MAX_NLF_COEFFS << " elements, got " << nllValues.size(); return -EINVAL; @@ -225,13 +225,13 @@ int Dpf::parseSingleConfig(const YamlObject &tuningData, config.nll.scale_mode = RKISP1_CIF_ISP_NLL_SCALE_LOGARITHMIC; } else { LOG(RkISP1Dpf, Error) - << "Invalid 'RangeFilter:scale-mode': expected " + << "Invalid 'nll:scale-mode': expected " << "'linear' or 'logarithmic' value, got " << scaleMode; return -EINVAL; } - const YamlObject &fSObject = tuningData["FilterStrength"]; + const YamlObject &fSObject = tuningData["strength"]; strengthConfig.r = fSObject["r"].get().value_or(64); strengthConfig.g = fSObject["g"].get().value_or(64); From patchwork Thu Jan 15 16:33:16 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 25821 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 9DE81C3274 for ; Thu, 15 Jan 2026 16:33:48 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3FD8C61FCA; Thu, 15 Jan 2026 17:33:48 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Yt2aaP7w"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D571B61FC6 for ; Thu, 15 Jan 2026 17:33:46 +0100 (CET) Received: from rui-Precision-7560.local (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id BBA7A2E0; Thu, 15 Jan 2026 17:33:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1768494799; bh=iY5ohKtTXYxPVWno5OBrQg4ADTRrn2+dmb2a8lb/EjE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yt2aaP7wiWilD7oXLVCxRSTG8Ta3Th7r+xCkTsPbJMn3/cZUIO+sDhdKQ5lt0VKgF EjDEZs6Rt2f+Wrm9dHv8Z6T5SUt/eyNsWSaQhZMpRyXHAeIjAYLSXHgT6C2cB4l9xb sUU2YlNnw5ipCV840sMvc8kHhLPZrHNoHkxsZmHk= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang , Jacopo Mondi Subject: [PATCH v8 5/7] ipa: rkisp1: algorithms: dpf: Add detailed config logging Date: Thu, 15 Jan 2026 11:33:16 -0500 Message-ID: <20260115163318.1339354-6-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260115163318.1339354-1-rui.wang@ideasonboard.com> References: <20260115163318.1339354-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 --- src/ipa/rkisp1/algorithms/dpf.cpp | 44 +++++++++++++++++++++++++++++++ src/ipa/rkisp1/algorithms/dpf.h | 1 + 2 files changed, 45 insertions(+) diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp index c7d7ade0..8aa1a049 100644 --- a/src/ipa/rkisp1/algorithms/dpf.cpp +++ b/src/ipa/rkisp1/algorithms/dpf.cpp @@ -262,6 +262,47 @@ bool Dpf::loadReductionConfig(int32_t mode) return true; } +void Dpf::logConfig(const IPAFrameContext &frameContext) +{ + std::ostringstream ss; + + ss << "DPF config update: "; + ss << " control mode=" << kModesMap.at(runningMode_); + 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 */ @@ -370,6 +411,9 @@ void Dpf::prepareEnabledMode(IPAContext &context, [[maybe_unused]] const uint32_ auto strengthConfig = params->block(); strengthConfig.setEnabled(true); *strengthConfig = strengthConfig_; + + if (frameContext.dpf.update) + logConfig(frameContext); } REGISTER_IPA_ALGORITHM(Dpf, "Dpf") diff --git a/src/ipa/rkisp1/algorithms/dpf.h b/src/ipa/rkisp1/algorithms/dpf.h index fcf121cb..1821da39 100644 --- a/src/ipa/rkisp1/algorithms/dpf.h +++ b/src/ipa/rkisp1/algorithms/dpf.h @@ -43,6 +43,7 @@ private: rkisp1_cif_isp_dpf_strength_config &strengthConfig); bool loadReductionConfig(int32_t mode); + void logConfig(const IPAFrameContext &frameContext); void prepareDisabledMode(IPAContext &context, const uint32_t frame, IPAFrameContext &frameContext, From patchwork Thu Jan 15 16:33:17 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 25822 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 4AD66BDCBF for ; Thu, 15 Jan 2026 16:33:50 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id EAA5961FD1; Thu, 15 Jan 2026 17:33:49 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="JhDOvUeP"; 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 239F761FC1 for ; Thu, 15 Jan 2026 17:33:49 +0100 (CET) Received: from rui-Precision-7560.local (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9E8EA28F9; Thu, 15 Jan 2026 17:33:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1768494801; bh=S0VA3YddNzZ7e5E+IvQRiHxucBMb5T0MyKEg21rrosk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JhDOvUePqsKbgc1DX7O0tP7gq6gnimv1yfzAMStuVpV2XsoiCBmwdBnJa3NiHXNvw 2Ajb3rL3nBpqDMUuWRG6XjxRTmW8RGjKL2yue4cIlkMXYJVUkYBYqtZzLN3qyukma2 QXodvz7PRDIHESxLpQtdGDWTu2ZEAwyy8XrYWn/k= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang Subject: [PATCH v8 6/7] ipa: rkisp1: algorithms: data: enable DPF tuning for sensors Date: Thu, 15 Jan 2026 11:33:17 -0500 Message-ID: <20260115163318.1339354-7-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260115163318.1339354-1-rui.wang@ideasonboard.com> References: <20260115163318.1339354-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 imx219/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 --- src/ipa/rkisp1/data/imx219.yaml | 24 ++++++++++++++ src/ipa/rkisp1/data/ov5640.yaml | 59 +++++++++++++++++++++++++-------- 2 files changed, 69 insertions(+), 14 deletions(-) diff --git a/src/ipa/rkisp1/data/imx219.yaml b/src/ipa/rkisp1/data/imx219.yaml index 0d99cb52..54a8ae2d 100644 --- a/src/ipa/rkisp1/data/imx219.yaml +++ b/src/ipa/rkisp1/data/imx219.yaml @@ -111,4 +111,28 @@ algorithms: 1438, 1226, 1059, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1025, 1054, 1185, 1326, 1334, 1334, ] + - Dpf: + modes: + - type: "minimal" + filter: + g: [ 14, 10, 7, 4, 2, 1 ] + rb: [ 14, 11, 8, 4, 2, 1 ] + nll: + coeff: [ 0, 26, 52, 78, 106, 138, 172, 208, 248, 292, 340, 392, 448, 508, 572, 640, 712 ] + scale-mode: "linear" + strength: + r: 60 + g: 60 + b: 60 + - type: "highquality" + filter: + g: [ 22, 18, 13, 8, 5, 2 ] + rb: [ 20, 18, 16, 11, 7, 3 ] + nll: + coeff: [ 0, 26, 52, 78, 106, 138, 172, 208, 248, 292, 340, 392, 448, 508, 572, 640, 712 ] + scale-mode: "linear" + strength: + r: 130 + g: 130 + b: 130 ... diff --git a/src/ipa/rkisp1/data/ov5640.yaml b/src/ipa/rkisp1/data/ov5640.yaml index 4b21d412..4d5e7053 100644 --- a/src/ipa/rkisp1/data/ov5640.yaml +++ b/src/ipa/rkisp1/data/ov5640.yaml @@ -232,19 +232,50 @@ 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 + modes: + - type: "minimal" + filter: + g: [ 14, 10, 7, 4, 2, 1 ] + rb: [ 14, 11, 8, 4, 2, 1 ] + nll: + coeff: [ 0, 26, 52, 78, 106, 138, 172, 208, 248, 292, 340, 392, 448, 508, 572, 640, 712 ] + scale-mode: "linear" + strength: + r: 60 + g: 60 + b: 60 + - type: "highquality" + filter: + g: [ 22, 18, 13, 8, 5, 2 ] + rb: [ 20, 18, 16, 11, 7, 3 ] + nll: + coeff: [ 0, 26, 52, 78, 106, 138, 172, 208, 248, 292, 340, 392, 448, 508, 572, 640, 712 ] + scale-mode: "linear" + strength: + r: 130 + g: 130 + b: 130 + - type: "fast" + filter: + g: [ 16, 12, 9, 5, 3, 1 ] + rb: [ 16, 13, 10, 6, 4, 2 ] + nll: + coeff: [ 0, 16, 32, 48, 66, 86, 108, 132, 160, 192, 228, 268, 312, 360, 412, 468, 528 ] + scale-mode: "linear" + strength: + r: 90 + g: 90 + b: 90 + - type: "zsl" + filter: + g: [ 18, 14, 10, 6, 3, 1 ] + rb: [ 18, 16, 13, 9, 5, 3 ] + nll: + coeff: [ 0, 20, 40, 60, 82, 106, 132, 160, 192, 228, 268, 312, 360, 412, 468, 528, 592 ] + scale-mode: "linear" + strength: + r: 110 + g: 110 + b: 110 - Filter: ... From patchwork Thu Jan 15 16:33:18 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 25823 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 15162C3274 for ; Thu, 15 Jan 2026 16:33:52 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9CE4361FC4; Thu, 15 Jan 2026 17:33:52 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="g4w6at9x"; 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 D3CE761FC4 for ; Thu, 15 Jan 2026 17:33:49 +0100 (CET) Received: from rui-Precision-7560.local (unknown [209.216.103.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id EB1096A8; Thu, 15 Jan 2026 17:33:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1768494802; bh=6QNL7gN8ZhSwMlsuY91q2BsYpg4Khe7miIskCog+Rag=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g4w6at9xPCx6K+EyhkEArNixM2YMjvcBTLHYMdrXo4PhKbbUbmsWEvYqLoWNOur5S UZIWIF2o9h4ObkkkHYlK6SXSA4F5VIoBhWnbLH/zaOab+lli22J9IV78CCNKhEzBq9 cmTqjnauLy/YWQmOmqXSxHXbJTRneRepz4UX7plI= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang Subject: [PATCH v8 7/7] ipa: rkisp1: algorithms: data: Add OV5647 tuning file Date: Thu, 15 Jan 2026 11:33:18 -0500 Message-ID: <20260115163318.1339354-8-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260115163318.1339354-1-rui.wang@ideasonboard.com> References: <20260115163318.1339354-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. Signed-off-by: Rui Wang --- src/ipa/rkisp1/data/meson.build | 1 + src/ipa/rkisp1/data/ov5647.yaml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 src/ipa/rkisp1/data/ov5647.yaml 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..1d42e4c7 --- /dev/null +++ b/src/ipa/rkisp1/data/ov5647.yaml @@ -0,0 +1,32 @@ +# SPDX-License-Identifier: CC0-1.0 +%YAML 1.1 +--- +version: 1 +algorithms: + - Agc: + - Awb: + - Dpf: + modes: + - type: "minimal" + filter: + g: [ 14, 10, 7, 4, 2, 1 ] + rb: [ 14, 11, 8, 4, 2, 1 ] + nll: + coeff: [ 0, 26, 52, 78, 106, 138, 172, 208, 248, 292, 340, 392, 448, 508, 572, 640, 712 ] + scale-mode: "linear" + strength: + r: 60 + g: 60 + b: 60 + - type: "highquality" + filter: + g: [ 22, 18, 13, 8, 5, 2 ] + rb: [ 20, 18, 16, 11, 7, 3 ] + nll: + coeff: [ 0, 26, 52, 78, 106, 138, 172, 208, 248, 292, 340, 392, 448, 508, 572, 640, 712 ] + scale-mode: "linear" + strength: + r: 1 + g: 1 + b: 1 +...