From patchwork Tue Nov 19 10:14:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 21987 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 C22F2C32F1 for ; Tue, 19 Nov 2024 10:14:58 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0019665EEB; Tue, 19 Nov 2024 11:14:57 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="R7ZoJjqh"; dkim-atps=neutral Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 706C76589D for ; Tue, 19 Nov 2024 11:14:56 +0100 (CET) Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4315549c4d5so5707395e9.0 for ; Tue, 19 Nov 2024 02:14:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1732011295; x=1732616095; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=R9jR0meTlaGVa3TOuurcXiqninCYpYOfJ1oIsW+ZkuM=; b=R7ZoJjqhl5ZNAeqjtFTOr/96ecQUZVZ6o6PNa1+VEqZikJQBY+xgStyR6QHlm1nldI EwaLCJ1KkWSO8pI+d6giQaw621Cf+SRo3voX+EGKfg6WKDcOIoOm1PHKAMuJRErfVYjN OqDtoQwUl6KDvcLttnwIVW6W7cYkkZfwG2s1muitUlVAbswLT0Q0GwW3hLRzBQ8nilg5 U3sQv/2evU04BxH2icV3jiaM5Mv0+h/HRCBKBjlBGKnWxTEZ8gz7MviQCqefWsjoQO8R QZqlLbjac0iHCeFg7G+D6rq7chPXBDqDx3fTjlHErLmom7G/pu9scqsPXUB0Wzwwv2Su rPQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732011295; x=1732616095; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=R9jR0meTlaGVa3TOuurcXiqninCYpYOfJ1oIsW+ZkuM=; b=KU5ePFQyH/sQXlUA9t+KJk5PmYgCIs9JzCeGKMWzPXxd1f75Ce96R69p5Hv6iRhh/A d4xImS7vkruTYHkufP7u9G9RquWKUTPKEsGv1ZwXUHGzxUT0Wlm4Lln7hnFS13RK9Ge4 ag/ZhhippPme7taUpVEJO6W7KN2uD3x2iP/GGhGr4NVfKQvb/ScZ6GmFVaK4ONBCn5WW V9GT6zOdTwUCTHyYx9Efte+l+stjkRe2luQ+tQNmdKusFxMzncG/iJIUpBuVHh4sEsBR KoR4G0a1eLi/wFn3xnFg1LbLZwZNmlLGwgobynz8is1mY40TuhTSwCpHfZjs10KNLGS4 NzfA== X-Gm-Message-State: AOJu0YzeslfLFaQHnRzqTRtVQQYyciHLs88WWZ+QSoY063FLKf58E0wh NiSSb4yzpsJR+PP3//RQm3vJGWzuc+Lk3VkUUAIdXJrqEbKVorTnEd1ZwoEFzRI2QFDilch0M8x d X-Google-Smtp-Source: AGHT+IGANfmLys+xMpGsrXtysZeg3k1xMhoBzFgd7srPpOv79hHwM3Sy7Pj3BKDEkTA2lsVHUn94xg== X-Received: by 2002:a05:600c:1c1f:b0:431:4a7e:a121 with SMTP id 5b1f17b1804b1-432df79d180mr56809465e9.9.1732011295497; Tue, 19 Nov 2024 02:14:55 -0800 (PST) Received: from naush-laptop.pitowers.org ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432dab807d4sm187203175e9.21.2024.11.19.02.14.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2024 02:14:55 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck , David Plowman , Kieran Bingham Subject: [PATCH v2] ipa: rpi: awb: Disable CT search bias for Grey World AWB Date: Tue, 19 Nov 2024 10:14:52 +0000 Message-Id: <20241119101452.20808-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 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" If grey world AWB is setup in the tuning file, the CT curve will either be missing or invalid. Disable biasing the statistics for the search in such cases. Fixes: ea8fd63d936f ("ipa: rpi: awb: Add a bias to the AWB search") Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Kieran Bingham --- src/ipa/rpi/controller/rpi/awb.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ipa/rpi/controller/rpi/awb.cpp b/src/ipa/rpi/controller/rpi/awb.cpp index 9d8e170d1bfe..c277a1764112 100644 --- a/src/ipa/rpi/controller/rpi/awb.cpp +++ b/src/ipa/rpi/controller/rpi/awb.cpp @@ -459,10 +459,11 @@ void Awb::prepareStats() * LSC has already been applied to the stats in this pipeline, so stop * any LSC compensation. We also ignore config_.fast in this version. */ + const double biasCtR = config_.bayes ? config_.ctR.eval(config_.biasCT) : 0; + const double biasCtB = config_.bayes ? config_.ctB.eval(config_.biasCT) : 0; generateStats(zones_, statistics_, config_.minPixels, config_.minG, getGlobalMetadata(), - config_.biasProportion, config_.ctR.eval(config_.biasCT), - config_.ctB.eval(config_.biasCT)); + config_.biasProportion, biasCtR, biasCtB); /* * apply sensitivities, so values appear to come from our "canonical" * sensor.