Patch Detail
Show a patch.
GET /api/patches/20143/?format=api
{ "id": 20143, "url": "https://patchwork.libcamera.org/api/patches/20143/?format=api", "web_url": "https://patchwork.libcamera.org/patch/20143/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20240529194251.863689-4-paul.elder@ideasonboard.com>", "date": "2024-05-29T19:42:50", "name": "[v3,3/4] utils: libtuning: modules: Add skeletal CCM module", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "a30dd1e3445f7eab6f564055ac53caf5745d1b52", "submitter": { "id": 17, "url": "https://patchwork.libcamera.org/api/people/17/?format=api", "name": "Paul Elder", "email": "paul.elder@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/20143/mbox/", "series": [ { "id": 4339, "url": "https://patchwork.libcamera.org/api/series/4339/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4339", "date": "2024-05-29T19:42:47", "name": "utils: tuning: Add AGC and CCM", "version": 3, "mbox": "https://patchwork.libcamera.org/series/4339/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/20143/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/20143/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 CE355C32C8\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 29 May 2024 19:44:09 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2BB2B634CA;\n\tWed, 29 May 2024 21:44:09 +0200 (CEST)", "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 475046347E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 29 May 2024 21:44:07 +0200 (CEST)", "from neptunite.hamster-moth.ts.net\n\t(h175-177-049-156.catv02.itscom.jp [175.177.49.156])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 24FB12D5D;\n\tWed, 29 May 2024 21:44:01 +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=\"QXJMVWCC\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1717011843;\n\tbh=9IxEWkZbwQqaizoHJawuveQaiiZwuPXi1L4OgFqTLy4=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=QXJMVWCC0mScOAaLJhWzH/5VHJnCKHottJOCMlBrnudo5UwI6JhYs8aJuS8oP4fYO\n\tObbKJaZLZIBsGPV1L29hlouSd3NFAn9HzpzKnQUN/YzKF4GLcky5T9z21e0dbNEqqm\n\t6rYviiIlNw2aytFCP+pdgILePiymbJkLcdDU8nIE=", "From": "Paul Elder <paul.elder@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Paul Elder <paul.elder@ideasonboard.com>,\n\tDaniel Scally <dan.scally@ideasonboard.com>,\n\tStefan Klug <stefan.klug@ideasonboard.com>", "Subject": "[PATCH v3 3/4] utils: libtuning: modules: Add skeletal CCM module", "Date": "Thu, 30 May 2024 04:42:50 +0900", "Message-Id": "<20240529194251.863689-4-paul.elder@ideasonboard.com>", "X-Mailer": "git-send-email 2.39.2", "In-Reply-To": "<20240529194251.863689-1-paul.elder@ideasonboard.com>", "References": "<20240529194251.863689-1-paul.elder@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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>" }, "content": "Add a skeletal CCM module just so that we can have some CCM tuning\nvalues that we can use to test during development of CCM in the IPAs. As\nrkisp1 is the main target, we only add support for rkisp1 for now.\n\nThe parameters are copied from the hardcoded values in ctt, except for\nthe offsets, which are all set to zero.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\nReviewed-by: Daniel Scally <dan.scally@ideasonboard.com>\nReviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>\n\n---\nChanges in v3:\n- remove the unused compatible string\n- fix the commit message\n\nChanges in v2:\n- move converting floating to fixed point from the tuning script to the\n IPA\n- reorganize the ccm list to mirror the format of lsc\n- add offset vectors\n---\n .../tuning/libtuning/modules/ccm/__init__.py | 6 ++\n utils/tuning/libtuning/modules/ccm/ccm.py | 22 +++++\n utils/tuning/libtuning/modules/ccm/rkisp1.py | 87 +++++++++++++++++++\n 3 files changed, 115 insertions(+)\n create mode 100644 utils/tuning/libtuning/modules/ccm/__init__.py\n create mode 100644 utils/tuning/libtuning/modules/ccm/ccm.py\n create mode 100644 utils/tuning/libtuning/modules/ccm/rkisp1.py", "diff": "diff --git a/utils/tuning/libtuning/modules/ccm/__init__.py b/utils/tuning/libtuning/modules/ccm/__init__.py\nnew file mode 100644\nindex 000000000..322602afe\n--- /dev/null\n+++ b/utils/tuning/libtuning/modules/ccm/__init__.py\n@@ -0,0 +1,6 @@\n+# SPDX-License-Identifier: GPL-2.0-or-later\n+#\n+# Copyright (C) 2024, Paul Elder <paul.elder@ideasonboard.com>\n+\n+from libtuning.modules.ccm.ccm import CCM\n+from libtuning.modules.ccm.rkisp1 import CCMRkISP1\ndiff --git a/utils/tuning/libtuning/modules/ccm/ccm.py b/utils/tuning/libtuning/modules/ccm/ccm.py\nnew file mode 100644\nindex 000000000..7ddf0a8ca\n--- /dev/null\n+++ b/utils/tuning/libtuning/modules/ccm/ccm.py\n@@ -0,0 +1,22 @@\n+# SPDX-License-Identifier: BSD-2-Clause\n+#\n+# Copyright (C) 2019, Raspberry Pi Ltd\n+# Copyright (C) 2024, Paul Elder <paul.elder@ideasonboard.com>\n+\n+from ..module import Module\n+\n+import libtuning as lt\n+import libtuning.utils as utils\n+\n+import numpy as np\n+\n+class CCM(Module):\n+ type = 'ccm'\n+ hr_name = 'CCM (Base)'\n+ out_name = 'GenericCCM'\n+\n+ def __init__(self, *,\n+ debug: list):\n+ super().__init__()\n+\n+ self.debug = debug\ndiff --git a/utils/tuning/libtuning/modules/ccm/rkisp1.py b/utils/tuning/libtuning/modules/ccm/rkisp1.py\nnew file mode 100644\nindex 000000000..fe3d7056b\n--- /dev/null\n+++ b/utils/tuning/libtuning/modules/ccm/rkisp1.py\n@@ -0,0 +1,87 @@\n+# SPDX-License-Identifier: BSD-2-Clause\n+#\n+# Copyright (C) 2019, Raspberry Pi Ltd\n+# Copyright (C) 2024, Paul Elder <paul.elder@ideasonboard.com>\n+#\n+# rkisp1.py - Ccm module for tuning rkisp1\n+\n+from .ccm import CCM\n+\n+import libtuning as lt\n+import libtuning.utils as utils\n+\n+from numbers import Number\n+import numpy as np\n+\n+\n+class CCMRkISP1(CCM):\n+ hr_name = 'Crosstalk Correction (RkISP1)'\n+ out_name = 'Ccm'\n+\n+ def __init__(self, **kwargs):\n+ super().__init__(**kwargs)\n+\n+ # We don't actually need anything from the config file\n+ def validate_config(self, config: dict) -> bool:\n+ return True\n+\n+ def _generate_ccms(self) -> dict:\n+ ccms = [\n+ {\n+ 'ct': 2860,\n+ 'ccm': [ 2.12089, -0.52461, -0.59629,\n+ -0.85342, 2.80445, -0.95103,\n+ -0.26897, -1.14788, 2.41685 ],\n+ 'offsets': [ 0, 0, 0 ]\n+ },\n+\n+ {\n+ 'ct': 2960,\n+ 'ccm': [ 2.26962, -0.54174, -0.72789,\n+ -0.77008, 2.60271, -0.83262,\n+ -0.26036, -1.51254, 2.77289 ],\n+ 'offsets': [ 0, 0, 0 ]\n+ },\n+\n+ {\n+ 'ct': 3603,\n+ 'ccm': [ 2.18644, -0.66148, -0.52496,\n+ -0.77828, 2.69474, -0.91645,\n+ -0.25239, -0.83059, 2.08298 ],\n+ 'offsets': [ 0, 0, 0 ]\n+ },\n+\n+ {\n+ 'ct': 4650,\n+ 'ccm': [ 2.18174, -0.70887, -0.47287,\n+ -0.70196, 2.76426, -1.06231,\n+ -0.25157, -0.71978, 1.97135 ],\n+ 'offsets': [ 0, 0, 0 ]\n+ },\n+\n+ {\n+ 'ct': 5858,\n+ 'ccm': [ 2.32392, -0.88421, -0.43971,\n+ -0.63821, 2.58348, -0.94527,\n+ -0.28541, -0.54112, 1.82653 ],\n+ 'offsets': [ 0, 0, 0 ]\n+ },\n+\n+ {\n+ 'ct': 7580,\n+ 'ccm': [ 2.21175, -0.53242, -0.67933,\n+ -0.57875, 3.07922, -1.50047,\n+ -0.27709, -0.73338, 2.01048 ],\n+ 'offsets': [ 0, 0, 0 ]\n+ },\n+ ]\n+\n+ return ccms\n+\n+ def process(self, config: dict, images: list, outputs: dict) -> dict:\n+ output = {}\n+\n+ output['ccms'] = self._generate_ccms()\n+ # \\todo Debug functionality\n+\n+ return output\n", "prefixes": [ "v3", "3/4" ] }