{"id":16974,"url":"https://patchwork.libcamera.org/api/patches/16974/?format=json","web_url":"https://patchwork.libcamera.org/patch/16974/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20220805124027.530212-4-fsylvestre@baylibre.com>","date":"2022-08-05T12:40:27","name":"[libcamera-devel,v2,3/3] ipa: rkisp1: Add support of Denoise Pre-Filter control","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"1e65e4fda4bf366a6e7da0dda7831118ed857dfa","submitter":{"id":123,"url":"https://patchwork.libcamera.org/api/people/123/?format=json","name":"Florian Sylvestre","email":"fsylvestre@baylibre.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/16974/mbox/","series":[{"id":3375,"url":"https://patchwork.libcamera.org/api/series/3375/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3375","date":"2022-08-05T12:40:24","name":"Add DPF tuning support for RkISP1","version":2,"mbox":"https://patchwork.libcamera.org/series/3375/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/16974/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/16974/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id D3B62BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  5 Aug 2022 12:40:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 90C476332E;\n\tFri,  5 Aug 2022 14:40:38 +0200 (CEST)","from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com\n\t[IPv6:2a00:1450:4864:20::42f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4405F6332B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  5 Aug 2022 14:40:34 +0200 (CEST)","by mail-wr1-x42f.google.com with SMTP id q30so3084236wra.11\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 05 Aug 2022 05:40:34 -0700 (PDT)","from BL087.. ([2a01:e34:eea9:e630:997d:fb84:b99a:cc47])\n\tby smtp.gmail.com with ESMTPSA id\n\tw13-20020adff9cd000000b0021db7b0162esm3869206wrr.105.2022.08.05.05.40.32\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 05 Aug 2022 05:40:33 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1659703238;\n\tbh=3RGOHjWSDrE8oQoAgiqDRnMtuwlQ0w5dlWa9xdi3Rgs=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=3hU0yHFuD8kwDyPyixTAIAdRqnwFnw8cQmpcrsrNFSts/gOns7CxS4y83FJfBlNMo\n\tku7Hv9nZWZ2ezpobLV3is1hLI8cljDlaYjmcHOzN+TuMJv18f6sufFMgiKDltg/xGm\n\t2rh2KBO1Y4JkAsWtao+Ab5zYjYzZt1m6FNpqXl3B+aWzmNDr2f7jifqtRzpI45K6G/\n\tG4zx7sqi+wfVTGulbEppx6iLvzyGlxj1oR2cVGTtUCfC5UKgp8D+TgBfb3bMDZJZso\n\tDWErNYWja0i1n15SRVVEZqIm3E9H9o8mbGEX/taX7ds/Rv+4p5uxCES4bXgrfTbEUL\n\toIiX073IKbTwg==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=baylibre-com.20210112.gappssmtp.com; s=20210112;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc;\n\tbh=H67sYjTQwAKkCoO0SVF02iDcZeih/Y2Dg8X1+CxPPAo=;\n\tb=2rZWHzslfeXIPOaDGxXIQZYYW0AeLOsSpg9ldv9IjV8rgkmz9guqQzs3lTTz4xKR+R\n\tmxVd4F7V7ubZlU7DUuR9tgV3hF7Gw2NnHV8DdoXKsEeG3n903iyHG0tOWJ4e9uVpI6n5\n\tFNSi285PV4WXHrm4BgA+Cxobwg7qchFG9W241XAHj3DA7KWOd8C6sN0tfQf9UzKNLxh6\n\tK+6mLQ3UHQQluIfu1HZlGbYHZnqjMq3/Auk15h331BGZ80K7flCYE7KKFwhct2Qc4UT5\n\tRRAsmmv5B6ENIafjCW+2ccu1hUsw4aB7Gsk53k+XUewSC3FDXXKEBuwEA8ZaN8Tg7rYV\n\teG2A=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected)\n\theader.d=baylibre-com.20210112.gappssmtp.com\n\theader.i=@baylibre-com.20210112.gappssmtp.com header.b=\"2rZWHzsl\"; \n\tdkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc;\n\tbh=H67sYjTQwAKkCoO0SVF02iDcZeih/Y2Dg8X1+CxPPAo=;\n\tb=DIxVoiqL46SY2RiwPCE5jyrWLXxzmybrQCa7XRpXdhaSJRD9xDkEvw1N7MoYed09bJ\n\t299xZg4Gt2xjjPHX37edPacSJVHPtmtnZaxrvQwOvboyEJpN6nv98U1jF40kXBx5f9Md\n\tdbKPqGmsBeTAmZzM0az5ItsxVkBzKsRDa8H8k/d1UmyJuuFtmXVQUyOM6HNW2mrOl3CQ\n\tTHFAP7HTOmCS91NZCkRiqjdjZ9pT9hKtQdPDZq2QhjPoapCNBNPmbpvvk0K1Lv+H+EAC\n\tSWdVsRFQB2+l+pHwUjuxUYf8zDNFPEP+IBCwTOqKN7NpLVyzge4Le1BnARkMsNyFYkus\n\txdOQ==","X-Gm-Message-State":"ACgBeo1vhGCof+1Jn7bCUtZI7QCxtLUrQFxNxbzysiYeiWRVFAcFd5mf\n\tvw+ro/LejjddHlRSm7AwVvs1C2XfLMFl2gav","X-Google-Smtp-Source":"AA6agR40pzxVOm0eUGvvZYUsr49ZBofyZxcyP+elCw0bredlkJIrnuuTne3Me3zlte/9aYoP/FyeJg==","X-Received":"by 2002:a5d:4b8d:0:b0:21f:cf60:c9e6 with SMTP id\n\tb13-20020a5d4b8d000000b0021fcf60c9e6mr4181623wrt.707.1659703233587; \n\tFri, 05 Aug 2022 05:40:33 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org","Date":"Fri,  5 Aug 2022 14:40:27 +0200","Message-Id":"<20220805124027.530212-4-fsylvestre@baylibre.com>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20220805124027.530212-1-fsylvestre@baylibre.com>","References":"<20220805124027.530212-1-fsylvestre@baylibre.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 3/3] ipa: rkisp1: Add support of\n\tDenoise Pre-Filter control","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Florian Sylvestre via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Florian Sylvestre <fsylvestre@baylibre.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The denoise pre-filter algorithm is a bilateral filter which combines a range\nfilter and a domain filter. The denoise pre-filter is applied before\ndemosaicing.\n\nSigned-off-by: Florian Sylvestre <fsylvestre@baylibre.com>\n---\n src/ipa/rkisp1/algorithms/dpf.cpp     | 253 ++++++++++++++++++++++++++\n src/ipa/rkisp1/algorithms/dpf.h       |  36 ++++\n src/ipa/rkisp1/algorithms/meson.build |   1 +\n src/ipa/rkisp1/data/ov5640.yaml       |  11 ++\n src/ipa/rkisp1/ipa_context.cpp        |  11 ++\n src/ipa/rkisp1/ipa_context.h          |   5 +\n 6 files changed, 317 insertions(+)\n create mode 100644 src/ipa/rkisp1/algorithms/dpf.cpp\n create mode 100644 src/ipa/rkisp1/algorithms/dpf.h","diff":"diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp\nnew file mode 100644\nindex 00000000..07dc20d3\n--- /dev/null\n+++ b/src/ipa/rkisp1/algorithms/dpf.cpp\n@@ -0,0 +1,253 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2021-2022, Ideas On Board\n+ *\n+ * dpf.cpp - RkISP1 Denoise Pre-Filter control\n+ */\n+\n+#include \"dpf.h\"\n+\n+#include <cmath>\n+\n+#include <libcamera/base/log.h>\n+\n+#include <libcamera/control_ids.h>\n+#include \"linux/rkisp1-config.h\"\n+\n+/**\n+ * \\file dpf.h\n+ */\n+\n+namespace libcamera {\n+\n+namespace ipa::rkisp1::algorithms {\n+\n+/**\n+ * \\class Dpf\n+ * \\brief RkISP1 Denoise Pre-Filter control\n+ *\n+ * The denoise pre-filter algorithm is a bilateral filter which combines a\n+ * range filter and a domain filter. The denoise pre-filter is applied before\n+ * demosaicing.\n+ */\n+\n+LOG_DEFINE_CATEGORY(RkISP1Dpf)\n+\n+Dpf::Dpf()\n+\t: initialized_(false), config_({}), strengthConfig_({})\n+{\n+}\n+\n+/**\n+ * \\copydoc libcamera::ipa::Algorithm::init\n+ */\n+int Dpf::init([[maybe_unused]] IPAContext &context,\n+\t      const YamlObject &tuningData)\n+{\n+\tstd::vector<uint16_t> values;\n+\n+\t/*\n+\t * The domain kernel is configured with a 9x9 kernel for the green\n+\t * pixels, and a 13x9 or 9x9 kernel for red and blue pixels.\n+\t */\n+\tconst YamlObject &dFObject = tuningData[\"DomainFilter\"];\n+\n+\t/*\n+\t * For the green component, we have the 9x9 kernel specified\n+\t * as 6 coefficients:\n+\t *    Y\n+\t *    ^\n+\t *  4 | 6   5   4   5   6\n+\t *  3 |   5   3   3   5\n+\t *  2 | 5   3   2   3   5\n+\t *  1 |   3   1   1   3\n+\t *  0 - 4   2   0   2   4\n+\t * -1 |   3   1   1   3\n+\t * -2 | 5   3   2   3   5\n+\t * -3 |   5   3   3   5\n+\t * -4 | 6   5   4   5   6\n+\t *    +---------|--------> X\n+\t *     -4....-1 0 1 2 3 4\n+\t */\n+\tvalues = dFObject[\"g\"].getList<uint16_t>().value_or(utils::defopt);\n+\tif (values.size() != RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS) {\n+\t\tLOG(RkISP1Dpf, Error)\n+\t\t\t<< \"Invalid 'DomainFilter:g': expected \"\n+\t\t\t<< RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS\n+\t\t\t<< \" elements, got \" << values.size();\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tstd::copy_n(values.begin(), values.size(),\n+\t\t    std::begin(config_.g_flt.spatial_coeff));\n+\n+\tconfig_.g_flt.gr_enable = true;\n+\tconfig_.g_flt.gb_enable = true;\n+\n+\t/*\n+\t * For the red and blue components, we have the 13x9 kernel specified\n+\t * as 6 coefficients:\n+\t *\n+\t *    Y\n+\t *    ^\n+\t *  4 | 6   5   4   3   4   5   6\n+\t *    |\n+\t *  2 | 5   4   2   1   2   4   5\n+\t *    |\n+\t *  0 - 5   3   1   0   1   3   5\n+\t *    |\n+\t * -2 | 5   4   2   1   2   4   5\n+\t *    |\n+\t * -4 | 6   5   4   3   4   5   6\n+\t *    +-------------|------------> X\n+\t *     -6  -4  -2   0   2   4   6\n+\t *\n+\t * For a 9x9 kernel, columns -6 and 6 are dropped, so coefficient\n+\t * number 6 is not used.\n+\t */\n+\tvalues = dFObject[\"rb\"].getList<uint16_t>().value_or(utils::defopt);\n+\tif (values.size() != RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS &&\n+\t    values.size() != RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS - 1) {\n+\t\tLOG(RkISP1Dpf, Error)\n+\t\t\t<< \"Invalid 'DomainFilter:rb': expected \"\n+\t\t\t<< RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS - 1\n+\t\t\t<< \" or \" << RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS\n+\t\t\t<< \" elements, got \" << values.size();\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tconfig_.rb_flt.fltsize = values.size() == RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS\n+\t\t\t       ? RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_13x9\n+\t\t\t       : RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_9x9;\n+\n+\tstd::copy_n(values.begin(), values.size(),\n+\t\t    std::begin(config_.rb_flt.spatial_coeff));\n+\n+\tconfig_.rb_flt.r_enable = true;\n+\tconfig_.rb_flt.b_enable = true;\n+\n+\t/*\n+\t * The range kernel is configured with a noise level lookup table (NLL)\n+\t * which stores a piecewise linear function that characterizes the\n+\t * sensor noise profile as a noise level function curve (NLF).\n+\t */\n+\tconst YamlObject &rFObject = tuningData[\"NoiseLevelFunction\"];\n+\n+\tvalues = rFObject[\"coeff\"].getList<uint16_t>().value_or(utils::defopt);\n+\tif (values.size() != RKISP1_CIF_ISP_DPF_MAX_NLF_COEFFS) {\n+\t\tLOG(RkISP1Dpf, Error)\n+\t\t\t<< \"Invalid 'RangeFilter:coeff': expected \"\n+\t\t\t<< RKISP1_CIF_ISP_DPF_MAX_NLF_COEFFS\n+\t\t\t<< \" elements, got \" << values.size();\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tstd::copy_n(values.begin(), values.size(),\n+\t\t    std::begin(config_.nll.coeff));\n+\n+\tstd::string scaleMode = rFObject[\"scale-mode\"].get<std::string>(\"\");\n+\tif (scaleMode == \"linear\") {\n+\t\tconfig_.nll.scale_mode = RKISP1_CIF_ISP_NLL_SCALE_LINEAR;\n+\t} else if (scaleMode == \"logarithmic\") {\n+\t\tconfig_.nll.scale_mode = RKISP1_CIF_ISP_NLL_SCALE_LOGARITHMIC;\n+\t} else {\n+\t\tLOG(RkISP1Dpf, Error)\n+\t\t\t<< \"Invalid 'RangeFilter:scale-mode': expected \"\n+\t\t\t<< \"'linear' or 'logarithmic' value, got \"\n+\t\t\t<< scaleMode;\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tconst YamlObject &fSObject = tuningData[\"FilterStrength\"];\n+\n+\tstrengthConfig_.r = fSObject[\"r\"].get<uint16_t>(64);\n+\tstrengthConfig_.g = fSObject[\"g\"].get<uint16_t>(64);\n+\tstrengthConfig_.b = fSObject[\"b\"].get<uint16_t>(64);\n+\n+\tinitialized_ = true;\n+\n+\treturn 0;\n+}\n+\n+/**\n+ * \\copydoc libcamera::ipa::Algorithm::queueRequest\n+ */\n+void Dpf::queueRequest(IPAContext &context,\n+\t\t       [[maybe_unused]] const uint32_t frame,\n+\t\t       const ControlList &controls)\n+{\n+\tauto &dpf = context.frameContext.dpf;\n+\n+\tconst auto &denoise = controls.get(controls::draft::NoiseReductionMode);\n+\tif (denoise) {\n+\t\tLOG(RkISP1Dpf, Debug) << \"Set denoise to \" << *denoise;\n+\n+\t\tswitch (*denoise) {\n+\t\tcase controls::draft::NoiseReductionModeOff:\n+\t\t\tdpf.denoise = false;\n+\t\t\tdpf.updateParams = true;\n+\t\t\tbreak;\n+\t\tcase controls::draft::NoiseReductionModeMinimal:\n+\t\tcase controls::draft::NoiseReductionModeHighQuality:\n+\t\tcase controls::draft::NoiseReductionModeFast:\n+\t\t\tdpf.denoise = true;\n+\t\t\tdpf.updateParams = true;\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tLOG(RkISP1Dpf, Error)\n+\t\t\t\t<< \"Unsupported denoise value \"\n+\t\t\t\t<< *denoise;\n+\t\t}\n+\t}\n+}\n+\n+/**\n+ * \\copydoc libcamera::ipa::Algorithm::prepare\n+ */\n+void Dpf::prepare(IPAContext &context, rkisp1_params_cfg *params)\n+{\n+\tauto &dpf = context.frameContext.dpf;\n+\n+\tif (context.frameContext.frameCount > 0 && !dpf.updateParams)\n+\t\treturn;\n+\n+\tif (!initialized_)\n+\t\treturn;\n+\n+\tauto &awb = context.configuration.awb;\n+\tauto &lsc = context.configuration.lsc;\n+\tauto &dpf_config = params->others.dpf_config;\n+\tauto &dpf_strength_config = params->others.dpf_strength_config;\n+\tauto &mode = dpf_config.gain.mode;\n+\n+\tif (context.frameContext.frameCount == 0) {\n+\t\tdpf_config = config_;\n+\t\tdpf_strength_config = strengthConfig_;\n+\n+\t\tif (awb.enabled && lsc.enabled)\n+\t\t\tmode = RKISP1_CIF_ISP_DPF_GAIN_USAGE_AWB_LSC_GAINS;\n+\t\telse if (awb.enabled)\n+\t\t\tmode = RKISP1_CIF_ISP_DPF_GAIN_USAGE_AWB_GAINS;\n+\t\telse if (lsc.enabled)\n+\t\t\tmode = RKISP1_CIF_ISP_DPF_GAIN_USAGE_LSC_GAINS;\n+\t\telse\n+\t\t\tmode = RKISP1_CIF_ISP_DPF_GAIN_USAGE_DISABLED;\n+\n+\t\tparams->module_cfg_update |= RKISP1_CIF_ISP_MODULE_DPF |\n+\t\t\t\t\t     RKISP1_CIF_ISP_MODULE_DPF_STRENGTH;\n+\t}\n+\n+\tif (dpf.updateParams) {\n+\t\tparams->module_en_update |= RKISP1_CIF_ISP_MODULE_DPF;\n+\t\tif (dpf.denoise)\n+\t\t\tparams->module_ens |= RKISP1_CIF_ISP_MODULE_DPF;\n+\n+\t\tdpf.updateParams = false;\n+\t}\n+}\n+\n+REGISTER_IPA_ALGORITHM(Dpf, \"Dpf\")\n+\n+} /* namespace ipa::rkisp1::algorithms */\n+\n+} /* namespace libcamera */\ndiff --git a/src/ipa/rkisp1/algorithms/dpf.h b/src/ipa/rkisp1/algorithms/dpf.h\nnew file mode 100644\nindex 00000000..128ebd5e\n--- /dev/null\n+++ b/src/ipa/rkisp1/algorithms/dpf.h\n@@ -0,0 +1,36 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2021-2022, Ideas On Board\n+ *\n+ * dpf.h - RkISP1 Denoise Pre-Filter control\n+ */\n+\n+#pragma once\n+\n+#include <sys/types.h>\n+\n+#include \"algorithm.h\"\n+\n+namespace libcamera {\n+\n+namespace ipa::rkisp1::algorithms {\n+\n+class Dpf : public Algorithm\n+{\n+public:\n+\tDpf();\n+\t~Dpf() = default;\n+\n+\tint init(IPAContext &context, const YamlObject &tuningData) override;\n+\tvoid queueRequest(IPAContext &context, const uint32_t frame,\n+\t\t\t  const ControlList &controls) override;\n+\tvoid prepare(IPAContext &context, rkisp1_params_cfg *params) override;\n+\n+private:\n+\tbool initialized_;\n+\tstruct rkisp1_cif_isp_dpf_config config_;\n+\tstruct rkisp1_cif_isp_dpf_strength_config strengthConfig_;\n+};\n+\n+} /* namespace ipa::rkisp1::algorithms */\n+} /* namespace libcamera */\ndiff --git a/src/ipa/rkisp1/algorithms/meson.build b/src/ipa/rkisp1/algorithms/meson.build\nindex e48974b4..93a48329 100644\n--- a/src/ipa/rkisp1/algorithms/meson.build\n+++ b/src/ipa/rkisp1/algorithms/meson.build\n@@ -6,6 +6,7 @@ rkisp1_ipa_algorithms = files([\n     'blc.cpp',\n     'cproc.cpp',\n     'dpcc.cpp',\n+    'dpf.cpp',\n     'filter.cpp',\n     'gsl.cpp',\n     'lsc.cpp',\ndiff --git a/src/ipa/rkisp1/data/ov5640.yaml b/src/ipa/rkisp1/data/ov5640.yaml\nindex 93d7d1e7..e251abd4 100644\n--- a/src/ipa/rkisp1/data/ov5640.yaml\n+++ b/src/ipa/rkisp1/data/ov5640.yaml\n@@ -156,5 +156,16 @@ algorithms:\n           rnd-offsets:\n             green: 2\n             red-blue: 2\n+  - Dpf:\n+      DomainFilter:\n+        g: [ 16, 16, 16, 16, 16, 16 ]\n+        rb: [ 16, 16, 16, 16, 16, 16 ]\n+      NoiseLevelFunction:\n+        coeff: [ 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023 ]\n+        scale-mode: \"linear\"\n+      FilterStrength:\n+        r: 64\n+        g: 64\n+        b: 64\n   - Filter:\n ...\ndiff --git a/src/ipa/rkisp1/ipa_context.cpp b/src/ipa/rkisp1/ipa_context.cpp\nindex 1338ae40..70001d32 100644\n--- a/src/ipa/rkisp1/ipa_context.cpp\n+++ b/src/ipa/rkisp1/ipa_context.cpp\n@@ -164,6 +164,17 @@ namespace libcamera::ipa::rkisp1 {\n  * \\brief Indicates if ISP parameters need to be updated\n  */\n \n+/**\n+ * \\var IPAFrameContext::dpf\n+ * \\brief Context for the Denoise Pre-Filter algorithm\n+ *\n+ * \\var IPAFrameContext::dpf.denoise\n+ * \\brief Indicates if denoise is activated\n+ *\n+ * \\var IPAFrameContext::dpf.updateParams\n+ * \\brief Indicates if ISP parameters need to be updated\n+ */\n+\n /**\n  * \\var IPAFrameContext::filter\n  * \\brief Context for the Filter algorithm\ndiff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h\nindex 0cd6aadb..3a743ac3 100644\n--- a/src/ipa/rkisp1/ipa_context.h\n+++ b/src/ipa/rkisp1/ipa_context.h\n@@ -69,6 +69,11 @@ struct IPAFrameContext {\n \t\tbool updateParams;\n \t} cproc;\n \n+\tstruct {\n+\t\tbool denoise;\n+\t\tbool updateParams;\n+\t} dpf;\n+\n \tstruct {\n \t\tuint8_t denoise;\n \t\tuint8_t sharpness;\n","prefixes":["libcamera-devel","v2","3/3"]}