{"id":17878,"url":"https://patchwork.libcamera.org/api/patches/17878/?format=json","web_url":"https://patchwork.libcamera.org/patch/17878/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20221124113550.2182342-13-paul.elder@ideasonboard.com>","date":"2022-11-24T11:35:50","name":"[libcamera-devel,v4,12/12] utils: tuning: Add tuning script for rkisp1","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"e2ed2603d23ca944d23ac7b0d36456d02a0dcdd6","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/?format=json","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/17878/mbox/","series":[{"id":3636,"url":"https://patchwork.libcamera.org/api/series/3636/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3636","date":"2022-11-24T11:35:38","name":"utils: tuning: Add a new tuning infrastructure","version":4,"mbox":"https://patchwork.libcamera.org/series/3636/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/17878/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/17878/checks/","tags":{},"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 F29F0BDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 24 Nov 2022 11:36:25 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AD4ED63322;\n\tThu, 24 Nov 2022 12:36:25 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 378BA63325\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 24 Nov 2022 12:36:24 +0100 (CET)","from pyrite.tail37cf.ts.net (h175-177-042-159.catv02.itscom.jp\n\t[175.177.42.159])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B1AF4496;\n\tThu, 24 Nov 2022 12:36:22 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1669289785;\n\tbh=sX8mqhqZGt5ApFAlfUHXTapjnnHZN8j4u59BaOF0gqc=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=4fYApYPWhZYfXkUUStRWDsnECQUMVtzTCLKRVi6CWdG7VvqEE9JuUsnoScccwvC5g\n\tosot28hCWuyRQk43FVZ8DepXSfnyoxdNmJbCSedDd/6qE/FyR4WxCOK0d4GnA88QlR\n\tXqy/XhWL5RkwHTftutUXMGJBtvTniMfDy1jKcEq/hw9pmi5J96HYQGHYHLsoRqNbGM\n\tSdus54vMrtyxI9UOAzORKCNfJ5ZqVQpuyjcKl9fpuEA5/HCNPma5m7+1X1kEclx7bk\n\tEqs6i+xj0vymTmnGe4PcIilE/ZNia6tyhuqowQWbq2aVyFS6mS8BoD8tvTTco+7rhQ\n\tY7Ety1Ncy+jvg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1669289784;\n\tbh=sX8mqhqZGt5ApFAlfUHXTapjnnHZN8j4u59BaOF0gqc=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=WZVMuhttapETcOjeOOg1Z5CZY+UzjB9Pij6ad7WrPbSnQRmh28FHPN/ZXWxb/ANWP\n\t/UCsZAXFd4mRKPNgiKQJD7qg5khJpTQO3Qz6wbde8jE7nrunnK5HzQ9+d37Q7K29b8\n\tGYVgdB59lJRBWSwUIoYU4vNsXFFld5n71ohcaSbo="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"WZVMuhtt\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 24 Nov 2022 20:35:50 +0900","Message-Id":"<20221124113550.2182342-13-paul.elder@ideasonboard.com>","X-Mailer":"git-send-email 2.35.1","In-Reply-To":"<20221124113550.2182342-1-paul.elder@ideasonboard.com>","References":"<20221124113550.2182342-1-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v4 12/12] utils: tuning: Add tuning script\n\tfor rkisp1","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>","From":"Paul Elder via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Paul Elder <paul.elder@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Add a tuning script for rkisp1 that uses libtuning. So far it only\nsupports LSC.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n---\nChanges in v4:\n- s/ALSC/LSC/\n- Remove the debug parameter from the tuning script, as it will be moved\n  to cli argument\n\nChanges in v3:\n- cosmetic changes / fix style\n- add __main__ guard\n- rename ALSC to LSC\n\nChanges in v2:\n- add SPDX and copyright\n- s/average_functions/average/\n- update the script to work with the new rkisp1 alsc module\n\nv1:\nThis won't run as we're missing the necessary parser and generator for\nyaml, parabolic gradient support, and multiple green support in the LSC\nmodule, hence the DNI. As soon as those are added though, this *should*\nwork.\n---\n utils/tuning/rkisp1.py | 40 ++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 40 insertions(+)\n create mode 100755 utils/tuning/rkisp1.py","diff":"diff --git a/utils/tuning/rkisp1.py b/utils/tuning/rkisp1.py\nnew file mode 100755\nindex 00000000..1cea6ddb\n--- /dev/null\n+++ b/utils/tuning/rkisp1.py\n@@ -0,0 +1,40 @@\n+#!/usr/bin/env python3\n+# SPDX-License-Identifier: GPL-2.0-or-later\n+#\n+# Copyright (C) 2022, Paul Elder <paul.elder@ideasonboard.com>\n+#\n+# rkisp1.py - Tuning script for rkisp1\n+\n+import sys\n+\n+import libtuning as lt\n+from libtuning.parsers import YamlParser\n+from libtuning.generators import YamlOutput\n+from libtuning.modules.lsc import LSCRkISP1\n+\n+tuner = lt.Tuner('RkISP1')\n+tuner.add(LSCRkISP1(\n+          debug=[lt.Debug.Plot],\n+          # This is for the actual LSC tuning, and is part of the base LSC\n+          # module. rkisp1's table sector sizes (16x16 programmed as mirrored\n+          # 8x8) are separate, and is hardcoded in its specific LSC tuning\n+          # module.\n+          sector_shape=(17, 17),\n+\n+          sector_x_gradient=lt.gradient.Linear(lt.Remainder.DistributeFront),\n+          sector_y_gradient=lt.gradient.Linear(lt.Remainder.DistributeFront),\n+\n+          # This is the function that will be used to average the pixels in\n+          # each sector. This can also be a custom function.\n+          sector_average_function=lt.average.Mean(),\n+\n+          # This is the function that will be used to smooth the color ratio\n+          # values.  This can also be a custom function.\n+          smoothing_function=lt.smoothing.MedianBlur(3),\n+          ))\n+tuner.set_input_parser(YamlParser())\n+tuner.set_output_formatter(YamlOutput())\n+tuner.set_output_order([LSCRkISP1])\n+\n+if __name__ == '__main__':\n+    sys.exit(tuner.run(sys.argv))\n","prefixes":["libcamera-devel","v4","12/12"]}