From patchwork Mon Jul 7 08:55:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 23753 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 25F6CC3237 for ; Mon, 7 Jul 2025 08:55:50 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4ADD168E83; Mon, 7 Jul 2025 10:55:49 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="kCkVd2n8"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B6BCE68E83 for ; Mon, 7 Jul 2025 10:55:45 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:c79f:85df:e7f5:4c31]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 224BD1942; Mon, 7 Jul 2025 10:55:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1751878519; bh=x3qexoZIskvY3vGUevhjP6zySz/iJV/J1oSl0YrWWCk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kCkVd2n8X/UNo3oVihAlLHANvSLWLsowoTnAKnZOIJICTSUqpJ1YcBFaz7k3ZY+M4 XSxHMQdM65yKT4eXMVV1NnMySUZmpVKxMrNaDkwTTyzrzYoB5stIgndsl6T6BzcBb/ VYYPUgg60uQDlrd5PUQVM9qPzYiwLv3Uu+Lop5C4= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug , Kieran Bingham , Daniel Scally , Paul Elder , Laurent Pinchart Subject: [PATCH v3 4/9] libipa: agc_mean_luminance: Add debug logging Date: Mon, 7 Jul 2025 10:55:07 +0200 Message-ID: <20250707085520.39777-5-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250707085520.39777-1-stefan.klug@ideasonboard.com> References: <20250707085520.39777-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 Reviewed-by: Paul Elder Reviewed-by: Laurent Pinchart --- Changes in v3: - Fixed line wrapping - Collected tags Changes in v2: - Collected tags --- 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 d37a9b66103f..ebdb4d755741 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;