From patchwork Sun Feb 18 16:49:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 19508 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 866FCC3261 for ; Sun, 18 Feb 2024 16:49:12 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 522F562802; Sun, 18 Feb 2024 17:49:12 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="P5LCI3GM"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 96D9A62806 for ; Sun, 18 Feb 2024 17:49:10 +0100 (CET) Received: from pendragon.ideasonboard.com (89-27-53-110.bb.dnainternet.fi [89.27.53.110]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9D0312298; Sun, 18 Feb 2024 17:49:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1708274944; bh=l5G8RaEuhsqyRYO0i7tXbSaP9wpcsJG9l9IPc0lQSPM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P5LCI3GM0a/h6B1ofbg1pzy8wxaamYGqhIYY+RqXr5mf2NgSeGrq/RoeOew+M4Q2E GU3bpNFiej+87Mb/f8+t81K2uYaxlHVI265glPyO6gXEhbaaHPu9GUDZWpjFH+d4iA L8Q9hxdTx54SjDj7P0KPrSb27tvR4WFm87NnhoDM= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH v3 3/5] ipa: rkisp1: Fix histogram weights configuration Date: Sun, 18 Feb 2024 18:49:06 +0200 Message-ID: <20240218164908.15921-4-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240218164908.15921-1-laurent.pinchart@ideasonboard.com> References: <20240218164908.15921-1-laurent.pinchart@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" The histogram weights are initialized to hardcoded 1's for each histogram grid cell. The code uses the wrong variable for the grid size, resulting in some weights having a 0 value. Fix it. Signed-off-by: Laurent Pinchart Reviewed-by: Paul Elder Reviewed-by: Stefan Klug --- src/ipa/rkisp1/algorithms/agc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp index da705b14754c..47a6f7b26744 100644 --- a/src/ipa/rkisp1/algorithms/agc.cpp +++ b/src/ipa/rkisp1/algorithms/agc.cpp @@ -175,7 +175,7 @@ void Agc::prepare(IPAContext &context, const uint32_t frame, /* Set an average weighted histogram. */ Span weights{ params->meas.hst_config.hist_weight, - context.hw->numHistogramBins + context.hw->numHistogramWeights }; std::fill(weights.begin(), weights.end(), 1); /* Step size can't be less than 3. */