summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-09-30 04:08:47 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-10-01 00:01:56 +0300
commit79f0fc937d95cbf1bd39f04dfd8b83206bda5098 (patch)
treed964865780525e85a6286504cb9bf2662fe93afa
parentc97cf467ea79ed886dc549bff6837900427ca11e (diff)
ipa: rkisp1: Remove initialized_ flags from algorithms
Multiple algorithms have an initialized_ flag that they set to true at the end of the init() function, and check at the beginning of prepare() to skip preparation. This serves no real purpose, as the flag can only be false if init() fails, in which case the IPA module initialization as a whole will fail. Drop the initialized_ flags. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rw-r--r--src/ipa/rkisp1/algorithms/dpcc.cpp7
-rw-r--r--src/ipa/rkisp1/algorithms/dpcc.h1
-rw-r--r--src/ipa/rkisp1/algorithms/dpf.cpp7
-rw-r--r--src/ipa/rkisp1/algorithms/dpf.h1
-rw-r--r--src/ipa/rkisp1/algorithms/gsl.cpp5
-rw-r--r--src/ipa/rkisp1/algorithms/gsl.h1
-rw-r--r--src/ipa/rkisp1/algorithms/lsc.cpp8
-rw-r--r--src/ipa/rkisp1/algorithms/lsc.h2
8 files changed, 3 insertions, 29 deletions
diff --git a/src/ipa/rkisp1/algorithms/dpcc.cpp b/src/ipa/rkisp1/algorithms/dpcc.cpp
index d2a015d0..80a1b734 100644
--- a/src/ipa/rkisp1/algorithms/dpcc.cpp
+++ b/src/ipa/rkisp1/algorithms/dpcc.cpp
@@ -37,7 +37,7 @@ namespace ipa::rkisp1::algorithms {
LOG_DEFINE_CATEGORY(RkISP1Dpcc)
DefectPixelClusterCorrection::DefectPixelClusterCorrection()
- : initialized_(false), config_({})
+ : config_({})
{
}
@@ -223,8 +223,6 @@ int DefectPixelClusterCorrection::init([[maybe_unused]] IPAContext &context,
}
}
- initialized_ = true;
-
return 0;
}
@@ -239,9 +237,6 @@ void DefectPixelClusterCorrection::prepare([[maybe_unused]] IPAContext &context,
if (frame > 0)
return;
- if (!initialized_)
- return;
-
params->others.dpcc_config = config_;
params->module_en_update |= RKISP1_CIF_ISP_MODULE_DPCC;
diff --git a/src/ipa/rkisp1/algorithms/dpcc.h b/src/ipa/rkisp1/algorithms/dpcc.h
index 894c0249..b1fac7d1 100644
--- a/src/ipa/rkisp1/algorithms/dpcc.h
+++ b/src/ipa/rkisp1/algorithms/dpcc.h
@@ -25,7 +25,6 @@ public:
rkisp1_params_cfg *params) override;
private:
- bool initialized_;
rkisp1_cif_isp_dpcc_config config_;
};
diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp
index f7bc371d..82d4f7fe 100644
--- a/src/ipa/rkisp1/algorithms/dpf.cpp
+++ b/src/ipa/rkisp1/algorithms/dpf.cpp
@@ -35,7 +35,7 @@ namespace ipa::rkisp1::algorithms {
LOG_DEFINE_CATEGORY(RkISP1Dpf)
Dpf::Dpf()
- : initialized_(false), config_({}), strengthConfig_({})
+ : config_({}), strengthConfig_({})
{
}
@@ -166,8 +166,6 @@ int Dpf::init([[maybe_unused]] IPAContext &context,
strengthConfig_.g = fSObject["g"].get<uint16_t>(64);
strengthConfig_.b = fSObject["b"].get<uint16_t>(64);
- initialized_ = true;
-
return 0;
}
@@ -219,9 +217,6 @@ void Dpf::queueRequest(IPAContext &context,
void Dpf::prepare(IPAContext &context, const uint32_t frame,
IPAFrameContext &frameContext, rkisp1_params_cfg *params)
{
- if (!initialized_)
- return;
-
if (frame == 0) {
params->others.dpf_config = config_;
params->others.dpf_strength_config = strengthConfig_;
diff --git a/src/ipa/rkisp1/algorithms/dpf.h b/src/ipa/rkisp1/algorithms/dpf.h
index e232cad4..58f29f74 100644
--- a/src/ipa/rkisp1/algorithms/dpf.h
+++ b/src/ipa/rkisp1/algorithms/dpf.h
@@ -30,7 +30,6 @@ public:
rkisp1_params_cfg *params) override;
private:
- bool initialized_;
struct rkisp1_cif_isp_dpf_config config_;
struct rkisp1_cif_isp_dpf_strength_config strengthConfig_;
};
diff --git a/src/ipa/rkisp1/algorithms/gsl.cpp b/src/ipa/rkisp1/algorithms/gsl.cpp
index 9cbad020..a80fed58 100644
--- a/src/ipa/rkisp1/algorithms/gsl.cpp
+++ b/src/ipa/rkisp1/algorithms/gsl.cpp
@@ -49,7 +49,6 @@ LOG_DEFINE_CATEGORY(RkISP1Gsl)
static constexpr unsigned int kDegammaXIntervals = 16;
GammaSensorLinearization::GammaSensorLinearization()
- : initialized_(false)
{
}
@@ -111,7 +110,6 @@ int GammaSensorLinearization::init([[maybe_unused]] IPAContext &context,
return -EINVAL;
}
- initialized_ = true;
return 0;
}
@@ -126,9 +124,6 @@ void GammaSensorLinearization::prepare([[maybe_unused]] IPAContext &context,
if (frame > 0)
return;
- if (!initialized_)
- return;
-
params->others.sdg_config.xa_pnts.gamma_dx0 = gammaDx_[0];
params->others.sdg_config.xa_pnts.gamma_dx1 = gammaDx_[1];
diff --git a/src/ipa/rkisp1/algorithms/gsl.h b/src/ipa/rkisp1/algorithms/gsl.h
index 5024b683..0f1116a7 100644
--- a/src/ipa/rkisp1/algorithms/gsl.h
+++ b/src/ipa/rkisp1/algorithms/gsl.h
@@ -25,7 +25,6 @@ public:
rkisp1_params_cfg *params) override;
private:
- bool initialized_;
uint32_t gammaDx_[2];
std::vector<uint16_t> curveYr_;
std::vector<uint16_t> curveYg_;
diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp
index 44245caa..102535bd 100644
--- a/src/ipa/rkisp1/algorithms/lsc.cpp
+++ b/src/ipa/rkisp1/algorithms/lsc.cpp
@@ -89,7 +89,6 @@ static std::vector<uint16_t> parseTable(const YamlObject &tuningData,
}
LensShadingCorrection::LensShadingCorrection()
- : initialized_(false)
{
}
@@ -114,8 +113,6 @@ int LensShadingCorrection::init([[maybe_unused]] IPAContext &context,
gbData_.empty() || bData_.empty())
return -EINVAL;
- initialized_ = true;
-
return 0;
}
@@ -125,7 +122,7 @@ int LensShadingCorrection::init([[maybe_unused]] IPAContext &context,
int LensShadingCorrection::configure(IPAContext &context,
[[maybe_unused]] const IPACameraSensorInfo &configInfo)
{
- context.configuration.lsc.enabled = initialized_;
+ context.configuration.lsc.enabled = true;
return 0;
}
@@ -139,9 +136,6 @@ void LensShadingCorrection::prepare(IPAContext &context, const uint32_t frame,
if (frame > 0)
return;
- if (!initialized_)
- return;
-
struct rkisp1_cif_isp_lsc_config &config = params->others.lsc_config;
const Size &size = context.configuration.sensor.size;
Size totalSize{};
diff --git a/src/ipa/rkisp1/algorithms/lsc.h b/src/ipa/rkisp1/algorithms/lsc.h
index da957d3e..6c052669 100644
--- a/src/ipa/rkisp1/algorithms/lsc.h
+++ b/src/ipa/rkisp1/algorithms/lsc.h
@@ -26,8 +26,6 @@ public:
rkisp1_params_cfg *params) override;
private:
- bool initialized_;
-
std::vector<uint16_t> rData_;
std::vector<uint16_t> grData_;
std::vector<uint16_t> gbData_;