Patch Detail
Show a patch.
GET /api/1.1/patches/22893/?format=api
{ "id": 22893, "url": "https://patchwork.libcamera.org/api/1.1/patches/22893/?format=api", "web_url": "https://patchwork.libcamera.org/patch/22893/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/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": "<20250227105733.187611-11-keke.li@amlogic.com>", "date": "2025-02-27T10:57:32", "name": "[v3,10/11] ipa: c3-isp: Add Post Gamma Algorithm", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "f76552cf1e87a5080fab85f809df16e7a644d345", "submitter": { "id": 217, "url": "https://patchwork.libcamera.org/api/1.1/people/217/?format=api", "name": "Keke Li", "email": "keke.li@amlogic.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/22893/mbox/", "series": [ { "id": 5027, "url": "https://patchwork.libcamera.org/api/1.1/series/5027/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5027", "date": "2025-02-27T10:57:22", "name": "Add Amlogic C3 ISP pipeline handler and IPA", "version": 3, "mbox": "https://patchwork.libcamera.org/series/5027/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/22893/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/22893/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 A7C67BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 27 Feb 2025 11:00:14 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 418E168757;\n\tThu, 27 Feb 2025 12:00:14 +0100 (CET)", "from mail-sh.amlogic.com (unknown [58.32.228.46])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 259BC60322\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 27 Feb 2025 12:00:13 +0100 (CET)", "from droid10.amlogic.com (10.18.11.213) by mail-sh.amlogic.com\n\t(10.18.11.5) with Microsoft SMTP Server id 15.1.2507.39;\n\tThu, 27 Feb 2025 19:00:11 +0800" ], "From": "Keke Li <keke.li@amlogic.com>", "To": "<libcamera-devel@lists.libcamera.org>", "CC": "<kieran.bingham@ideasonboard.com>, <laurent.pinchart@ideasonboard.com>, \n\t<dan.scally@ideasonboard.com>, Keke Li <keke.li@amlogic.com>", "Subject": "[PATCH v3 10/11] ipa: c3-isp: Add Post Gamma Algorithm", "Date": "Thu, 27 Feb 2025 18:57:32 +0800", "Message-ID": "<20250227105733.187611-11-keke.li@amlogic.com>", "X-Mailer": "git-send-email 2.29.0", "In-Reply-To": "<20250227105733.187611-1-keke.li@amlogic.com>", "References": "<20250227105733.187611-1-keke.li@amlogic.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-Originating-IP": "[10.18.11.213]", "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 new Post Gamma algorithm.\n\nSigned-off-by: Keke Li <keke.li@amlogic.com>\n---\n src/ipa/c3-isp/algorithms/meson.build | 1 +\n src/ipa/c3-isp/algorithms/post_gamma.cpp | 65 ++++++++++++++++++++++++\n src/ipa/c3-isp/algorithms/post_gamma.h | 33 ++++++++++++\n 3 files changed, 99 insertions(+)\n create mode 100644 src/ipa/c3-isp/algorithms/post_gamma.cpp\n create mode 100644 src/ipa/c3-isp/algorithms/post_gamma.h", "diff": "diff --git a/src/ipa/c3-isp/algorithms/meson.build b/src/ipa/c3-isp/algorithms/meson.build\nindex 5e7e56db..57600f12 100644\n--- a/src/ipa/c3-isp/algorithms/meson.build\n+++ b/src/ipa/c3-isp/algorithms/meson.build\n@@ -6,4 +6,5 @@ c3isp_ipa_algorithms = files([\n 'blc.cpp',\n 'ccm.cpp',\n 'csc.cpp',\n+ 'post_gamma.cpp',\n ])\ndiff --git a/src/ipa/c3-isp/algorithms/post_gamma.cpp b/src/ipa/c3-isp/algorithms/post_gamma.cpp\nnew file mode 100644\nindex 00000000..f8c1a1da\n--- /dev/null\n+++ b/src/ipa/c3-isp/algorithms/post_gamma.cpp\n@@ -0,0 +1,65 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2024, Amlogic\n+ *\n+ * C3ISP Post Gamma control\n+ */\n+\n+#include \"post_gamma.h\"\n+\n+#include <libcamera/base/log.h>\n+\n+/**\n+ * \\file post_gamma.h\n+ */\n+\n+namespace libcamera {\n+\n+namespace ipa::c3isp::algorithms {\n+\n+/**\n+ * \\class PostGamma\n+ * \\brief A post gamma algorithm\n+ */\n+\n+LOG_DEFINE_CATEGORY(C3ISPPostGamma)\n+\n+PostGamma::PostGamma()\n+{\n+}\n+\n+/**\n+ * \\copydoc libcamera::ipa::Algorithm::init\n+ */\n+int PostGamma::init([[maybe_unused]] IPAContext &context, const YamlObject &tuningData)\n+{\n+\tgammaLut_ = tuningData[\"gammaLut\"].getList<uint16_t>().value_or(std::vector<uint16_t>{});\n+\tif (gammaLut_.size() != 129) {\n+\t\tLOG(C3ISPPostGamma, Error) << \"Invalid gamma Look-up table size\";\n+\t\treturn -EINVAL;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+/**\n+ * \\copydoc libcamera::ipa::Algorithm::prepare\n+ */\n+void PostGamma::prepare([[maybe_unused]] IPAContext &context,\n+\t\t\t[[maybe_unused]] const uint32_t frame,\n+\t\t\t[[maybe_unused]] IPAFrameContext &frameContext,\n+\t\t\tC3ISPParams *params)\n+{\n+\tauto PostGammaCfg = params->block<BlockType::PostGamma>();\n+\tPostGammaCfg.setEnabled(C3_ISP_PARAMS_BLOCK_FL_ENABLE);\n+\n+\tfor (unsigned int i = 0; i < 129; i++) {\n+\t\tPostGammaCfg->lut[i] = gammaLut_[i];\n+\t}\n+}\n+\n+REGISTER_IPA_ALGORITHM(PostGamma, \"PostGamma\")\n+\n+} /* namespace ipa::c3isp::algorithms */\n+\n+} /* namespace libcamera */\ndiff --git a/src/ipa/c3-isp/algorithms/post_gamma.h b/src/ipa/c3-isp/algorithms/post_gamma.h\nnew file mode 100644\nindex 00000000..44d8f9db\n--- /dev/null\n+++ b/src/ipa/c3-isp/algorithms/post_gamma.h\n@@ -0,0 +1,33 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2024, Amlogic\n+ *\n+ * C3ISP Post Gamma control\n+ */\n+\n+#pragma once\n+\n+#include \"algorithm.h\"\n+\n+namespace libcamera {\n+\n+namespace ipa::c3isp::algorithms {\n+\n+class PostGamma : public Algorithm\n+{\n+public:\n+\tPostGamma();\n+\t~PostGamma() = default;\n+\n+\tint init(IPAContext &context, const YamlObject &tuningData) override;\n+\tvoid prepare(IPAContext &context, const uint32_t frame,\n+\t\t IPAFrameContext &frameContext,\n+\t\t C3ISPParams *params) override;\n+\n+private:\n+\tstd::vector<uint16_t> gammaLut_;\n+};\n+\n+} /* namespace ipa::c3isp::algorithms */\n+\n+} /* namespace libcamera */\n", "prefixes": [ "v3", "10/11" ] }