Show a patch.

GET /api/patches/16836/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 16836,
    "url": "https://patchwork.libcamera.org/api/patches/16836/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/16836/",
    "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": "<20220727084052.590421-6-fsylvestre@baylibre.com>",
    "date": "2022-07-27T08:40:52",
    "name": "[libcamera-devel,v4,5/5] ipa: rkisp1: Add support of Defect Pixel Cluster Correction control",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "bdd7db19ccb5c35a1c7b0464eca07ddea9652da3",
    "submitter": {
        "id": 123,
        "url": "https://patchwork.libcamera.org/api/people/123/?format=api",
        "name": "Florian Sylvestre",
        "email": "fsylvestre@baylibre.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/16836/mbox/",
    "series": [
        {
            "id": 3334,
            "url": "https://patchwork.libcamera.org/api/series/3334/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3334",
            "date": "2022-07-27T08:40:47",
            "name": "Add GSL, LSC and DPCC tuning support for rkisp1",
            "version": 4,
            "mbox": "https://patchwork.libcamera.org/series/3334/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/16836/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/16836/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 AD2CDBE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 27 Jul 2022 08:41:08 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6515563311;\n\tWed, 27 Jul 2022 10:41:08 +0200 (CEST)",
            "from mail-wr1-x432.google.com (mail-wr1-x432.google.com\n\t[IPv6:2a00:1450:4864:20::432])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0AFF16331F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Jul 2022 10:41:04 +0200 (CEST)",
            "by mail-wr1-x432.google.com with SMTP id v17so4257011wrr.10\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Jul 2022 01:41:04 -0700 (PDT)",
            "from BL087.. ([2a01:e34:eea9:e630:5810:316e:87c:fc17])\n\tby smtp.gmail.com with ESMTPSA id\n\t16-20020a05600c241000b003a2f6367049sm1464275wmp.48.2022.07.27.01.41.02\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 27 Jul 2022 01:41:02 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1658911268;\n\tbh=d3YkYP14ku73OouVQn8d3tVnc8JrjGGKMnwMGOlv/hw=;\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=R7H2gnzRJSVTIhBCPEBwFkwfqIO2/OKoTsqcq2b0d7dZHvqzBYX8dlVT+qKlIeKnc\n\tLIfuaRsTfwa8MZKs10L+SYbPw2nz9ULtk/q4pEveNKXdXhsEL0mO6mRARDqTLilQ6m\n\tqpTp7+6adCcR3zuIBEOXjdqsNVlLHvMPtEj6R0EA0j263EKVV07NoeIaRjxcVOa09W\n\tSCNVXtGzTpBXUa0kv6wkNsW61A++bmHpb4NdJEQ5zy+PeUJiBERetE63nFxHoPUXCT\n\tEdX4RcLX5n6lb7oghksqaLJt1p/yKNlKzktyhCUT1lvSUReQPUver8YZHBYDoisANy\n\tuuwzHD6wEb9wQ==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=baylibre-com.20210112.gappssmtp.com; s=20210112;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=5cfTBfK4Kp1xILgT5+S30JTTM6fLq+q22th1fq/UFWY=;\n\tb=SYv/F11VSI4YEtKg04qSmMS2VSIKwJXwbvdTD064I1tq0MWsvefcvd4cp8Ppue0aMH\n\tYsliJOEP/NoU3BhLgusVLQa9gZZxr3dNyvHe4wFC+SKnOqGilw/dXxsBin7cqB/wLKXJ\n\tPkYV1tlnr2lkgtajwZmhLa2REEQDov/cfh9Qjx4TAabSBWbRnZ6JgCeMJQ5oyW7A/QxY\n\t9EpGKfR0qhbnzeJxMNay985g4mvE0Q4hTW2lRLfQhtEWE9PtuXp4YhsMdtWjSJwgZ1g7\n\t0qwFATxYDYwJ3wPXgDFd9Je2J3UhW6TXDCNKCq1Fpe03oSsR9FwQzVKt7W/0XfgTGVWp\n\t+8Ig=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected)\n\theader.d=baylibre-com.20210112.gappssmtp.com\n\theader.i=@baylibre-com.20210112.gappssmtp.com header.b=\"SYv/F11V\"; \n\tdkim-atps=neutral",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=5cfTBfK4Kp1xILgT5+S30JTTM6fLq+q22th1fq/UFWY=;\n\tb=u6YInyFaZjck8UXse7DR6tdzdLXyvJ6/EYihCZGBs1ZPBNsD0WTl4COr6Lwpi+4Glj\n\tm+LdVo4ZQJ6Yrg3WeRCHaK9q+1NUsUtmixfN+JvaPA8mli49CjU0DgPDbIZgpY4a0QJB\n\t23qo5WVp57GtzTkvE5ZvtYJUHZFo32SUJPNUPseKStARMSl0bQ1B4VsQSHA37iJ6+RN9\n\tyKH0K9VNO8G04GhtkEazXySndCv3cAIVJX/YpUNph4DXJ2XD5tanAaw6GRMXK/ieVtd5\n\tx7PaKfNSdtqdjzhNM8hmaqeo7AsdanDOLT7i0qfqQF1hv7/6YgWl/P1QbRGp3Y4sSunD\n\tnUaw==",
        "X-Gm-Message-State": "AJIora93I1YwgRMd9SrZzX9KuV6QcYHmd7SGctGg0sapf/PPIxO+3Y/i\n\txY+yM26ReHXC3VCa2ERaGAqRgCKrRCibe+O4",
        "X-Google-Smtp-Source": "AGRyM1sgZFxHIPyszz3tZ6e59nOhnmTGW5sNA+dy6PhrKwoTmAECEualnnhb39FQmvVE5XXeHLfzZw==",
        "X-Received": "by 2002:a5d:43c3:0:b0:21e:6a2d:4dc3 with SMTP id\n\tv3-20020a5d43c3000000b0021e6a2d4dc3mr13701118wrr.177.1658911263316; \n\tWed, 27 Jul 2022 01:41:03 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 27 Jul 2022 10:40:52 +0200",
        "Message-Id": "<20220727084052.590421-6-fsylvestre@baylibre.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20220727084052.590421-1-fsylvestre@baylibre.com>",
        "References": "<20220727084052.590421-1-fsylvestre@baylibre.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v4 5/5] ipa: rkisp1: Add support of Defect\n\tPixel Cluster Correction control",
        "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": "Florian Sylvestre via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Florian Sylvestre <fsylvestre@baylibre.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "The Defect Pixel Cluster Correction algorithm is responsible to minimize\nthe impact of defective pixels. The on-the-fly method is actually used,\nbased on coefficient provided by the tuning file.\n\nSigned-off-by: Florian Sylvestre <fsylvestre@baylibre.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/ipa/rkisp1/algorithms/dpcc.cpp    | 254 ++++++++++++++++++++++++++\n src/ipa/rkisp1/algorithms/dpcc.h      |  31 ++++\n src/ipa/rkisp1/algorithms/meson.build |   1 +\n src/ipa/rkisp1/data/ov5640.yaml       |  60 ++++++\n 4 files changed, 346 insertions(+)\n create mode 100644 src/ipa/rkisp1/algorithms/dpcc.cpp\n create mode 100644 src/ipa/rkisp1/algorithms/dpcc.h",
    "diff": "diff --git a/src/ipa/rkisp1/algorithms/dpcc.cpp b/src/ipa/rkisp1/algorithms/dpcc.cpp\nnew file mode 100644\nindex 00000000..69bc651e\n--- /dev/null\n+++ b/src/ipa/rkisp1/algorithms/dpcc.cpp\n@@ -0,0 +1,254 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2021-2022, Ideas On Board\n+ *\n+ * dpcc.cpp - RkISP1 Defect Pixel Cluster Correction control\n+ */\n+\n+#include \"dpcc.h\"\n+\n+#include <libcamera/base/log.h>\n+\n+#include \"libcamera/internal/yaml_parser.h\"\n+\n+#include \"linux/rkisp1-config.h\"\n+\n+/**\n+ * \\file dpcc.h\n+ */\n+\n+namespace libcamera {\n+\n+namespace ipa::rkisp1::algorithms {\n+\n+/**\n+ * \\class DefectPixelClusterCorrection\n+ * \\brief RkISP1 Defect Pixel Cluster Correction control\n+ *\n+ * Depending of the sensor quality, some pixels can be defective and then\n+ * appear significantly brighter or darker than the other pixels.\n+ *\n+ * The Defect Pixel Cluster Correction algorithms is responsible to minimize\n+ * the impact of the pixels. This can be done with algorithms applied at run\n+ * time (on-the-fly method) or with a table of defective pixels. Only the first\n+ * method is supported for the moment.\n+ */\n+\n+LOG_DEFINE_CATEGORY(RkISP1Dpcc)\n+\n+DefectPixelClusterCorrection::DefectPixelClusterCorrection()\n+\t: initialized_(false), config_({})\n+{\n+}\n+\n+/**\n+ * \\copydoc libcamera::ipa::Algorithm::init\n+ */\n+int DefectPixelClusterCorrection::init([[maybe_unused]] IPAContext &context,\n+\t\t\t\t       const YamlObject &tuningData)\n+{\n+\tconfig_.mode = RKISP1_CIF_ISP_DPCC_MODE_STAGE1_ENABLE;\n+\tconfig_.output_mode = RKISP1_CIF_ISP_DPCC_OUTPUT_MODE_STAGE1_INCL_G_CENTER\n+\t\t\t    | RKISP1_CIF_ISP_DPCC_OUTPUT_MODE_STAGE1_INCL_RB_CENTER;\n+\n+\tconfig_.set_use = tuningData[\"fixed-set\"].get<bool>(false)\n+\t\t\t? RKISP1_CIF_ISP_DPCC_SET_USE_STAGE1_USE_FIX_SET : 0;\n+\n+\t/* Get all defined sets to apply (up to 3). */\n+\tconst YamlObject &setsObject = tuningData[\"sets\"];\n+\tif (!setsObject.isList()) {\n+\t\tLOG(RkISP1Dpcc, Error)\n+\t\t\t<< \"'sets' parameter not found in tuning file\";\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (setsObject.size() > RKISP1_CIF_ISP_DPCC_METHODS_MAX) {\n+\t\tLOG(RkISP1Dpcc, Error)\n+\t\t\t<< \"'sets' size in tuning file (\" << setsObject.size()\n+\t\t\t<< \") exceeds the maximum hardware capacity (3)\";\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tfor (std::size_t i = 0; i < setsObject.size(); ++i) {\n+\t\tstruct rkisp1_cif_isp_dpcc_methods_config &method = config_.methods[i];\n+\t\tconst YamlObject &set = setsObject[i];\n+\t\tuint16_t value;\n+\n+\t\t/* Enable set if described in YAML tuning file. */\n+\t\tconfig_.set_use |= 1 << i;\n+\n+\t\t/* PG Method */\n+\t\tconst YamlObject &pgObject = set[\"pg-factor\"];\n+\n+\t\tif (pgObject.contains(\"green\")) {\n+\t\t\tmethod.method |=\n+\t\t\t\tRKISP1_CIF_ISP_DPCC_METHODS_SET_PG_GREEN_ENABLE;\n+\n+\t\t\tvalue = pgObject[\"green\"].get<uint16_t>(0);\n+\t\t\tmethod.pg_fac |= RKISP1_CIF_ISP_DPCC_PG_FAC_G(value);\n+\t\t}\n+\n+\t\tif (pgObject.contains(\"red-blue\")) {\n+\t\t\tmethod.method |=\n+\t\t\t\tRKISP1_CIF_ISP_DPCC_METHODS_SET_PG_RED_BLUE_ENABLE;\n+\n+\t\t\tvalue = pgObject[\"red-blue\"].get<uint16_t>(0);\n+\t\t\tmethod.pg_fac |= RKISP1_CIF_ISP_DPCC_PG_FAC_RB(value);\n+\t\t}\n+\n+\t\t/* RO Method */\n+\t\tconst YamlObject &roObject = set[\"ro-limits\"];\n+\n+\t\tif (roObject.contains(\"green\")) {\n+\t\t\tmethod.method |=\n+\t\t\t\tRKISP1_CIF_ISP_DPCC_METHODS_SET_RO_GREEN_ENABLE;\n+\n+\t\t\tvalue = roObject[\"green\"].get<uint16_t>(0);\n+\t\t\tconfig_.ro_limits |=\n+\t\t\t\tRKISP1_CIF_ISP_DPCC_RO_LIMITS_n_G(i, value);\n+\t\t}\n+\n+\t\tif (roObject.contains(\"red-blue\")) {\n+\t\t\tmethod.method |=\n+\t\t\t\tRKISP1_CIF_ISP_DPCC_METHODS_SET_RO_RED_BLUE_ENABLE;\n+\n+\t\t\tvalue = roObject[\"red-blue\"].get<uint16_t>(0);\n+\t\t\tconfig_.ro_limits |=\n+\t\t\t\tRKISP1_CIF_ISP_DPCC_RO_LIMITS_n_RB(i, value);\n+\t\t}\n+\n+\t\t/* RG Method */\n+\t\tconst YamlObject &rgObject = set[\"rg-factor\"];\n+\t\tmethod.rg_fac = 0;\n+\n+\t\tif (rgObject.contains(\"green\")) {\n+\t\t\tmethod.method |=\n+\t\t\t\tRKISP1_CIF_ISP_DPCC_METHODS_SET_RG_GREEN_ENABLE;\n+\n+\t\t\tvalue = rgObject[\"green\"].get<uint16_t>(0);\n+\t\t\tmethod.rg_fac |= RKISP1_CIF_ISP_DPCC_RG_FAC_G(value);\n+\t\t}\n+\n+\t\tif (rgObject.contains(\"red-blue\")) {\n+\t\t\tmethod.method |=\n+\t\t\t\tRKISP1_CIF_ISP_DPCC_METHODS_SET_RG_RED_BLUE_ENABLE;\n+\n+\t\t\tvalue = rgObject[\"red-blue\"].get<uint16_t>(0);\n+\t\t\tmethod.rg_fac |= RKISP1_CIF_ISP_DPCC_RG_FAC_RB(value);\n+\t\t}\n+\n+\t\t/* RND Method */\n+\t\tconst YamlObject &rndOffsetsObject = set[\"rnd-offsets\"];\n+\n+\t\tif (rndOffsetsObject.contains(\"green\")) {\n+\t\t\tmethod.method |=\n+\t\t\t\tRKISP1_CIF_ISP_DPCC_METHODS_SET_RND_GREEN_ENABLE;\n+\n+\t\t\tvalue = rndOffsetsObject[\"green\"].get<uint16_t>(0);\n+\t\t\tconfig_.rnd_offs |=\n+\t\t\t\tRKISP1_CIF_ISP_DPCC_RND_OFFS_n_G(i, value);\n+\t\t}\n+\n+\t\tif (rndOffsetsObject.contains(\"red-blue\")) {\n+\t\t\tmethod.method |=\n+\t\t\t\tRKISP1_CIF_ISP_DPCC_METHODS_SET_RND_RED_BLUE_ENABLE;\n+\n+\t\t\tvalue = rndOffsetsObject[\"red-blue\"].get<uint16_t>(0);\n+\t\t\tconfig_.rnd_offs |=\n+\t\t\t\tRKISP1_CIF_ISP_DPCC_RND_OFFS_n_RB(i, value);\n+\t\t}\n+\n+\t\tconst YamlObject &rndThresholdObject = set[\"rnd-threshold\"];\n+\t\tmethod.rnd_thresh = 0;\n+\n+\t\tif (rndThresholdObject.contains(\"green\")) {\n+\t\t\tmethod.method |=\n+\t\t\t\tRKISP1_CIF_ISP_DPCC_METHODS_SET_RND_GREEN_ENABLE;\n+\n+\t\t\tvalue = rndThresholdObject[\"green\"].get<uint16_t>(0);\n+\t\t\tmethod.rnd_thresh |=\n+\t\t\t\tRKISP1_CIF_ISP_DPCC_RND_THRESH_G(value);\n+\t\t}\n+\n+\t\tif (rndThresholdObject.contains(\"red-blue\")) {\n+\t\t\tmethod.method |=\n+\t\t\t\tRKISP1_CIF_ISP_DPCC_METHODS_SET_RND_RED_BLUE_ENABLE;\n+\n+\t\t\tvalue = rndThresholdObject[\"red-blue\"].get<uint16_t>(0);\n+\t\t\tmethod.rnd_thresh |=\n+\t\t\t\tRKISP1_CIF_ISP_DPCC_RND_THRESH_RB(value);\n+\t\t}\n+\n+\t\t/* LC Method */\n+\t\tconst YamlObject &lcThresholdObject = set[\"line-threshold\"];\n+\t\tmethod.line_thresh = 0;\n+\n+\t\tif (lcThresholdObject.contains(\"green\")) {\n+\t\t\tmethod.method |=\n+\t\t\t\tRKISP1_CIF_ISP_DPCC_METHODS_SET_LC_GREEN_ENABLE;\n+\n+\t\t\tvalue = lcThresholdObject[\"green\"].get<uint16_t>(0);\n+\t\t\tmethod.line_thresh |=\n+\t\t\t\tRKISP1_CIF_ISP_DPCC_LINE_THRESH_G(value);\n+\t\t}\n+\n+\t\tif (lcThresholdObject.contains(\"red-blue\")) {\n+\t\t\tmethod.method |=\n+\t\t\t\tRKISP1_CIF_ISP_DPCC_METHODS_SET_LC_RED_BLUE_ENABLE;\n+\n+\t\t\tvalue = lcThresholdObject[\"red-blue\"].get<uint16_t>(0);\n+\t\t\tmethod.line_thresh |=\n+\t\t\t\tRKISP1_CIF_ISP_DPCC_LINE_THRESH_RB(value);\n+\t\t}\n+\n+\t\tconst YamlObject &lcTMadFactorObject = set[\"line-mad-factor\"];\n+\t\tmethod.line_mad_fac = 0;\n+\n+\t\tif (lcTMadFactorObject.contains(\"green\")) {\n+\t\t\tmethod.method |=\n+\t\t\t\tRKISP1_CIF_ISP_DPCC_METHODS_SET_LC_GREEN_ENABLE;\n+\n+\t\t\tvalue = lcTMadFactorObject[\"green\"].get<uint16_t>(0);\n+\t\t\tmethod.line_mad_fac |=\n+\t\t\t\tRKISP1_CIF_ISP_DPCC_LINE_MAD_FAC_G(value);\n+\t\t}\n+\n+\t\tif (lcTMadFactorObject.contains(\"red-blue\")) {\n+\t\t\tmethod.method |=\n+\t\t\t\tRKISP1_CIF_ISP_DPCC_METHODS_SET_LC_RED_BLUE_ENABLE;\n+\n+\t\t\tvalue = lcTMadFactorObject[\"red-blue\"].get<uint16_t>(0);\n+\t\t\tmethod.line_mad_fac |=\n+\t\t\t\tRKISP1_CIF_ISP_DPCC_LINE_MAD_FAC_RB(value);\n+\t\t}\n+\t}\n+\n+\tinitialized_ = true;\n+\n+\treturn 0;\n+}\n+\n+/**\n+ * \\copydoc libcamera::ipa::Algorithm::prepare\n+ */\n+void DefectPixelClusterCorrection::prepare(IPAContext &context,\n+\t\t\t\t\t   rkisp1_params_cfg *params)\n+{\n+\tif (context.frameContext.frameCount > 0)\n+\t\treturn;\n+\n+\tif (!initialized_)\n+\t\treturn;\n+\n+\tparams->others.dpcc_config = config_;\n+\n+\tparams->module_en_update |= RKISP1_CIF_ISP_MODULE_DPCC;\n+\tparams->module_ens |= RKISP1_CIF_ISP_MODULE_DPCC;\n+\tparams->module_cfg_update |= RKISP1_CIF_ISP_MODULE_DPCC;\n+}\n+\n+REGISTER_IPA_ALGORITHM(DefectPixelClusterCorrection, \"DefectPixelClusterCorrection\")\n+\n+} /* namespace ipa::rkisp1::algorithms */\n+\n+} /* namespace libcamera */\ndiff --git a/src/ipa/rkisp1/algorithms/dpcc.h b/src/ipa/rkisp1/algorithms/dpcc.h\nnew file mode 100644\nindex 00000000..a363f7be\n--- /dev/null\n+++ b/src/ipa/rkisp1/algorithms/dpcc.h\n@@ -0,0 +1,31 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2021-2022, Ideas On Board\n+ *\n+ * dpcc.h - RkISP1 Defect Pixel Cluster Correction control\n+ */\n+\n+#pragma once\n+\n+#include \"algorithm.h\"\n+\n+namespace libcamera {\n+\n+namespace ipa::rkisp1::algorithms {\n+\n+class DefectPixelClusterCorrection : public Algorithm\n+{\n+public:\n+\tDefectPixelClusterCorrection();\n+\t~DefectPixelClusterCorrection() = default;\n+\n+\tint init(IPAContext &context, const YamlObject &tuningData) override;\n+\tvoid prepare(IPAContext &context, rkisp1_params_cfg *params) override;\n+\n+private:\n+\tbool initialized_;\n+\trkisp1_cif_isp_dpcc_config config_;\n+};\n+\n+} /* namespace ipa::rkisp1::algorithms */\n+} /* namespace libcamera */\ndiff --git a/src/ipa/rkisp1/algorithms/meson.build b/src/ipa/rkisp1/algorithms/meson.build\nindex 64e11dce..87007493 100644\n--- a/src/ipa/rkisp1/algorithms/meson.build\n+++ b/src/ipa/rkisp1/algorithms/meson.build\n@@ -4,6 +4,7 @@ rkisp1_ipa_algorithms = files([\n     'agc.cpp',\n     'awb.cpp',\n     'blc.cpp',\n+    'dpcc.cpp',\n     'gsl.cpp',\n     'lsc.cpp',\n ])\ndiff --git a/src/ipa/rkisp1/data/ov5640.yaml b/src/ipa/rkisp1/data/ov5640.yaml\nindex fa2ae436..2315ec43 100644\n--- a/src/ipa/rkisp1/data/ov5640.yaml\n+++ b/src/ipa/rkisp1/data/ov5640.yaml\n@@ -95,4 +95,64 @@ algorithms:\n             1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n             1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n           ]\n+  - DefectPixelClusterCorrection:\n+      fixed-set: false\n+      sets:\n+        # PG, LC, RO, RND, RG\n+        - line-threshold:\n+            green: 8\n+            red-blue: 8\n+          line-mad-factor:\n+            green: 4\n+            red-blue: 4\n+          pg-factor:\n+            green: 8\n+            red-blue: 8\n+          rnd-threshold:\n+            green: 10\n+            red-blue: 10\n+          rg-factor:\n+            green: 32\n+            red-blue: 32\n+          ro-limits:\n+            green: 1\n+            red-blue: 1\n+          rnd-offsets:\n+            green: 2\n+            red-blue: 2\n+        # PG, LC, RO\n+        - line-threshold:\n+            green: 24\n+            red-blue: 32\n+          line-mad-factor:\n+            green: 16\n+            red-blue: 24\n+          pg-factor:\n+            green: 6\n+            red-blue: 8\n+          ro-limits:\n+            green: 2\n+            red-blue: 2\n+        # PG, LC, RO, RND, RG\n+        - line-threshold:\n+            green: 32\n+            red-blue: 32\n+          line-mad-factor:\n+            green: 4\n+            red-blue: 4\n+          pg-factor:\n+            green: 10\n+            red-blue: 10\n+          rnd-threshold:\n+            green: 6\n+            red-blue: 8\n+          rg-factor:\n+            green: 4\n+            red-blue: 4\n+          ro-limits:\n+            green: 1\n+            red-blue: 2\n+          rnd-offsets:\n+            green: 2\n+            red-blue: 2\n ...\n",
    "prefixes": [
        "libcamera-devel",
        "v4",
        "5/5"
    ]
}