[{"id":30300,"web_url":"https://patchwork.libcamera.org/comment/30300/","msgid":"<ZoZob11p-W1nyMG_@pyrite.rasen.tech>","date":"2024-07-04T09:16:31","subject":"Re: [PATCH v3 13/23] libtuning: lsc: rkisp1: Clip lsc values to\n\tvalid range","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"On Wed, Jul 03, 2024 at 04:17:02PM +0200, Stefan Klug wrote:\n> Based on the input images, the lsc values could exceed the range allowed\n> by the rkisp1. As we are now clipping the values, we can simplify the\n> value mapping.\n> \n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  utils/tuning/libtuning/modules/lsc/rkisp1.py | 3 ++-\n>  1 file changed, 2 insertions(+), 1 deletion(-)\n> \n> diff --git a/utils/tuning/libtuning/modules/lsc/rkisp1.py b/utils/tuning/libtuning/modules/lsc/rkisp1.py\n> index 20406e436a6a..57004104fc7a 100644\n> --- a/utils/tuning/libtuning/modules/lsc/rkisp1.py\n> +++ b/utils/tuning/libtuning/modules/lsc/rkisp1.py\n> @@ -80,7 +80,8 @@ class LSCRkISP1(LSC):\n>              tables = []\n>              for lis in [list_cr, list_cgr, list_cgb, list_cb]:\n>                  table = np.mean(lis[indices], axis=0)\n> -                table = output_map_func((1, 3.999), (1024, 4095), table)\n> +                table = output_map_func((1, 4), (1024, 4096), table)\n> +                table = np.clip(table, 1024, 4095)\n\nOh that indeed does look nicer.\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n>                  table = np.round(table).astype('int32').tolist()\n>                  tables.append(table)\n>  \n> -- \n> 2.43.0\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 92213BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  4 Jul 2024 09:16:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9D5D162E22;\n\tThu,  4 Jul 2024 11:16:38 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C3217619C4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  4 Jul 2024 11:16:37 +0200 (CEST)","from pyrite.rasen.tech (h175-177-049-156.catv02.itscom.jp\n\t[175.177.49.156])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id BD1EC3A2;\n\tThu,  4 Jul 2024 11:16:07 +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=\"EepBVOiu\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1720084568;\n\tbh=BNC5Wm23sKtRV64Bt6gWiPtjGM/A8mBsUVeeLptZyng=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=EepBVOiudgQ9AQeuzZhynBmgAY9GD5cEs74oPQnewQBqvUgonrGbvb7u+CGg0GOWN\n\tb9/ly0KUYDL/eEe+lMksaH8x3XomgeCF6RbILVx55pRsiLWh1/6lQYBSGVHn6SH29A\n\tUE8XgTMIoukNcSpGYl4fE7NUHR45XH6RIQNaGaG8=","Date":"Thu, 4 Jul 2024 18:16:31 +0900","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"Stefan Klug <stefan.klug@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","Subject":"Re: [PATCH v3 13/23] libtuning: lsc: rkisp1: Clip lsc values to\n\tvalid range","Message-ID":"<ZoZob11p-W1nyMG_@pyrite.rasen.tech>","References":"<20240703141726.252368-1-stefan.klug@ideasonboard.com>\n\t<20240703141726.252368-14-stefan.klug@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20240703141726.252368-14-stefan.klug@ideasonboard.com>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]