[{"id":19004,"web_url":"https://patchwork.libcamera.org/comment/19004/","msgid":"<YSPHmqiwjYMDaW52@pendragon.ideasonboard.com>","date":"2021-08-23T16:06:50","subject":"Re: [libcamera-devel] [PATCH v1 3/7] ipa: ipu3: awb: Correct the\n\tgain multipliers","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jean-Michel,\n\nThank you for the patch.\n\nOn Mon, Aug 23, 2021 at 02:49:33PM +0200, Jean-Michel Hautbois wrote:\n> The gains have a precision u3.13, range [0, 8) which means that a gain\n> multiplier value of 1.0 is represented as a multiplication by 8192 in\n> the ImgU. Correct the gains as this was misunderstood in the first\n> place.\n> \n> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> ---\n>  src/ipa/ipu3/algorithms/awb.cpp | 11 +++++------\n>  1 file changed, 5 insertions(+), 6 deletions(-)\n> \n> diff --git a/src/ipa/ipu3/algorithms/awb.cpp b/src/ipa/ipu3/algorithms/awb.cpp\n> index 9497a21b..60a5fc52 100644\n> --- a/src/ipa/ipu3/algorithms/awb.cpp\n> +++ b/src/ipa/ipu3/algorithms/awb.cpp\n> @@ -329,13 +329,12 @@ void Awb::prepare(IPAContext &context, ipu3_uapi_params *params)\n>  \t\t\t\t\t\t\t* params->acc_param.bnr.opt_center.y_reset;\n>  \t/*\n>  \t * Green gains should not be touched and considered 1.\n\nIs this line still relevant here, or should it be moved to\nAwb::awbGreyWorld() where we hardcode asyncResults_.greenGain to 1.0 ?\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> -\t * Default is 16, so do not change it at all.\n> -\t * 4096 is the value for a gain of 1.0\n> +\t * 8192 is the multiplier for a gain of 1.0\n>  \t */\n> -\tparams->acc_param.bnr.wb_gains.gr = 16 * context.frameContext.awb.gains.green;\n> -\tparams->acc_param.bnr.wb_gains.r = 4096 * context.frameContext.awb.gains.red;\n> -\tparams->acc_param.bnr.wb_gains.b = 4096 * context.frameContext.awb.gains.blue;\n> -\tparams->acc_param.bnr.wb_gains.gb = 16 * context.frameContext.awb.gains.green;\n> +\tparams->acc_param.bnr.wb_gains.gr = 8192 * context.frameContext.awb.gains.green;\n> +\tparams->acc_param.bnr.wb_gains.r = 8192 * context.frameContext.awb.gains.red;\n> +\tparams->acc_param.bnr.wb_gains.b = 8192 * context.frameContext.awb.gains.blue;\n> +\tparams->acc_param.bnr.wb_gains.gb = 8192 * context.frameContext.awb.gains.green;\n>  \n>  \tLOG(IPU3Awb, Debug) << \"Color temperature estimated: \" << asyncResults_.temperatureK;\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id E8786BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 23 Aug 2021 16:07:01 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B1F1B688A3;\n\tMon, 23 Aug 2021 18:07:01 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6454D6025B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 23 Aug 2021 18:07:00 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 04D372A5;\n\tMon, 23 Aug 2021 18:06:59 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"TIMg/GHU\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1629734820;\n\tbh=CbGMxmKRXrKK+oG7Ah3KR/yGZCSpQEnQ12DgBsskIlo=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=TIMg/GHUP6KRz4YnHTqOKzN6kooXNOgFRBqExknnBjhq5rTQdJYCvw4/ebu93UTTL\n\tW9Iz59LggF5K7u6kUWQ2ShNu/K+FFFTUGc5wBlpBDMxX3feNgnTygaF9MXO/aNs54a\n\tJGDcjIMMDmtocRkPex0bbLIjfioN2403LtSUI+Ds=","Date":"Mon, 23 Aug 2021 19:06:50 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","Message-ID":"<YSPHmqiwjYMDaW52@pendragon.ideasonboard.com>","References":"<20210823124937.253539-1-jeanmichel.hautbois@ideasonboard.com>\n\t<20210823124937.253539-4-jeanmichel.hautbois@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20210823124937.253539-4-jeanmichel.hautbois@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v1 3/7] ipa: ipu3: awb: Correct the\n\tgain multipliers","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]