@@ -37,6 +37,7 @@ protected:
template<typename LevelContainer>
int selectIsoBand(unsigned iso, const LevelContainer &levels) const;
virtual bool parseConfig(const YamlObject &tuningData) = 0;
+ virtual void handleEnableControl(const ControlList &controls, IPAFrameContext &frameContext, IPAContext &context) = 0;
private:
bool manualMode_ = false; /**< Current manual/auto mode state */
@@ -229,6 +229,20 @@ bool Dpf::parseSingleConfig(const YamlObject &config,
return true;
}
+void Dpf::handleEnableControl(const ControlList &controls, IPAFrameContext &frameContext, IPAContext &context)
+{
+ if (const auto &c = controls.get(controls::rkisp1::DpfEnable); c) {
+ bool requested = *c != 0;
+ if (requested != enableDpf_) {
+ enableDpf_ = requested;
+ frameContext.dpf.update = true;
+ LOG(RkISP1Dpf, Info) << "DPF global " << (enableDpf_ ? "enabled" : "disabled");
+ }
+ }
+ context.activeState.dpf.denoise = enableDpf_;
+ frameContext.dpf.denoise = enableDpf_;
+}
+
/**
* \copydoc libcamera::ipa::Algorithm::queueRequest
*/
@@ -237,38 +251,8 @@ void Dpf::queueRequest(IPAContext &context,
IPAFrameContext &frameContext,
const ControlList &controls)
{
- auto &dpf = context.activeState.dpf;
- bool update = false;
-
- 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) {
- dpf.denoise = false;
- update = true;
- }
- break;
- case controls::draft::NoiseReductionModeMinimal:
- case controls::draft::NoiseReductionModeHighQuality:
- case controls::draft::NoiseReductionModeFast:
- if (!dpf.denoise) {
- dpf.denoise = true;
- update = true;
- }
- break;
- default:
- LOG(RkISP1Dpf, Error)
- << "Unsupported denoise value "
- << *denoise;
- break;
- }
- }
-
- frameContext.dpf.denoise = dpf.denoise;
- frameContext.dpf.update = update;
+ frameContext.dpf.update = false;
+ handleEnableControl(controls, frameContext, context);
}
/**
@@ -50,6 +50,7 @@ private:
bool useIsoLevels_ = false;
bool enableDpf_ = true; /* YAML master enable */
+ void handleEnableControl(const ControlList &controls, IPAFrameContext &frameContext, IPAContext &context) override;
bool parseConfig(const YamlObject &tuningData) override;
bool parseSingleConfig(const YamlObject &config,
rkisp1_cif_isp_dpf_config &cfg,
Implement handleEnableControl() to process the DpfEnable control and synchronize the enable state across context and frame state. Update queueRequest() to call this handler, clearing the update flag first. The enable control allows applications to globally enable/disable DPF processing without changing other configuration. Changes are logged and trigger frame updates. This replaces the previous draft::NoiseReductionMode handling with the new RkISP1-specific DpfEnable control. Signed-off-by: Rui Wang <rui.wang@ideasonboard.com> --- src/ipa/rkisp1/algorithms/denoise.h | 1 + src/ipa/rkisp1/algorithms/dpf.cpp | 48 ++++++++++------------------- src/ipa/rkisp1/algorithms/dpf.h | 1 + 3 files changed, 18 insertions(+), 32 deletions(-)