From 42e18c96bcb70a00d2fefce2ff01bc58dbdd7389 Mon Sep 17 00:00:00 2001 From: Stefan Klug Date: Mon, 7 Jul 2025 10:55:07 +0200 Subject: [PATCH] libipa: agc_mean_luminance: Add debug logging When debugging the AEGC it is important to know when the constraints apply. As this is important information for anyone doing tuning file optimization, add it upstream. Signed-off-by: Stefan Klug Reviewed-by: Kieran Bingham Reviewed-by: Daniel Scally Reviewed-by: Paul Elder Reviewed-by: Laurent Pinchart --- src/ipa/libipa/agc_mean_luminance.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ipa/libipa/agc_mean_luminance.cpp b/src/ipa/libipa/agc_mean_luminance.cpp index d37a9b66..ebdb4d75 100644 --- a/src/ipa/libipa/agc_mean_luminance.cpp +++ b/src/ipa/libipa/agc_mean_luminance.cpp @@ -467,12 +467,20 @@ double AgcMeanLuminance::constraintClampGain(uint32_t constraintModeIndex, hist.interQuantileMean(constraint.qLo, constraint.qHi); if (constraint.bound == AgcConstraint::Bound::Lower && - newGain > gain) + newGain > gain) { gain = newGain; + LOG(AgcMeanLuminance, Debug) + << "Apply lower bound: " << gain << " to " + << newGain; + } if (constraint.bound == AgcConstraint::Bound::Upper && - newGain < gain) + newGain < gain) { gain = newGain; + LOG(AgcMeanLuminance, Debug) + << "Apply upper bound: " << gain << " to " + << newGain; + } } return gain;