From patchwork Tue Nov 19 08:45:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 21986 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 42833C32F1 for ; Tue, 19 Nov 2024 08:55:47 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7021165EDE; Tue, 19 Nov 2024 09:55:46 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="L+gDRyYu"; dkim-atps=neutral Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A602565898 for ; Tue, 19 Nov 2024 09:55:44 +0100 (CET) Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-382435f561cso246078f8f.2 for ; Tue, 19 Nov 2024 00:55:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1732006544; x=1732611344; 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=0bRztghqo3+Z/lsYSlInSpe1Xy1ewd07T4em2ITcA1s=; b=L+gDRyYum3b0ud49pOeUXTQDEvrXLXJmUUnevDXN/i8nB6uL6CiZZx9MPUeLrbodf8 CYf+mx5gTpBOm2LN56bKmnZ/pACogdHb9+7gQZhI5XFTOS6UxYqRjdm3ZfwUa7GSD8Fi udWGwSnnuWflCJIO7TLFsDNbVocbKbfERuk3TdtaWyQF7cKoSHZy3YlSRzqj4aofINAA upCilahmLK+UFaIq1APGSdEY7kxVdkA3ilSr/wkSPaMhffxXi23+Jujx1yf3gLWC/YRE s1FG4utJ1E1DefWyritpV9zfrBPPlYNN6aIvqFJykbrLOS5ZxwhJfqTYk7eKfV6nUYTf GGuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732006544; x=1732611344; 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=0bRztghqo3+Z/lsYSlInSpe1Xy1ewd07T4em2ITcA1s=; b=u/UMIMbEjIJNM2IsTF7B+iokE5f5HuDSmqdarHQ114FImYCrYutqPL1qqPToYK6Wst Qgm4QKUGMCukxLvP45Nvuy6F0zjxbJzd88ML8RING4D6c1lhz9ZtbJhKH9q8cchzlHxh ImZWCrI12B2xgQgsI4wJqqqQLAmq7xQNMP+Sx/PuMtl4x26XYXDPJ+z/2YIAOK0hKXw6 wTTfRmlm9LoBPgjsDEWkym6LJ/Wz0ZIvngqkaYOD7NBTQXTPeUMhAGpbHoqG3Hx/eH9O V7ohSr+2LYARHZ2xnCjrrs+JNm4Tb4lbi7BZVVimD0jXXtzDlrBykV25qoZJOaG1FmU7 XZBA== X-Gm-Message-State: AOJu0YwGT+G6Lh3FaQycqn/NohbiOUxeqBtbOoNVluF3ToqgKIedcTRu omBJ8wJFZVbMCt6oGtkPSVQ/p88x/QW+SDy5vdy2gOXiRugeHky2LYmbJnYvsJkVWveo7plULc+ F X-Google-Smtp-Source: AGHT+IEnxRxCcn1MreTuqd6nHxYCdt6c+1nXblrPPgRmEEHqSOIax170WwrAlSJRU78J8s1OlEeH/A== X-Received: by 2002:a05:6000:1886:b0:37e:d92e:818b with SMTP id ffacd0b85a97d-38225a8da69mr5248518f8f.14.1732006543895; Tue, 19 Nov 2024 00:55:43 -0800 (PST) Received: from naush-laptop.pitowers.org ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-382371a5646sm9917548f8f.0.2024.11.19.00.55.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2024 00:55:43 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: david.plowman@raspberrypi.com, Naushir Patuck Subject: [PATCH] ipa: rpi: awb: Disable CT search bias for Grey World AWB Date: Tue, 19 Nov 2024 08:45:25 +0000 Message-Id: <20241119084525.22589-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. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Kieran Bingham --- src/ipa/rpi/controller/rpi/awb.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ipa/rpi/controller/rpi/awb.cpp b/src/ipa/rpi/controller/rpi/awb.cpp index 9d8e170d1bfe..87b1b077ffb8 100644 --- a/src/ipa/rpi/controller/rpi/awb.cpp +++ b/src/ipa/rpi/controller/rpi/awb.cpp @@ -459,10 +459,13 @@ 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.size() ? + config_.ctR.eval(config_.biasCT) : 0; + const double biasCtB = config_.bayes && config_.ctB.size() ? + 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.