@@ -60,6 +60,8 @@ protected:
virtual void prepareManualMode(IPAContext &context, const uint32_t frame,
IPAFrameContext &frameContext, RkISP1Params *params) = 0;
+ virtual ControlInfoMap::Map getControlMap() const = 0;
+
private:
bool manualMode_ = false; /**< Current manual/auto mode state */
bool devMode_ = false; /**< Developer mode state for advanced controls */
@@ -507,6 +507,35 @@ void Dpf::logConfigIfChanged(unsigned iso, int isoIndex, bool anyOverride, const
haveLast = true;
}
+ControlInfoMap::Map Dpf::getControlMap() const
+{
+ ControlInfoMap::Map map;
+ map[&controls::rkisp1::DpfEnable] = ControlInfo(false, true, enableDpf_);
+ map[&controls::rkisp1::DpfMode] = ControlInfo(controls::rkisp1::DpfModeValues, ControlValue(controls::rkisp1::DpfModeAuto));
+ std::array<int32_t, 3> strengthDefault = { static_cast<int32_t>(baseStrengthConfig_.r), static_cast<int32_t>(baseStrengthConfig_.g), static_cast<int32_t>(baseStrengthConfig_.b) };
+ map[&controls::rkisp1::DpfChannelStrengths] = ControlInfo(0, 255, Span<const int32_t, 3>(strengthDefault));
+ if (isDevMode()) {
+ std::array<int32_t, RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS> greenCoeffs;
+ for (unsigned i = 0; i < RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS; ++i)
+ greenCoeffs[i] = baseConfig_.g_flt.spatial_coeff[i];
+ map[&controls::rkisp1::DpfGreenSpatialCoefficients] = ControlInfo(0, 63, Span<const int32_t, RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS>(greenCoeffs));
+ std::array<int32_t, RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS> rbCoeffs;
+ for (unsigned i = 0; i < RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS; ++i)
+ rbCoeffs[i] = baseConfig_.rb_flt.spatial_coeff[i];
+ map[&controls::rkisp1::DpfRedBlueSpatialCoefficients] = ControlInfo(0, 63, Span<const int32_t, RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS>(rbCoeffs));
+ int32_t rbSizeDefault = (baseConfig_.rb_flt.fltsize == RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_13x9) ? 1 : 0;
+ map[&controls::rkisp1::DpfRbFilterSize] = ControlInfo(controls::rkisp1::DpfRbFilterSizeValues, ControlValue(rbSizeDefault));
+ std::array<int32_t, RKISP1_CIF_ISP_DPF_MAX_NLF_COEFFS> nllCoeffs;
+ for (unsigned i = 0; i < RKISP1_CIF_ISP_DPF_MAX_NLF_COEFFS; ++i)
+ nllCoeffs[i] = baseConfig_.nll.coeff[i];
+ map[&controls::rkisp1::DpfNoiseLevelLookupCoefficients] = ControlInfo(0, 1023, Span<const int32_t, RKISP1_CIF_ISP_DPF_MAX_NLF_COEFFS>(nllCoeffs));
+ int32_t scaleModeDefault = (baseConfig_.nll.scale_mode == RKISP1_CIF_ISP_NLL_SCALE_LOGARITHMIC) ? 1 : 0;
+ map[&controls::rkisp1::DpfNoiseLevelLookupScaleMode] = ControlInfo(controls::rkisp1::DpfNoiseLevelLookupScaleModeValues, ControlValue(scaleModeDefault));
+ }
+ map[&controls::rkisp1::DpfIso] = ControlInfo(0, 3200, 0);
+ return map;
+}
+
/**
* \copydoc libcamera::ipa::Algorithm::queueRequest
*/
@@ -111,6 +111,8 @@ private:
void prepareManualMode(IPAContext &context, const uint32_t frame,
IPAFrameContext &frameContext, RkISP1Params *params) override;
+
+ ControlInfoMap::Map getControlMap() const override;
};
} /* namespace ipa::rkisp1::algorithms */
@@ -121,5 +121,13 @@ controls:
- name: DpfModeManual
value: 1
description: Manual mode - parameters are frozen and can be overridden.
+
+ - DpfIso:
+ type: int32_t
+ direction: out
+ description: |
+ Estimated scene ISO value used for DPF tuning selection. Derived
+ from analogue gain (approx ISO = gain * 100). Provided each frame
+ for client awareness and debugging. Range 0..409600.
...
Implement getControlMap() to provide the RkISP1 DPF controls with tuning- derived defaults. The map includes: - DpfEnable (master enable toggle) - DpfMode (auto/manual mode selection) - DpfChannelStrengths (R/G/B strength values) - Developer mode controls when enabled: - Spatial coefficients (green and RB) - RB filter size (9x9 or 13x9) - NLL coefficients and scale mode - DpfIso (read-only ISO indicator) This control map is registered during init() to expose DPF controls to applications. Signed-off-by: Rui Wang <rui.wang@ideasonboard.com> --- src/ipa/rkisp1/algorithms/denoise.h | 2 ++ src/ipa/rkisp1/algorithms/dpf.cpp | 29 +++++++++++++++++++++++++++ src/ipa/rkisp1/algorithms/dpf.h | 2 ++ src/libcamera/control_ids_rkisp1.yaml | 8 ++++++++ 4 files changed, 41 insertions(+)