From patchwork Fri Apr 11 12:36:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 23161 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 49C65C327D for ; Fri, 11 Apr 2025 12:37:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id F3B5368AB0; Fri, 11 Apr 2025 14:36:59 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="YyVzz7sp"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 106AE68AA8 for ; Fri, 11 Apr 2025 14:36:58 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:5b21:2ad5:1023:7179]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A91911E6; Fri, 11 Apr 2025 14:34:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1744374898; bh=AnGC7HT7rautr3JzU7N6bgqoP+fsGrVKtGRYvOLkXgo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YyVzz7sp9K+HrcjNbPAa1tfxlkacXMqkzoU+uP7wpOM2YtMlp3fR3TfM/HLSqIrxT mbJojjQyB2D1uliLL5f6gE6hvdoDBx36KXpzjWtBRl6GQAUZFNbbKA59vh2ynTBmO3 xNjoSYJTD8RjlOAmmSid2pVXa8FhS8ZDNl7Jk+sA= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug , Kieran Bingham , Daniel Scally Subject: [PATCH v2 4/9] libipa: agc_mean_luminance: Add debug logging Date: Fri, 11 Apr 2025 14:36:32 +0200 Message-ID: <20250411123641.2144530-5-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250411123641.2144530-1-stefan.klug@ideasonboard.com> References: <20250411123641.2144530-1-stefan.klug@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" 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 --- Changes in v2: - Collected tags --- src/ipa/libipa/agc_mean_luminance.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ipa/libipa/agc_mean_luminance.cpp b/src/ipa/libipa/agc_mean_luminance.cpp index f617fde81101..9154f083a510 100644 --- a/src/ipa/libipa/agc_mean_luminance.cpp +++ b/src/ipa/libipa/agc_mean_luminance.cpp @@ -468,12 +468,16 @@ 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;