Skip to content

Commit

Permalink
ipa: rkisp1: Drop use of utils::defopt
Browse files Browse the repository at this point in the history
utils::defopt causes compilation issues on gcc 8.0.0 to gcc 8.3.0,
likely due to bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86521
that was fixed in gcc 8.4.0. gcc 8.3.0 may be considered old (libcamera
requires gcc-8 or newer), but it is shipped by Debian 10 that has LTS
support until mid-2024.

As no workaround has been found to fix compilation on gcc 8.3.0 while
still retaining the functionality of utils::defopt, stop using it in the
RkISP1 IPA module.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
  • Loading branch information
pinchartl committed Oct 10, 2022
1 parent 4bf68fd commit 603a4d6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/ipa/rkisp1/algorithms/dpf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ int Dpf::init([[maybe_unused]] IPAContext &context,
* +---------|--------> X
* -4....-1 0 1 2 3 4
*/
values = dFObject["g"].getList<uint8_t>().value_or(utils::defopt);
values = dFObject["g"].getList<uint8_t>().value_or(std::vector<uint8_t>{});
if (values.size() != RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS) {
LOG(RkISP1Dpf, Error)
<< "Invalid 'DomainFilter:g': expected "
Expand Down Expand Up @@ -106,7 +106,7 @@ int Dpf::init([[maybe_unused]] IPAContext &context,
* For a 9x9 kernel, columns -6 and 6 are dropped, so coefficient
* number 6 is not used.
*/
values = dFObject["rb"].getList<uint8_t>().value_or(utils::defopt);
values = dFObject["rb"].getList<uint8_t>().value_or(std::vector<uint8_t>{});
if (values.size() != RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS &&
values.size() != RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS - 1) {
LOG(RkISP1Dpf, Error)
Expand Down Expand Up @@ -135,7 +135,7 @@ int Dpf::init([[maybe_unused]] IPAContext &context,
const YamlObject &rFObject = tuningData["NoiseLevelFunction"];

std::vector<uint16_t> nllValues;
nllValues = rFObject["coeff"].getList<uint16_t>().value_or(utils::defopt);
nllValues = rFObject["coeff"].getList<uint16_t>().value_or(std::vector<uint16_t>{});
if (nllValues.size() != RKISP1_CIF_ISP_DPF_MAX_NLF_COEFFS) {
LOG(RkISP1Dpf, Error)
<< "Invalid 'RangeFilter:coeff': expected "
Expand Down
8 changes: 4 additions & 4 deletions src/ipa/rkisp1/algorithms/gsl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ int GammaSensorLinearization::init([[maybe_unused]] IPAContext &context,
const YamlObject &tuningData)
{
std::vector<uint16_t> xIntervals =
tuningData["x-intervals"].getList<uint16_t>().value_or(utils::defopt);
tuningData["x-intervals"].getList<uint16_t>().value_or(std::vector<uint16_t>{});
if (xIntervals.size() != kDegammaXIntervals) {
LOG(RkISP1Gsl, Error)
<< "Invalid 'x' coordinates: expected "
Expand All @@ -83,7 +83,7 @@ int GammaSensorLinearization::init([[maybe_unused]] IPAContext &context,
return -EINVAL;
}

curveYr_ = yObject["red"].getList<uint16_t>().value_or(utils::defopt);
curveYr_ = yObject["red"].getList<uint16_t>().value_or(std::vector<uint16_t>{});
if (curveYr_.size() != RKISP1_CIF_ISP_DEGAMMA_CURVE_SIZE) {
LOG(RkISP1Gsl, Error)
<< "Invalid 'y:red' coordinates: expected "
Expand All @@ -92,7 +92,7 @@ int GammaSensorLinearization::init([[maybe_unused]] IPAContext &context,
return -EINVAL;
}

curveYg_ = yObject["green"].getList<uint16_t>().value_or(utils::defopt);
curveYg_ = yObject["green"].getList<uint16_t>().value_or(std::vector<uint16_t>{});
if (curveYg_.size() != RKISP1_CIF_ISP_DEGAMMA_CURVE_SIZE) {
LOG(RkISP1Gsl, Error)
<< "Invalid 'y:green' coordinates: expected "
Expand All @@ -101,7 +101,7 @@ int GammaSensorLinearization::init([[maybe_unused]] IPAContext &context,
return -EINVAL;
}

curveYb_ = yObject["blue"].getList<uint16_t>().value_or(utils::defopt);
curveYb_ = yObject["blue"].getList<uint16_t>().value_or(std::vector<uint16_t>{});
if (curveYb_.size() != RKISP1_CIF_ISP_DEGAMMA_CURVE_SIZE) {
LOG(RkISP1Gsl, Error)
<< "Invalid 'y:blue' coordinates: expected "
Expand Down
4 changes: 2 additions & 2 deletions src/ipa/rkisp1/algorithms/lsc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static std::vector<double> parseSizes(const YamlObject &tuningData,
const char *prop)
{
std::vector<double> sizes =
tuningData[prop].getList<double>().value_or(utils::defopt);
tuningData[prop].getList<double>().value_or(std::vector<double>{});
if (sizes.size() != RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE) {
LOG(RkISP1Lsc, Error)
<< "Invalid '" << prop << "' values: expected "
Expand Down Expand Up @@ -76,7 +76,7 @@ static std::vector<uint16_t> parseTable(const YamlObject &tuningData,
RKISP1_CIF_ISP_LSC_SAMPLES_MAX * RKISP1_CIF_ISP_LSC_SAMPLES_MAX;

std::vector<uint16_t> table =
tuningData[prop].getList<uint16_t>().value_or(utils::defopt);
tuningData[prop].getList<uint16_t>().value_or(std::vector<uint16_t>{});
if (table.size() != kLscNumSamples) {
LOG(RkISP1Lsc, Error)
<< "Invalid '" << prop << "' values: expected "
Expand Down

0 comments on commit 603a4d6

Please sign in to comment.