From e7888073718aadd7c35a78f88792a73a4e3a8300 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 6 Dec 2021 16:24:43 +0200 Subject: libcamera: Use utils::abs_diff() Use the new utils::abs_diff() function where appropriate to replace manual implementations. While at it fix a header ordering issue in src/libcamera/pipeline/raspberrypi/raspberrypi.cpp. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Umang Jain --- src/ipa/ipu3/algorithms/agc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/ipa/ipu3/algorithms/agc.cpp') diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp index 582f0ae1..8d6f18f6 100644 --- a/src/ipa/ipu3/algorithms/agc.cpp +++ b/src/ipa/ipu3/algorithms/agc.cpp @@ -12,6 +12,7 @@ #include #include +#include #include @@ -188,7 +189,7 @@ void Agc::computeExposure(IPAFrameContext &frameContext, double yGain, double evGain = std::max(yGain, iqMeanGain); /* Consider within 1% of the target as correctly exposed */ - if (std::abs(evGain - 1.0) < 0.01) + if (utils::abs_diff(evGain, 1.0) < 0.01) LOG(IPU3Agc, Debug) << "We are well exposed (evGain = " << evGain << ")"; -- cgit v1.2.1