summaryrefslogtreecommitdiff
path: root/src/ipa/simple/algorithms/blc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipa/simple/algorithms/blc.cpp')
-rw-r--r--src/ipa/simple/algorithms/blc.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ipa/simple/algorithms/blc.cpp b/src/ipa/simple/algorithms/blc.cpp
index 755108b0..b9f2aaa6 100644
--- a/src/ipa/simple/algorithms/blc.cpp
+++ b/src/ipa/simple/algorithms/blc.cpp
@@ -30,10 +30,15 @@ int BlackLevel::configure(IPAContext &context,
void BlackLevel::process(IPAContext &context,
[[maybe_unused]] const uint32_t frame,
- [[maybe_unused]] IPAFrameContext &frameContext,
+ IPAFrameContext &frameContext,
const SwIspStats *stats,
[[maybe_unused]] ControlList &metadata)
{
+ if (frameContext.sensor.exposure == exposure_ &&
+ frameContext.sensor.gain == gain_) {
+ return;
+ }
+
const SwIspStats::Histogram &histogram = stats->yHistogram;
/*
@@ -54,6 +59,8 @@ void BlackLevel::process(IPAContext &context,
seen += histogram[i];
if (seen >= pixelThreshold) {
context.activeState.blc.level = i * histogramRatio;
+ exposure_ = frameContext.sensor.exposure;
+ gain_ = frameContext.sensor.gain;
LOG(IPASoftBL, Debug)
<< "Auto-set black level: "
<< i << "/" << SwIspStats::kYHistogramSize