summaryrefslogtreecommitdiff
path: root/src/ipa/ipu3/algorithms/agc.cpp
diff options
context:
space:
mode:
authorDaniel Scally <dan.scally@ideasonboard.com>2024-11-15 07:46:24 +0000
committerDaniel Scally <dan.scally@ideasonboard.com>2024-11-18 15:48:25 +0000
commitedfe10997b4839f8376ba78dfb3261da4c51b9d7 (patch)
tree1ba07b99d016170e8bc3ade0d54860790f5d12bd /src/ipa/ipu3/algorithms/agc.cpp
parentb1439c87d118776274296ef07136919a693e73fc (diff)
ipa: ipu3: Use centralised libipa helpers
Use the centralised libipa helpers instead of open coding common functions. Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/ipa/ipu3/algorithms/agc.cpp')
-rw-r--r--src/ipa/ipu3/algorithms/agc.cpp7
1 files changed, 4 insertions, 3 deletions
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 <libcamera/ipa/core_ipa_interface.h>
+#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;
}