From 65628512df0f4bd1e4b2816f080d648fce3e3ab0 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 16 Nov 2021 16:29:23 +0200 Subject: ipa: ipu3: agc: Drop kMaxLuminance constant The kMaxLuminance constant is badly named, it's not a maximum luminance, but the maximum integer value output by the AWB statistics engine for per-channel averages. The constant is used in a single place, hardcoding the value is actually more readable. Signed-off-by: Laurent Pinchart Reviewed-by: Jean-Michel Hautbois Reviewed-by: Kieran Bingham --- src/ipa/ipu3/algorithms/agc.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 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 bd02c474..43a39ffd 100644 --- a/src/ipa/ipu3/algorithms/agc.cpp +++ b/src/ipa/ipu3/algorithms/agc.cpp @@ -61,9 +61,6 @@ static constexpr double kEvGainTarget = 0.5; /* Number of frames to wait before calculating stats on minimum exposure */ static constexpr uint32_t kNumStartupFrames = 10; -/* Maximum luminance used for brightness normalization */ -static constexpr uint32_t kMaxLuminance = 255; - /* * Normalized luma value target. * @@ -298,8 +295,7 @@ double Agc::computeInitialY(IPAFrameContext &frameContext, greenSum * frameContext.awb.gains.green * .587 + blueSum * frameContext.awb.gains.blue * .114; - /* Return the normalized relative luminance. */ - return Y_sum / (grid.height * grid.width) / kMaxLuminance; + return Y_sum / (grid.height * grid.width) / 255; } /** -- cgit v1.2.1