From patchwork Thu Nov 24 10:38:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 17864 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 D63F5C3286 for ; Thu, 24 Nov 2022 10:38:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B80D06331B; Thu, 24 Nov 2022 11:38:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1669286324; bh=/5KjD6c/IL+fXydsKOzb9YnlaccYxgItMGrGOcqLFgc=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=1ObkNSMDWXDqWYMUhl/+mqX/StKj3tjh0SPTgA05ONDaH8ZFDWt0cpUzvxVPk10Hl XLGiFa/feMPO+mTasRSEos9cZB7QwpRLNtwKqn2ZqgCTqeWI11crcg3fMVi6D5wBU/ yAgmq+A9OZ05jdoovG8x8YwEwdo82ykN41d5R/rzjG3McmwNYQoPhUW+CNJpJWNNsd rUcO/mYCcs4AmEmrlu/+id1Z73ofA60uK1/rbzRRqycjR0yCP1m95FlNCAmLYHdwSZ 0JTgL19BPhdZnEFRKwjd21KWYmUY+AYChmnur1+HgKIcIbKRl3R/UmG7Xk/Nn0LRDu gEkjVvsW81X3w== Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 478E663316 for ; Thu, 24 Nov 2022 11:38:42 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="A0Eqnhyr"; dkim-atps=neutral Received: by mail-wr1-x42a.google.com with SMTP id n7so1819974wrr.13 for ; Thu, 24 Nov 2022 02:38:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=raGM6H8WE6ZOibbytcLb47YD73g9Kdg0YHaASybQJqg=; b=A0EqnhyrEMpdzklSN1K7/Xm6Xc7qluzQEu8NmC7OMJZXBGR/b0x1ZzZWAenRI/2i9N Rpj/96RavfG++RlJfXmevu7LM/OM+lSdtqrvMLrKY/OCTxXLxl0shjm53Cw3VvuJvYTT /aKsnFJGX4DrWeYCsw2titWC4LA2eZzh93eRl0luAsD0+gXj76JG1GNPyYoOu7CverGf +QYgS6+iq2DZQFa+6Z0rKv7oCyvHcVr8h1N/Vntx22ulbX1pCq7ynUPOq0YG2f8DZqrC qWSwtZQ3hrPczCOvnvnSH01En0DlifRVPXBY9u4eIRoFi+3Vi1q5tn9sTNV/Ols3x6JK rCoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=raGM6H8WE6ZOibbytcLb47YD73g9Kdg0YHaASybQJqg=; b=Rgj2eID3fsVuuNFyk+OovUbCVn0l3cG3LInZIqkcsYcORzx983F7TcJu5/pmq18iXm 1qov2RF29Bn14RLNVeHpY9rnZ1nSAMv0LZ5HR37uChrKKwZ6tSxtJMOiObV2g26Y19vO vUHTf016/S62zCbSuwEO1DVMM7fQf0UiHJ5VCWr1PsCrXhqclYt2PHIaQm9MtTTiN4ap 887INGp/Op8eHcUbkNc3t9EOoCu9c2k74BAkWuF8Lw9UFArs5VzOsy9m2J7Cv9Z45Zvp 0wAt4kMKWYrC+4GXcdom+O5UfXA5jGFuBbzgK79ZmydKKM7shLDxvr3YVHXNS8pLAHpP lxeg== X-Gm-Message-State: ANoB5pkZgh/pCzQYcdb88nOjNPP6Zs4+9udsnL6qVayFvN/1acciV4GR /wwlBiOmYO+7wg138vomMWZEGTk0pVxwKg== X-Google-Smtp-Source: AA0mqf7k/Uvk5SeJ1ceMN5chg0dhgos+H8JvrD2DBdpG+dHP7+OfQB5Jh0I7cQg6voLZK85Hd2n3ww== X-Received: by 2002:a5d:5684:0:b0:236:61bb:c79d with SMTP id f4-20020a5d5684000000b0023661bbc79dmr19347079wrv.632.1669286321700; Thu, 24 Nov 2022 02:38:41 -0800 (PST) Received: from naush-laptop.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id s16-20020adff810000000b002368a6deaf8sm995103wrp.57.2022.11.24.02.38.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Nov 2022 02:38:41 -0800 (PST) To: libcamera-devel@lists.libcamera.org Date: Thu, 24 Nov 2022 10:38:30 +0000 Message-Id: <20221124103832.6172-4-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221124103832.6172-1-naush@raspberrypi.com> References: <20221124103832.6172-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 3/5] ipa: raspberrypi: awb: Delay release of the statistics buffer 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: , X-Patchwork-Original-From: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Release the statistics buffer after running the through the AWB calculations. Only the "counted" statistics are copied out to a local structure, so keeping the statistics buffer allows the algorithm to see the "uncounted" statistics as well. This is currently handled by hard-coding the total number of statistics regions regions based on the structure definition in the bcm2835_isp_stats structure. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman --- src/ipa/raspberrypi/controller/rpi/awb.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ipa/raspberrypi/controller/rpi/awb.cpp b/src/ipa/raspberrypi/controller/rpi/awb.cpp index 8d8ddf0913f7..861022014896 100644 --- a/src/ipa/raspberrypi/controller/rpi/awb.cpp +++ b/src/ipa/raspberrypi/controller/rpi/awb.cpp @@ -432,11 +432,6 @@ void Awb::prepareStats() */ generateStats(zones_, statistics_->awb_stats, config_.minPixels, config_.minG); - /* - * we're done with these; we may as well relinquish our hold on the - * pointer. - */ - statistics_.reset(); /* * apply sensitivities, so values appear to come from our "canonical" * sensor. @@ -733,6 +728,11 @@ void Awb::doAwb() << " with gains r " << asyncResults_.gainR << " and b " << asyncResults_.gainB; } + /* + * we're done with these; we may as well relinquish our hold on the + * pointer. + */ + statistics_.reset(); } /* Register algorithm with the system. */