@@ -64,17 +64,23 @@ int BlackLevelCorrection::init([[maybe_unused]] IPAContext &context,
int BlackLevelCorrection::configure(IPAContext &context,
[[maybe_unused]] const IPACameraSensorInfo &configInfo)
{
+ if (!context.camHelper->blackLevel().has_value())
+ return 0;
+
+ /*
+ * The black level from CameraSensorHelper is a 16-bit value.
+ * The Mali-C55 ISP expects 20-bit settings, so we shift it to
+ * the appropriate width
+ */
+ uint32_t blackLevel = context.camHelper->blackLevel().value() << 4;
+
/*
* If no Black Levels were passed in through tuning data then we could
* use the value from the CameraSensorHelper if one is available.
*/
- if (context.configuration.sensor.blackLevel &&
- !(offset00_ + offset01_ + offset10_ + offset11_)) {
- offset00_ = context.configuration.sensor.blackLevel;
- offset01_ = context.configuration.sensor.blackLevel;
- offset10_ = context.configuration.sensor.blackLevel;
- offset11_ = context.configuration.sensor.blackLevel;
- }
+ if (blackLevel &&
+ !(offset00_ + offset01_ + offset10_ + offset11_))
+ offset00_ = offset01_ = offset10_ = offset11_ = blackLevel;
return 0;
}
@@ -31,7 +31,6 @@ struct IPASessionConfiguration {
struct {
BayerFormat::Order bayerOrder;
utils::Duration lineDuration;
- uint32_t blackLevel;
} sensor;
};
@@ -190,16 +190,6 @@ void IPAMaliC55::updateSessionConfiguration(const IPACameraSensorInfo &info,
context_.configuration.agc.defaultExposure = defExposure;
context_.configuration.agc.minAnalogueGain = context_.camHelper->gain(minGain);
context_.configuration.agc.maxAnalogueGain = context_.camHelper->gain(maxGain);
-
- if (context_.camHelper->blackLevel().has_value()) {
- /*
- * The black level from CameraSensorHelper is a 16-bit value.
- * The Mali-C55 ISP expects 20-bit settings, so we shift it to
- * the appropriate width
- */
- context_.configuration.sensor.blackLevel =
- context_.camHelper->blackLevel().value() << 4;
- }
}
void IPAMaliC55::updateControls(const IPACameraSensorInfo &sensorInfo,
Move the black level handling into the blc module. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> --- src/ipa/mali-c55/algorithms/blc.cpp | 20 +++++++++++++------- src/ipa/mali-c55/ipa_context.h | 1 - src/ipa/mali-c55/mali-c55.cpp | 10 ---------- 3 files changed, 13 insertions(+), 18 deletions(-)