From patchwork Thu Jun 16 09:11:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Michel Hautbois X-Patchwork-Id: 16235 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 3ABE8C3273 for ; Thu, 16 Jun 2022 09:12:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 105B165635; Thu, 16 Jun 2022 11:12:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1655370749; bh=MZTMnj9SaFWfbmCn2c4lmh2X8QpSS7ZsBTcLHr1FAa4=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=U9oRFdm0T3iWlWv+khTV56t2yZHGM9k8YffxjVRiL5cdq4KgC8FcyxaDcII0X7AK5 Wf6NnxuDzVFq+xoMXNfJY5Fn0MLtz3zHfm6gjLNspOmc8E8NO/TrOUscnElIIk8Wds TWqi1mzLI0ozSAzB14Z17giFpOsTDz1nHyEEpvgRT0a/mwXMtuB2nZPgXkBdR2jKS4 DFLQ2OCsO0BHqGMAhSedoY6h2osZYSygv/gLzNlJ7LWAc9XwGqb0Vg56lt2n8fM9QO bC5PyE3TItwYw4SJ10aJL+ADdp+v7t0LiS7ulf3UmhP1f1p8Rd8Ss9zPyKsVV6xqGN W2cMaWC6wypAA== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0AB30601F1 for ; Thu, 16 Jun 2022 11:12:27 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="rcGsGWi+"; dkim-atps=neutral Received: from tatooine.ideasonboard.com (unknown [IPv6:2a01:e0a:169:7140:64d1:a349:8ac7:1dd0]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 95F97415; Thu, 16 Jun 2022 11:12:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1655370746; bh=MZTMnj9SaFWfbmCn2c4lmh2X8QpSS7ZsBTcLHr1FAa4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rcGsGWi+bSQJJVTSzHhTmMHAD+HPPpzrmnJLsUNK7akjcz4IhHUTKp1AqpYv+uSNh KF6hZyAJT3D5gSAv9xla5tUtLUbK2qT3qBQpFaeoETf6QEMQpcNReHzSXPi77VjkcO M2FYzxD9vwS0IsNqCR6qWiWrHRXpj3FHLlzdcMqI= To: libcamera-devel@lists.libcamera.org Date: Thu, 16 Jun 2022 11:11:49 +0200 Message-Id: <20220616091148.67870-2-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220616091148.67870-1-jeanmichel.hautbois@ideasonboard.com> References: <20220616091148.67870-1-jeanmichel.hautbois@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH 1/1] ipa: ipu3: awb: Correct the coefficient factor 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: Jean-Michel Hautbois via libcamera-devel From: Jean-Michel Hautbois Reply-To: Jean-Michel Hautbois Cc: bingbu.cao@intel.com, sakari.ailus@linux.intel.com Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The factor used right now in the IPU3 is 8192, as stated in the documentation : "Precision u3.13, range [0, 8)". Testing it in more depth made this assumption debatable, as it seems that the gain is 1.0 when the value is 4096. Signed-off-by: Jean-Michel Hautbois --- src/ipa/ipu3/algorithms/awb.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ipa/ipu3/algorithms/awb.cpp b/src/ipa/ipu3/algorithms/awb.cpp index 5c232d92..2a7d30ab 100644 --- a/src/ipa/ipu3/algorithms/awb.cpp +++ b/src/ipa/ipu3/algorithms/awb.cpp @@ -451,10 +451,10 @@ void Awb::prepare(IPAContext &context, ipu3_uapi_params *params) params->acc_param.bnr.opt_center_sqr.y_sqr_reset = params->acc_param.bnr.opt_center.y_reset * params->acc_param.bnr.opt_center.y_reset; /* Convert to u3.13 fixed point values */ - params->acc_param.bnr.wb_gains.gr = 8192 * context.activeState.awb.gains.green; - params->acc_param.bnr.wb_gains.r = 8192 * context.activeState.awb.gains.red; - params->acc_param.bnr.wb_gains.b = 8192 * context.activeState.awb.gains.blue; - params->acc_param.bnr.wb_gains.gb = 8192 * context.activeState.awb.gains.green; + params->acc_param.bnr.wb_gains.gr = 0 * context.activeState.awb.gains.green; + params->acc_param.bnr.wb_gains.r = 4096 * context.activeState.awb.gains.red; + params->acc_param.bnr.wb_gains.b = 4096 * context.activeState.awb.gains.blue; + params->acc_param.bnr.wb_gains.gb = 0 * context.activeState.awb.gains.green; LOG(IPU3Awb, Debug) << "Color temperature estimated: " << asyncResults_.temperatureK;