@@ -77,6 +77,9 @@ int Dpf::init([[maybe_unused]] IPAContext &context,
if (ret)
return ret;
+ /* Register available controls. */
+ registerControls(context);
+
return 0;
}
@@ -136,6 +139,24 @@ int Dpf::parseConfig(const YamlObject &tuningData)
return 0;
}
+void Dpf::registerControls(IPAContext &context)
+{
+ /*
+ * Populate the control map with the available noise reduction modes.
+ * This allows applications to query and select from the modes defined
+ * in the tuning data.
+ */
+ std::vector<ControlValue> 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)
@@ -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);
@@ -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 */
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 <rui.wang@ideasonboard.com> --- 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(-)