diff options
-rw-r--r-- | src/ipa/simple/algorithms/blc.cpp | 13 | ||||
-rw-r--r-- | src/ipa/simple/algorithms/blc.h | 1 | ||||
-rw-r--r-- | src/ipa/simple/soft_simple.cpp | 3 |
3 files changed, 16 insertions, 1 deletions
diff --git a/src/ipa/simple/algorithms/blc.cpp b/src/ipa/simple/algorithms/blc.cpp index a7af2e12..b4e32fe1 100644 --- a/src/ipa/simple/algorithms/blc.cpp +++ b/src/ipa/simple/algorithms/blc.cpp @@ -21,6 +21,19 @@ BlackLevel::BlackLevel() { } +int BlackLevel::init(IPAContext &context, const YamlObject &tuningData) +{ + auto blackLevel = tuningData["blackLevel"].get<int16_t>(); + if (blackLevel.has_value()) { + /* + * Convert 16 bit values from the tuning file to 8 bit black + * level for the SoftISP. + */ + context.configuration.black.level = blackLevel.value() >> 8; + } + return 0; +} + int BlackLevel::configure(IPAContext &context, [[maybe_unused]] const IPAConfigInfo &configInfo) { diff --git a/src/ipa/simple/algorithms/blc.h b/src/ipa/simple/algorithms/blc.h index 828ad8b1..2cf2a877 100644 --- a/src/ipa/simple/algorithms/blc.h +++ b/src/ipa/simple/algorithms/blc.h @@ -19,6 +19,7 @@ public: BlackLevel(); ~BlackLevel() = default; + int init(IPAContext &context, const YamlObject &tuningData) override; int configure(IPAContext &context, const IPAConfigInfo &configInfo) override; void process(IPAContext &context, const uint32_t frame, IPAFrameContext &frameContext, diff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp index 825c0675..c8ad55a2 100644 --- a/src/ipa/simple/soft_simple.cpp +++ b/src/ipa/simple/soft_simple.cpp @@ -206,7 +206,8 @@ int IPASoftSimple::configure(const IPAConfigInfo &configInfo) (context_.configuration.agc.againMax - context_.configuration.agc.againMin) / 100.0; - if (camHelper_->blackLevel().has_value()) { + if (!context_.configuration.black.level.has_value() && + camHelper_->blackLevel().has_value()) { /* * The black level from camHelper_ is a 16 bit value, software ISP * works with 8 bit pixel values, both regardless of the actual |