summaryrefslogtreecommitdiff
path: root/src/ipa/rkisp1/algorithms/dpf.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-09-08 00:39:53 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-09-28 05:41:14 +0300
commit3c3e0aa12362a9652d93cc26d6b28a1572070159 (patch)
tree4dba8c07b7c9985ae59020692a2d4fe7758acc84 /src/ipa/rkisp1/algorithms/dpf.cpp
parentcb08adffe20631424f65a8c10340d4da464021e1 (diff)
ipa: rkisp1: dpf: Store per-frame information in frame context
Rework the algorithm's usage of the active state, to store the value of controls for the last queued request in the queueRequest() function, and store a copy of the values in the corresponding frame context. The latter is used in the prepare() function to populate the ISP parameters with values corresponding to the right frame. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/ipa/rkisp1/algorithms/dpf.cpp')
-rw-r--r--src/ipa/rkisp1/algorithms/dpf.cpp30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp
index b8d0c7b8..f7bc371d 100644
--- a/src/ipa/rkisp1/algorithms/dpf.cpp
+++ b/src/ipa/rkisp1/algorithms/dpf.cpp
@@ -176,10 +176,11 @@ int Dpf::init([[maybe_unused]] IPAContext &context,
*/
void Dpf::queueRequest(IPAContext &context,
[[maybe_unused]] const uint32_t frame,
- [[maybe_unused]] IPAFrameContext &frameContext,
+ IPAFrameContext &frameContext,
const ControlList &controls)
{
auto &dpf = context.activeState.dpf;
+ bool update = false;
const auto &denoise = controls.get(controls::draft::NoiseReductionMode);
if (denoise) {
@@ -187,35 +188,40 @@ void Dpf::queueRequest(IPAContext &context,
switch (*denoise) {
case controls::draft::NoiseReductionModeOff:
- dpf.denoise = false;
- dpf.updateParams = true;
+ if (dpf.denoise) {
+ dpf.denoise = false;
+ update = true;
+ }
break;
case controls::draft::NoiseReductionModeMinimal:
case controls::draft::NoiseReductionModeHighQuality:
case controls::draft::NoiseReductionModeFast:
- dpf.denoise = true;
- dpf.updateParams = true;
+ 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;
}
/**
* \copydoc libcamera::ipa::Algorithm::prepare
*/
void Dpf::prepare(IPAContext &context, const uint32_t frame,
- [[maybe_unused]] IPAFrameContext &frameContext,
- rkisp1_params_cfg *params)
+ IPAFrameContext &frameContext, rkisp1_params_cfg *params)
{
if (!initialized_)
return;
- auto &dpf = context.activeState.dpf;
-
if (frame == 0) {
params->others.dpf_config = config_;
params->others.dpf_strength_config = strengthConfig_;
@@ -245,12 +251,10 @@ void Dpf::prepare(IPAContext &context, const uint32_t frame,
RKISP1_CIF_ISP_MODULE_DPF_STRENGTH;
}
- if (dpf.updateParams) {
+ if (frameContext.dpf.update) {
params->module_en_update |= RKISP1_CIF_ISP_MODULE_DPF;
- if (dpf.denoise)
+ if (frameContext.dpf.denoise)
params->module_ens |= RKISP1_CIF_ISP_MODULE_DPF;
-
- dpf.updateParams = false;
}
}