From 7bbe26bbc47625dedf7703338a31bf351c560b0d Mon Sep 17 00:00:00 2001 From: Milan Zamazal Date: Fri, 18 Oct 2024 16:12:36 +0200 Subject: libcamera: software_isp: Get black level from the camera helper The black level in software ISP is unconditionally guessed from the obtained frames. CameraSensorHelper optionally provides the black level from camera specifications now. Let's use the value if available. If the black level is not available from the given CameraSensorHelper instance, it's still determined on the fly. Signed-off-by: Milan Zamazal Reviewed-by: Kieran Bingham Tested-by: Robert Mader Signed-off-by: Kieran Bingham --- src/ipa/simple/algorithms/blc.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/ipa/simple/algorithms') diff --git a/src/ipa/simple/algorithms/blc.cpp b/src/ipa/simple/algorithms/blc.cpp index b9f2aaa6..a7af2e12 100644 --- a/src/ipa/simple/algorithms/blc.cpp +++ b/src/ipa/simple/algorithms/blc.cpp @@ -24,7 +24,8 @@ BlackLevel::BlackLevel() int BlackLevel::configure(IPAContext &context, [[maybe_unused]] const IPAConfigInfo &configInfo) { - context.activeState.blc.level = 255; + context.activeState.blc.level = + context.configuration.black.level.value_or(255); return 0; } @@ -34,6 +35,9 @@ void BlackLevel::process(IPAContext &context, const SwIspStats *stats, [[maybe_unused]] ControlList &metadata) { + if (context.configuration.black.level.has_value()) + return; + if (frameContext.sensor.exposure == exposure_ && frameContext.sensor.gain == gain_) { return; -- cgit v1.2.1