summaryrefslogtreecommitdiff
path: root/src/ipa/rkisp1/algorithms/lsc.cpp
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo.mondi@ideasonboard.com>2023-03-08 17:07:34 +0100
committerJacopo Mondi <jacopo.mondi@ideasonboard.com>2023-03-08 17:32:01 +0100
commit97da589e657467f1d1e5d48b7fb838e1ad9e988d (patch)
tree351426eae31d15f67e642891fbffe987ba090f6b /src/ipa/rkisp1/algorithms/lsc.cpp
parentc0c5c2819a1141238f114d93c0ee1d1a7c8bc3c4 (diff)
ipa: rkisp1: lsc: Move 'enable' to activeState
Now that the LSC algorithm can be enabled and disabled at run-time, move the 'enabled' flag from the context's configuration to the algorithm's active state. This allows to populate the LensShadingEnable metadata in the process() function implementation. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Diffstat (limited to 'src/ipa/rkisp1/algorithms/lsc.cpp')
-rw-r--r--src/ipa/rkisp1/algorithms/lsc.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp
index 0c9f6cbd..8de49e42 100644
--- a/src/ipa/rkisp1/algorithms/lsc.cpp
+++ b/src/ipa/rkisp1/algorithms/lsc.cpp
@@ -149,8 +149,6 @@ int LensShadingCorrection::init([[maybe_unused]] IPAContext &context,
return -EINVAL;
}
- context.configuration.lsc.enabled = false;
-
return 0;
}
@@ -290,12 +288,10 @@ void LensShadingCorrection::prepare(IPAContext &context,
if (!lsc->enable) {
disableLSC(params);
lsc->active = false;
- context.configuration.lsc.enabled = false;
return;
}
lsc->active = true;
- context.configuration.lsc.enabled = true;
}
/* Nothing more to do here if LSC is not active. */
@@ -387,6 +383,15 @@ void LensShadingCorrection::prepare(IPAContext &context,
lastCt_ = { ct, ct };
}
+void LensShadingCorrection::process(IPAContext &context,
+ [[maybe_unused]] const uint32_t frame,
+ [[maybe_unused]] IPAFrameContext &frameContext,
+ [[maybe_unused]] const rkisp1_stat_buffer *stats,
+ ControlList &metadata)
+{
+ metadata.set(controls::LensShadingEnable, context.activeState.lsc.active);
+}
+
REGISTER_IPA_ALGORITHM(LensShadingCorrection, "LensShadingCorrection")
} /* namespace ipa::rkisp1::algorithms */