From edfe10997b4839f8376ba78dfb3261da4c51b9d7 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Fri, 15 Nov 2024 07:46:24 +0000 Subject: ipa: ipu3: Use centralised libipa helpers Use the centralised libipa helpers instead of open coding common functions. Signed-off-by: Daniel Scally Reviewed-by: Kieran Bingham Reviewed-by: Milan Zamazal Reviewed-by: Laurent Pinchart --- src/ipa/ipu3/algorithms/agc.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (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 c5f3d8f0..466b3fb3 100644 --- a/src/ipa/ipu3/algorithms/agc.cpp +++ b/src/ipa/ipu3/algorithms/agc.cpp @@ -17,6 +17,7 @@ #include +#include "libipa/colours.h" #include "libipa/histogram.h" /** @@ -185,9 +186,9 @@ double Agc::estimateLuminance(double gain) const blueSum += std::min(std::get<2>(rgbTriples_[i]) * gain, 255.0); } - double ySum = redSum * rGain_ * 0.299 - + greenSum * gGain_ * 0.587 - + blueSum * bGain_ * 0.114; + double ySum = rec601LuminanceFromRGB(redSum * rGain_, + greenSum * gGain_, + blueSum * bGain_); return ySum / (bdsGrid_.height * bdsGrid_.width) / 255; } -- cgit v1.2.1