From b3724d3766ee1fefda4860334fe769334df1c869 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Thu, 8 Sep 2022 00:31:23 +0300 Subject: ipa: rkisp1: Use frame number passed to Algorithm::prepare() Now that the Algorithm::prepare() function takes a frame number, we can use it to replace the IPAActiveState::frameCount member. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Jacopo Mondi --- src/ipa/rkisp1/algorithms/agc.cpp | 5 ++--- src/ipa/rkisp1/algorithms/awb.cpp | 5 ++--- src/ipa/rkisp1/algorithms/blc.cpp | 6 +++--- src/ipa/rkisp1/algorithms/dpcc.cpp | 6 +++--- src/ipa/rkisp1/algorithms/dpf.cpp | 4 ++-- src/ipa/rkisp1/algorithms/gsl.cpp | 6 +++--- src/ipa/rkisp1/algorithms/lsc.cpp | 5 ++--- 7 files changed, 17 insertions(+), 20 deletions(-) (limited to 'src/ipa/rkisp1/algorithms') diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp index d50ce495..10958a7e 100644 --- a/src/ipa/rkisp1/algorithms/agc.cpp +++ b/src/ipa/rkisp1/algorithms/agc.cpp @@ -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. */ diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp index 2bd9ef77..78398927 100644 --- a/src/ipa/rkisp1/algorithms/awb.cpp +++ b/src/ipa/rkisp1/algorithms/awb.cpp @@ -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. */ diff --git a/src/ipa/rkisp1/algorithms/blc.cpp b/src/ipa/rkisp1/algorithms/blc.cpp index 0f7226cf..15324fb1 100644 --- a/src/ipa/rkisp1/algorithms/blc.cpp +++ b/src/ipa/rkisp1/algorithms/blc.cpp @@ -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_) diff --git a/src/ipa/rkisp1/algorithms/dpcc.cpp b/src/ipa/rkisp1/algorithms/dpcc.cpp index cf7de663..d2a015d0 100644 --- a/src/ipa/rkisp1/algorithms/dpcc.cpp +++ b/src/ipa/rkisp1/algorithms/dpcc.cpp @@ -231,12 +231,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_) diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp index b8c837c2..b8d0c7b8 100644 --- a/src/ipa/rkisp1/algorithms/dpf.cpp +++ b/src/ipa/rkisp1/algorithms/dpf.cpp @@ -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_; diff --git a/src/ipa/rkisp1/algorithms/gsl.cpp b/src/ipa/rkisp1/algorithms/gsl.cpp index 879ca297..9cbad020 100644 --- a/src/ipa/rkisp1/algorithms/gsl.cpp +++ b/src/ipa/rkisp1/algorithms/gsl.cpp @@ -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_) diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp index 9c717bc5..44245caa 100644 --- a/src/ipa/rkisp1/algorithms/lsc.cpp +++ b/src/ipa/rkisp1/algorithms/lsc.cpp @@ -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_) -- cgit v1.2.1