Patch Detail
Show a patch.
GET /api/1.1/patches/19120/?format=api
{ "id": 19120, "url": "https://patchwork.libcamera.org/api/1.1/patches/19120/?format=api", "web_url": "https://patchwork.libcamera.org/patch/19120/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20231006132000.23504-19-naush@raspberrypi.com>", "date": "2023-10-06T13:19:58", "name": "[libcamera-devel,18/20] ipa: rpi: denoise: Support different denoise configurations", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "0ca01119f6e593308926d609892531372ff7a23b", "submitter": { "id": 34, "url": "https://patchwork.libcamera.org/api/1.1/people/34/?format=api", "name": "Naushir Patuck", "email": "naush@raspberrypi.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/19120/mbox/", "series": [ { "id": 4047, "url": "https://patchwork.libcamera.org/api/1.1/series/4047/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4047", "date": "2023-10-06T13:19:40", "name": "Raspberry Pi: Preliminary PiSP support", "version": 1, "mbox": "https://patchwork.libcamera.org/series/4047/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/19120/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/19120/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 7A9A9C32B8\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 6 Oct 2023 13:20:22 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 29D0D6299D;\n\tFri, 6 Oct 2023 15:20:22 +0200 (CEST)", "from mail-wr1-x429.google.com (mail-wr1-x429.google.com\n\t[IPv6:2a00:1450:4864:20::429])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CA3F062969\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 6 Oct 2023 15:20:19 +0200 (CEST)", "by mail-wr1-x429.google.com with SMTP id\n\tffacd0b85a97d-323168869daso2030826f8f.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 06 Oct 2023 06:20:19 -0700 (PDT)", "from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tm8-20020a056000180800b00321773bb933sm1639478wrh.77.2023.10.06.06.20.17\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 06 Oct 2023 06:20:17 -0700 (PDT)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1696598422;\n\tbh=a45WmFNuorh7GWBgUQj37lz3xuS4EXguvzLOZ0lzpJQ=;\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=OheVbbnQhV909xeZYScJu3PdmJmGN2UkFfieFuWmJ6j69fhPoIVcg8DYqDbv+4MYi\n\tn2Xddv4OcKZyPlt+NfPJHVpfdUZ+fhfQeDEzT8WpU4GZLzxCT2hwGKfZF9Fj0vRCGy\n\ts/R2OHIntWYnk1e859i727LwqOWhG7VGbONMEpnadNLgOYiWGmosuHIqUUvllYCK/U\n\tPK27xGqXRLS4eXLWcfvAHXAMy0Zc3iA5gplmSVRz2Q7FEa21G97JQDqFynLaw/gJbw\n\tqME+Xn9VOKSbHVDOrOcrH95X+SeA3CQx7BBaTSSJL2A7cS0UGGu12x0UPOsS5HWAh3\n\tY5vlQj5zSJnsQ==", "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1696598419; x=1697203219;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=ZNgXgb+Cnl0XP4aIcikz0avyv8rl0oeOdAohyVFJnWw=;\n\tb=iCtnyEPIQaalWY3Afe+ZANs0wdG84IoXA+zUeOeJvzpdnvxvYYid5vO70yHTHIW/K5\n\tesLfZWzUZGB1Jhsp7awVlPjPy2ZIIIrj9pZXpWnmg2OJftFBcnQv4Ix3p4nY11Kp0F2f\n\tb7sPeKfjUYRuXWPVcLZ9g7BzZruOmkjBKkmoCWHR4a+OY+B7rir3l/y8/U8ijBZ3LX+p\n\tqH5ktKapWx0LqD4fVLE7rpCzuX99jT9KfoYzXsVVUAW7Yqmc2T7yZk8GniM4/4Ss/LVD\n\txYm6rbYa3hwzJe3a55s+fodxGAt7RPCauOAq9zH3uFH4IfTBsmzUPcfZjkejUsEm0yuZ\n\tqEFg==" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"iCtnyEPI\"; dkim-atps=neutral", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1696598419; x=1697203219;\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\t:subject:date:message-id:reply-to;\n\tbh=ZNgXgb+Cnl0XP4aIcikz0avyv8rl0oeOdAohyVFJnWw=;\n\tb=kOQjQHzqs34yP+CWlTb1AAnZPBXZpOLR2OyM9qtYcmNvylSr94mTI6wJLebJAq1QSM\n\tDAikd7aVgyj9ae+xy0+mSrD1M8vf5q+s0fIWnvn3svu5av8Lom8FsflYefLaqF+7GQIt\n\tKzSdQQ0dcd95DoXgCjhsiU8yHYFObgdqPYPO1IaxJxLXLolsHREkqCBi74DlS00ouM3H\n\t/JtesU71FbMQHco3KeopJp/SSsSzNHBObw/bsVQPhfoY/g2I3sZuJuFIRNWW2nA5n/Cm\n\tgiHR8cEB2MkFx3qn+8R49hS5Uos3XWN9qLqwg3WgLWdvSlJ7YWuH8BcagUxm+sAwQHKd\n\t+TXQ==", "X-Gm-Message-State": "AOJu0YyW8yGweS31Ib6/Q1IlpCYnI0bfa0gqoBNnldYetvOH4eRxXeji\n\tFxu4diuDxgZdSGLFxX0dDxjTDPMmk5G7CoAzitwitQ==", "X-Google-Smtp-Source": "AGHT+IEm07U4M6JT1Lv5TjDlWESahv+CwGDiy8JItGud+sA1r9f4Uu904VCmA8xoJRA133r35fCEQA==", "X-Received": "by 2002:a5d:4a0b:0:b0:31a:b3aa:d19b with SMTP id\n\tm11-20020a5d4a0b000000b0031ab3aad19bmr7065204wrq.23.1696598417872; \n\tFri, 06 Oct 2023 06:20:17 -0700 (PDT)", "To": "libcamera-devel@lists.libcamera.org", "Date": "Fri, 6 Oct 2023 14:19:58 +0100", "Message-Id": "<20231006132000.23504-19-naush@raspberrypi.com>", "X-Mailer": "git-send-email 2.34.1", "In-Reply-To": "<20231006132000.23504-1-naush@raspberrypi.com>", "References": "<20231006132000.23504-1-naush@raspberrypi.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 18/20] ipa: rpi: denoise: Support\n\tdifferent denoise configurations", "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": "Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>", "Reply-To": "Naushir Patuck <naush@raspberrypi.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "From: David Plowman <david.plowman@raspberrypi.com>\n\nSome use cases may require stronger, or different, denosie settings to\nothers. For example, the way frames are accumulated during single\nexposure HDR means that we may want stronger denoise.\n\nThis commit adds such support for different configurations that can be\ndefined in the tuning file.\n\nOlder tuning files, or files where there is only a single\nconfiguration, load only the \"normal\" denoise configuration.\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/ipa/rpi/controller/denoise_algorithm.h | 4 +\n src/ipa/rpi/controller/rpi/denoise.cpp | 130 ++++++++++++++-------\n src/ipa/rpi/controller/rpi/denoise.h | 36 +++---\n 3 files changed, 113 insertions(+), 57 deletions(-)", "diff": "diff --git a/src/ipa/rpi/controller/denoise_algorithm.h b/src/ipa/rpi/controller/denoise_algorithm.h\nindex 52009ba95661..444cbc259889 100644\n--- a/src/ipa/rpi/controller/denoise_algorithm.h\n+++ b/src/ipa/rpi/controller/denoise_algorithm.h\n@@ -6,6 +6,8 @@\n */\n #pragma once\n \n+#include <string>\n+\n #include \"algorithm.h\"\n \n namespace RPiController {\n@@ -18,6 +20,8 @@ public:\n \tDenoiseAlgorithm(Controller *controller) : Algorithm(controller) {}\n \t/* A Denoise algorithm must provide the following: */\n \tvirtual void setMode(DenoiseMode mode) = 0;\n+\t/* Some platforms may not be able to define this, so supply a default. */\n+\tvirtual void setConfig([[maybe_unused]] std::string const &name) {}\n };\n \n } /* namespace RPiController */\ndiff --git a/src/ipa/rpi/controller/rpi/denoise.cpp b/src/ipa/rpi/controller/rpi/denoise.cpp\nindex 440ee4425534..154ee604ddd0 100644\n--- a/src/ipa/rpi/controller/rpi/denoise.cpp\n+++ b/src/ipa/rpi/controller/rpi/denoise.cpp\n@@ -21,6 +21,45 @@ LOG_DEFINE_CATEGORY(RPiDenoise)\n \n #define NAME \"rpi.denoise\"\n \n+int DenoiseConfig::read(const libcamera::YamlObject ¶ms)\n+{\n+\tsdnEnable = params.contains(\"sdn\");\n+\tif (sdnEnable) {\n+\t\tauto &sdnParams = params[\"sdn\"];\n+\t\tsdnDeviation = sdnParams[\"deviation\"].get<double>(3.2);\n+\t\tsdnStrength = sdnParams[\"strength\"].get<double>(0.25);\n+\t\tsdnDeviation2 = sdnParams[\"deviation2\"].get<double>(sdnDeviation);\n+\t\tsdnDeviationNoTdn = sdnParams[\"deviation_no_tdn\"].get<double>(sdnDeviation);\n+\t\tsdnStrengthNoTdn = sdnParams[\"strength_no_tdn\"].get<double>(sdnStrength);\n+\t\tsdnTdnBackoff = sdnParams[\"backoff\"].get<double>(0.75);\n+\t}\n+\n+\tcdnEnable = params.contains(\"cdn\");\n+\tif (cdnEnable) {\n+\t\tauto &cdnParams = params[\"cdn\"];\n+\t\tcdnDeviation = cdnParams[\"deviation\"].get<double>(120);\n+\t\tcdnStrength = cdnParams[\"strength\"].get<double>(0.2);\n+\t}\n+\n+\ttdnEnable = params.contains(\"tdn\");\n+\tif (tdnEnable) {\n+\t\tauto &tdnParams = params[\"tdn\"];\n+\t\ttdnDeviation = tdnParams[\"deviation\"].get<double>(0.5);\n+\t\ttdnThreshold = tdnParams[\"threshold\"].get<double>(0.75);\n+\t} else if (sdnEnable) {\n+\t\t/*\n+\t\t * If SDN is enabled but TDN isn't, overwrite all the SDN settings\n+\t\t * with the \"no TDN\" versions. This makes it easier to enable or\n+\t\t * disable TDN in the tuning file without editing all the other\n+\t\t * parameters.\n+\t\t */\n+\t\tsdnDeviation = sdnDeviation2 = sdnDeviationNoTdn;\n+\t\tsdnStrength = sdnStrengthNoTdn;\n+\t}\n+\n+\treturn 0;\n+}\n+\n Denoise::Denoise(Controller *controller)\n \t: DenoiseAlgorithm(controller), mode_(DenoiseMode::ColourHighQuality)\n {\n@@ -33,39 +72,26 @@ char const *Denoise::name() const\n \n int Denoise::read(const libcamera::YamlObject ¶ms)\n {\n-\tsdnEnable_ = params.contains(\"sdn\");\n-\tif (sdnEnable_) {\n-\t\tauto &sdnParams = params[\"sdn\"];\n-\t\tsdnDeviation_ = sdnParams[\"deviation\"].get<double>(3.2);\n-\t\tsdnStrength_ = sdnParams[\"strength\"].get<double>(0.25);\n-\t\tsdnDeviation2_ = sdnParams[\"deviation2\"].get<double>(sdnDeviation_);\n-\t\tsdnDeviationNoTdn_ = sdnParams[\"deviation_no_tdn\"].get<double>(sdnDeviation_);\n-\t\tsdnStrengthNoTdn_ = sdnParams[\"strength_no_tdn\"].get<double>(sdnStrength_);\n-\t\tsdnTdnBackoff_ = sdnParams[\"backoff\"].get<double>(0.75);\n+\tif (!params.contains(\"normal\")) {\n+\t\tconfigs_[\"normal\"].read(params);\n+\t\tcurrentConfig_ = &configs_[\"normal\"];\n+\n+\t\treturn 0;\n \t}\n \n-\tcdnEnable_ = params.contains(\"cdn\");\n-\tif (cdnEnable_) {\n-\t\tauto &cdnParams = params[\"cdn\"];\n-\t\tcdnDeviation_ = cdnParams[\"deviation\"].get<double>(120);\n-\t\tcdnStrength_ = cdnParams[\"strength\"].get<double>(0.2);\n+\tfor (const auto &[key, value] : params.asDict()) {\n+\t\tif (configs_[key].read(value)) {\n+\t\t\tLOG(RPiDenoise, Error) << \"Failed to read denoise config \" << key;\n+\t\t\treturn -EINVAL;\n+\t\t}\n \t}\n \n-\ttdnEnable_ = params.contains(\"tdn\");\n-\tif (tdnEnable_) {\n-\t\tauto &tdnParams = params[\"tdn\"];\n-\t\ttdnDeviation_ = tdnParams[\"deviation\"].get<double>(0.5);\n-\t\ttdnThreshold_ = tdnParams[\"threshold\"].get<double>(0.75);\n-\t} else if (sdnEnable_) {\n-\t\t/*\n-\t\t * If SDN is enabled but TDN isn't, overwrite all the SDN settings\n-\t\t * with the \"no TDN\" versions. This makes it easier to enable or\n-\t\t * disable TDN in the tuning file without editing all the other\n-\t\t * parameters.\n-\t\t */\n-\t\tsdnDeviation_ = sdnDeviation2_ = sdnDeviationNoTdn_;\n-\t\tsdnStrength_ = sdnStrengthNoTdn_;\n+\tauto it = configs_.find(\"normal\");\n+\tif (it == configs_.end()) {\n+\t\tLOG(RPiDenoise, Error) << \"No normal denoise settings found\";\n+\t\treturn -EINVAL;\n \t}\n+\tcurrentConfig_ = &it->second;\n \n \treturn 0;\n }\n@@ -78,9 +104,9 @@ void Denoise::switchMode([[maybe_unused]] CameraMode const &cameraMode,\n \t\t\t [[maybe_unused]] Metadata *metadata)\n {\n \t/* A mode switch effectively resets temporal denoise and it has to start over. */\n-\tcurrentSdnDeviation_ = sdnDeviationNoTdn_;\n-\tcurrentSdnStrength_ = sdnStrengthNoTdn_;\n-\tcurrentSdnDeviation2_ = sdnDeviationNoTdn_;\n+\tcurrentSdnDeviation_ = currentConfig_->sdnDeviationNoTdn;\n+\tcurrentSdnStrength_ = currentConfig_->sdnStrengthNoTdn;\n+\tcurrentSdnDeviation2_ = currentConfig_->sdnDeviationNoTdn;\n }\n \n void Denoise::prepare(Metadata *imageMetadata)\n@@ -97,11 +123,11 @@ void Denoise::prepare(Metadata *imageMetadata)\n \tif (mode_ == DenoiseMode::Off)\n \t\treturn;\n \n-\tif (sdnEnable_) {\n+\tif (currentConfig_->sdnEnable) {\n \t\tstruct SdnStatus sdn;\n \t\tsdn.noiseConstant = noiseStatus.noiseConstant * currentSdnDeviation_;\n \t\tsdn.noiseSlope = noiseStatus.noiseSlope * currentSdnDeviation_;\n-\t\tsdn.noiseConstant2 = noiseStatus.noiseConstant * sdnDeviation2_;\n+\t\tsdn.noiseConstant2 = noiseStatus.noiseConstant * currentConfig_->sdnDeviation2;\n \t\tsdn.noiseSlope2 = noiseStatus.noiseSlope * currentSdnDeviation2_;\n \t\tsdn.strength = currentSdnStrength_;\n \t\timageMetadata->set(\"sdn.status\", sdn);\n@@ -113,17 +139,17 @@ void Denoise::prepare(Metadata *imageMetadata)\n \t\t\t<< \" slope2 \" << sdn.noiseSlope2;\n \n \t\t/* For the next frame, we back off the SDN parameters as TDN ramps up. */\n-\t\tdouble f = sdnTdnBackoff_;\n-\t\tcurrentSdnDeviation_ = f * currentSdnDeviation_ + (1 - f) * sdnDeviation_;\n-\t\tcurrentSdnStrength_ = f * currentSdnStrength_ + (1 - f) * sdnStrength_;\n-\t\tcurrentSdnDeviation2_ = f * currentSdnDeviation2_ + (1 - f) * sdnDeviation2_;\n+\t\tdouble f = currentConfig_->sdnTdnBackoff;\n+\t\tcurrentSdnDeviation_ = f * currentSdnDeviation_ + (1 - f) * currentConfig_->sdnDeviation;\n+\t\tcurrentSdnStrength_ = f * currentSdnStrength_ + (1 - f) * currentConfig_->sdnStrength;\n+\t\tcurrentSdnDeviation2_ = f * currentSdnDeviation2_ + (1 - f) * currentConfig_->sdnDeviation2;\n \t}\n \n-\tif (tdnEnable_) {\n+\tif (currentConfig_->tdnEnable) {\n \t\tstruct TdnStatus tdn;\n-\t\ttdn.noiseConstant = noiseStatus.noiseConstant * tdnDeviation_;\n-\t\ttdn.noiseSlope = noiseStatus.noiseSlope * tdnDeviation_;\n-\t\ttdn.threshold = tdnThreshold_;\n+\t\ttdn.noiseConstant = noiseStatus.noiseConstant * currentConfig_->tdnDeviation;\n+\t\ttdn.noiseSlope = noiseStatus.noiseSlope * currentConfig_->tdnDeviation;\n+\t\ttdn.threshold = currentConfig_->tdnThreshold;\n \t\timageMetadata->set(\"tdn.status\", tdn);\n \t\tLOG(RPiDenoise, Debug)\n \t\t\t<< \"programmed tdn threshold \" << tdn.threshold\n@@ -131,10 +157,10 @@ void Denoise::prepare(Metadata *imageMetadata)\n \t\t\t<< \" slope \" << tdn.noiseSlope;\n \t}\n \n-\tif (cdnEnable_ && mode_ != DenoiseMode::ColourOff) {\n+\tif (currentConfig_->cdnEnable && mode_ != DenoiseMode::ColourOff) {\n \t\tstruct CdnStatus cdn;\n-\t\tcdn.threshold = cdnDeviation_ * noiseStatus.noiseSlope + noiseStatus.noiseConstant;\n-\t\tcdn.strength = cdnStrength_;\n+\t\tcdn.threshold = currentConfig_->cdnDeviation * noiseStatus.noiseSlope + noiseStatus.noiseConstant;\n+\t\tcdn.strength = currentConfig_->cdnStrength;\n \t\timageMetadata->set(\"cdn.status\", cdn);\n \t\tLOG(RPiDenoise, Debug)\n \t\t\t<< \"programmed cdn threshold \" << cdn.threshold\n@@ -148,6 +174,22 @@ void Denoise::setMode(DenoiseMode mode)\n \tmode_ = mode;\n }\n \n+void Denoise::setConfig(std::string const &name)\n+{\n+\tauto it = configs_.find(name);\n+\tif (it == configs_.end()) {\n+\t\t/*\n+\t\t * Some platforms may have no need for different denoise settings, so we only issue\n+\t\t * a warning if there clearly are several configurations.\n+\t\t */\n+\t\tif (configs_.size() > 1)\n+\t\t\tLOG(RPiDenoise, Warning) << \"No denoise config found for \" << name;\n+\t\telse\n+\t\t\tLOG(RPiDenoise, Debug) << \"No denoise config found for \" << name;\n+\t} else\n+\t\tcurrentConfig_ = &it->second;\n+}\n+\n // Register algorithm with the system.\n static Algorithm *Create(Controller *controller)\n {\ndiff --git a/src/ipa/rpi/controller/rpi/denoise.h b/src/ipa/rpi/controller/rpi/denoise.h\nindex 88b37663e569..92ff4f93edf2 100644\n--- a/src/ipa/rpi/controller/rpi/denoise.h\n+++ b/src/ipa/rpi/controller/rpi/denoise.h\n@@ -6,6 +6,9 @@\n */\n #pragma once\n \n+#include <map>\n+#include <string>\n+\n #include \"algorithm.h\"\n #include \"denoise_algorithm.h\"\n \n@@ -13,6 +16,23 @@ namespace RPiController {\n \n // Algorithm to calculate correct denoise settings.\n \n+struct DenoiseConfig {\n+\tdouble sdnDeviation;\n+\tdouble sdnStrength;\n+\tdouble sdnDeviation2;\n+\tdouble sdnDeviationNoTdn;\n+\tdouble sdnStrengthNoTdn;\n+\tdouble sdnTdnBackoff;\n+\tdouble cdnDeviation;\n+\tdouble cdnStrength;\n+\tdouble tdnDeviation;\n+\tdouble tdnThreshold;\n+\tbool tdnEnable;\n+\tbool sdnEnable;\n+\tbool cdnEnable;\n+\tint read(const libcamera::YamlObject ¶ms);\n+};\n+\n class Denoise : public DenoiseAlgorithm\n {\n public:\n@@ -23,22 +43,12 @@ public:\n \tvoid switchMode(CameraMode const &cameraMode, Metadata *metadata) override;\n \tvoid prepare(Metadata *imageMetadata) override;\n \tvoid setMode(DenoiseMode mode) override;\n+\tvoid setConfig(std::string const &name) override;\n \n private:\n-\tdouble sdnDeviation_;\n-\tdouble sdnStrength_;\n-\tdouble sdnDeviation2_;\n-\tdouble sdnDeviationNoTdn_;\n-\tdouble sdnStrengthNoTdn_;\n-\tdouble sdnTdnBackoff_;\n-\tdouble cdnDeviation_;\n-\tdouble cdnStrength_;\n-\tdouble tdnDeviation_;\n-\tdouble tdnThreshold_;\n+\tstd::map<std::string, DenoiseConfig> configs_;\n+\tDenoiseConfig *currentConfig_;\n \tDenoiseMode mode_;\n-\tbool tdnEnable_;\n-\tbool sdnEnable_;\n-\tbool cdnEnable_;\n \n \t/* SDN parameters attenuate over time if TDN is running. */\n \tdouble currentSdnDeviation_;\n", "prefixes": [ "libcamera-devel", "18/20" ] }