@@ -327,12 +327,11 @@ void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,
/**
* \copydoc libcamera::ipa::Algorithm::prepare
*/
-void Agc::prepare(IPAContext &context,
- [[maybe_unused]] const uint32_t frame,
+void Agc::prepare(IPAContext &context, const uint32_t frame,
[[maybe_unused]] IPAFrameContext &frameContext,
rkisp1_params_cfg *params)
{
- if (context.activeState.frameCount > 0)
+ if (frame > 0)
return;
/* Configure the measurement window. */
@@ -74,8 +74,7 @@ uint32_t Awb::estimateCCT(double red, double green, double blue)
/**
* \copydoc libcamera::ipa::Algorithm::prepare
*/
-void Awb::prepare(IPAContext &context,
- [[maybe_unused]] const uint32_t frame,
+void Awb::prepare(IPAContext &context, const uint32_t frame,
[[maybe_unused]] IPAFrameContext &frameContext,
rkisp1_params_cfg *params)
{
@@ -88,7 +87,7 @@ void Awb::prepare(IPAContext &context,
params->module_cfg_update |= RKISP1_CIF_ISP_MODULE_AWB_GAIN;
/* If we already have configured the gains and window, return. */
- if (context.activeState.frameCount > 0)
+ if (frame > 0)
return;
/* Configure the gains to apply. */
@@ -65,12 +65,12 @@ int BlackLevelCorrection::init([[maybe_unused]] IPAContext &context,
/**
* \copydoc libcamera::ipa::Algorithm::prepare
*/
-void BlackLevelCorrection::prepare(IPAContext &context,
- [[maybe_unused]] const uint32_t frame,
+void BlackLevelCorrection::prepare([[maybe_unused]] IPAContext &context,
+ const uint32_t frame,
[[maybe_unused]] IPAFrameContext &frameContext,
rkisp1_params_cfg *params)
{
- if (context.activeState.frameCount > 0)
+ if (frame > 0)
return;
if (!tuningParameters_)
@@ -258,12 +258,12 @@ int DefectPixelClusterCorrection::init([[maybe_unused]] IPAContext &context,
/**
* \copydoc libcamera::ipa::Algorithm::prepare
*/
-void DefectPixelClusterCorrection::prepare(IPAContext &context,
- [[maybe_unused]] const uint32_t frame,
+void DefectPixelClusterCorrection::prepare([[maybe_unused]] IPAContext &context,
+ const uint32_t frame,
[[maybe_unused]] IPAFrameContext &frameContext,
rkisp1_params_cfg *params)
{
- if (context.activeState.frameCount > 0)
+ if (frame > 0)
return;
if (!initialized_)
@@ -207,7 +207,7 @@ void Dpf::queueRequest(IPAContext &context,
/**
* \copydoc libcamera::ipa::Algorithm::prepare
*/
-void Dpf::prepare(IPAContext &context, [[maybe_unused]] const uint32_t frame,
+void Dpf::prepare(IPAContext &context, const uint32_t frame,
[[maybe_unused]] IPAFrameContext &frameContext,
rkisp1_params_cfg *params)
{
@@ -216,7 +216,7 @@ void Dpf::prepare(IPAContext &context, [[maybe_unused]] const uint32_t frame,
auto &dpf = context.activeState.dpf;
- if (context.activeState.frameCount == 0) {
+ if (frame == 0) {
params->others.dpf_config = config_;
params->others.dpf_strength_config = strengthConfig_;
@@ -118,12 +118,12 @@ int GammaSensorLinearization::init([[maybe_unused]] IPAContext &context,
/**
* \copydoc libcamera::ipa::Algorithm::prepare
*/
-void GammaSensorLinearization::prepare(IPAContext &context,
- [[maybe_unused]] const uint32_t frame,
+void GammaSensorLinearization::prepare([[maybe_unused]] IPAContext &context,
+ const uint32_t frame,
[[maybe_unused]] IPAFrameContext &frameContext,
rkisp1_params_cfg *params)
{
- if (context.activeState.frameCount > 0)
+ if (frame > 0)
return;
if (!initialized_)
@@ -132,12 +132,11 @@ int LensShadingCorrection::configure(IPAContext &context,
/**
* \copydoc libcamera::ipa::Algorithm::prepare
*/
-void LensShadingCorrection::prepare(IPAContext &context,
- [[maybe_unused]] const uint32_t frame,
+void LensShadingCorrection::prepare(IPAContext &context, const uint32_t frame,
[[maybe_unused]] IPAFrameContext &frameContext,
rkisp1_params_cfg *params)
{
- if (context.activeState.frameCount > 0)
+ if (frame > 0)
return;
if (!initialized_)
@@ -192,15 +192,6 @@ namespace libcamera::ipa::rkisp1 {
* \brief Analogue gain multiplier
*/
-/**
- * \var IPAActiveState::frameCount
- * \brief Counter of requests queued to the IPA module
- *
- * The counter is reset to 0 when the IPA module is configured, and is
- * incremented for each request being queued, after calling the
- * Algorithm::prepare() function of all algorithms.
- */
-
/**
* \struct IPAFrameContext
* \brief Per-frame context for algorithms
@@ -88,8 +88,6 @@ struct IPAActiveState {
uint32_t exposure;
double gain;
} sensor;
-
- unsigned int frameCount;
};
struct IPAFrameContext : public FrameContext {
@@ -259,8 +259,6 @@ int IPARkISP1::configure([[maybe_unused]] const IPACameraSensorInfo &info,
context_.configuration.agc.minAnalogueGain = camHelper_->gain(minGain);
context_.configuration.agc.maxAnalogueGain = camHelper_->gain(maxGain);
- context_.activeState.frameCount = 0;
-
for (auto const &algo : algorithms()) {
int ret = algo->configure(context_, info);
if (ret)
@@ -323,7 +321,6 @@ void IPARkISP1::fillParamsBuffer(const uint32_t frame, const uint32_t bufferId)
algo->prepare(context_, frame, frameContext, params);
paramsBufferReady.emit(frame);
- context_.activeState.frameCount++;
}
void IPARkISP1::processStatsBuffer(const uint32_t frame, const uint32_t bufferId,