Show a patch.

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

{
    "id": 11193,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/11193/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/11193/",
    "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": "<20210208150738.2293520-6-naush@raspberrypi.com>",
    "date": "2021-02-08T15:07:37",
    "name": "[libcamera-devel,v6,5/6] ipa: raspberrypi: Add a DenoiseAlgorithm class to the Controller",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "3491629d22f45b8b00ba77d52439b762c63342ae",
    "submitter": {
        "id": 34,
        "url": "https://patchwork.libcamera.org/api/1.1/people/34/?format=api",
        "name": "Naushir Patuck",
        "email": "naush@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/11193/mbox/",
    "series": [
        {
            "id": 1666,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1666/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1666",
            "date": "2021-02-08T15:07:32",
            "name": "Raspberry Pi: Colour denoise",
            "version": 6,
            "mbox": "https://patchwork.libcamera.org/series/1666/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/11193/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/11193/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 396D2BD160\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  8 Feb 2021 15:08:12 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0607760D2A;\n\tMon,  8 Feb 2021 16:08:12 +0100 (CET)",
            "from mail-wr1-x433.google.com (mail-wr1-x433.google.com\n\t[IPv6:2a00:1450:4864:20::433])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EC57160D21\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  8 Feb 2021 16:08:10 +0100 (CET)",
            "by mail-wr1-x433.google.com with SMTP id u14so17570041wri.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 08 Feb 2021 07:08:10 -0800 (PST)",
            "from naush-laptop.pitowers.org (cust51-dsl50.idnet.net.\n\t[212.69.50.51]) by smtp.gmail.com with ESMTPSA id\n\ta17sm31261389wrx.63.2021.02.08.07.08.09\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 08 Feb 2021 07:08:09 -0800 (PST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"oynFR6Wy\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=7Eib4zDANaA6JZXba1QgQGfirur2ZBzw8jt8Oj+tjQE=;\n\tb=oynFR6WyE3i9iD9IZoL3/6ltKptPrDd7O2jAjXKjMTLLRKc/wenZWisPhtueVR7PKS\n\tnkfAgWqwfR9nUbPcada5baf5wzpp0lVupUVV3JA1+AXtJ3CTXXsrLoqtAUoScOOOTeJM\n\ti21McJanX2srNt7S3mR8qNKExs6G3gHQBex0DVIzYblUPy5xGLMAT3JDHS3THw0cSbjn\n\tGfWrXCPrasFFk70qlk8P3VriBbPZeecQR9IJgZDlNLVtwfWb6CVGmHQVUiXuX3FviHsE\n\t669ar94OfrVulpcPKzCysvl/7AFZ14okM3MQhykZyD+nbKdkYUxd2VX31QDRvz/WpOD3\n\tYnHg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\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=7Eib4zDANaA6JZXba1QgQGfirur2ZBzw8jt8Oj+tjQE=;\n\tb=lB9QPeA0zGXxgtQtyBMSOwkpIeUPYoY3RcTsAOLGgHmjr6oyMVu9WuzmtPPo5ra0bT\n\tnN6EmTzkNCpVsGOOfI68RUozQ9I7oKMrPb2jZzRcihr1X1S+DF/d7lTIuXf7soUrLxpZ\n\tqTIBSFTr2udLT0DE2wu2YrJGFBw8mb5UX4/jsmAuqq2vq9zMn/Ym/Rg5rQfKWc8CX25O\n\tC4mS2pdlwTvaHWb5r/tjvrwzurlpP+WgjLXn8FjJpmF4UXTQeNsmIcQQ9EZfEglo/Tma\n\tIxTKdQqEaHhmqASFy1TfP/OEOtX2xTo1yOwKVvRhhTSo3/qGrQ+W+W10/VQdVZRmvdFK\n\tUYSA==",
        "X-Gm-Message-State": "AOAM532YLzorIsVg2T+45X3U121uSGSv5bT54W8JOelivDbcnYgVlxnM\n\t+ikHn2ctKANjNk8/y8g83Ktc02sjt7ZwpkUQ",
        "X-Google-Smtp-Source": "ABdhPJzecF1i7owsGGUyogsWJGt3OhT0zON6NmQok6WaByx8096mcv/fWS6whK1UPDcrcUFpU+GDzw==",
        "X-Received": "by 2002:adf:d852:: with SMTP id\n\tk18mr20688998wrl.262.1612796890416; \n\tMon, 08 Feb 2021 07:08:10 -0800 (PST)",
        "From": "Naushir Patuck <naush@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon,  8 Feb 2021 15:07:37 +0000",
        "Message-Id": "<20210208150738.2293520-6-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20210208150738.2293520-1-naush@raspberrypi.com>",
        "References": "<20210208150738.2293520-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v6 5/6] ipa: raspberrypi: Add a\n\tDenoiseAlgorithm class to the Controller",
        "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>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "This denoise algorithm class will be used to pass in the user requested\ndenoise operating mode to the controller. The existing Denoise\ncontroller will derive from this new DenoiseAlgorithm class.\n\nAdd a denoise mode field in the denoise status metadata object for the\nIPA to use when configuring the ISP.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n .../controller/denoise_algorithm.hpp          | 23 +++++++++++++++++++\n .../raspberrypi/controller/denoise_status.h   |  1 +\n src/ipa/raspberrypi/controller/rpi/sdn.cpp    | 11 +++++++--\n src/ipa/raspberrypi/controller/rpi/sdn.hpp    |  5 +++-\n 4 files changed, 37 insertions(+), 3 deletions(-)\n create mode 100644 src/ipa/raspberrypi/controller/denoise_algorithm.hpp",
    "diff": "diff --git a/src/ipa/raspberrypi/controller/denoise_algorithm.hpp b/src/ipa/raspberrypi/controller/denoise_algorithm.hpp\nnew file mode 100644\nindex 000000000000..39fcd7e94df2\n--- /dev/null\n+++ b/src/ipa/raspberrypi/controller/denoise_algorithm.hpp\n@@ -0,0 +1,23 @@\n+/* SPDX-License-Identifier: BSD-2-Clause */\n+/*\n+ * Copyright (C) 2021, Raspberry Pi (Trading) Limited\n+ *\n+ * denoise.hpp - Denoise control algorithm interface\n+ */\n+#pragma once\n+\n+#include \"algorithm.hpp\"\n+\n+namespace RPiController {\n+\n+enum class DenoiseMode { Off, ColourOff, ColourFast, ColourHighQuality };\n+\n+class DenoiseAlgorithm : public Algorithm\n+{\n+public:\n+\tDenoiseAlgorithm(Controller *controller) : Algorithm(controller) {}\n+\t// A Denoise algorithm must provide the following:\n+\tvirtual void SetMode(DenoiseMode mode) = 0;\n+};\n+\n+} // namespace RPiController\ndiff --git a/src/ipa/raspberrypi/controller/denoise_status.h b/src/ipa/raspberrypi/controller/denoise_status.h\nindex 94f5df200ffd..4f1ca71e5f5a 100644\n--- a/src/ipa/raspberrypi/controller/denoise_status.h\n+++ b/src/ipa/raspberrypi/controller/denoise_status.h\n@@ -16,6 +16,7 @@ struct DenoiseStatus {\n \tdouble noise_constant;\n \tdouble noise_slope;\n \tdouble strength;\n+\tunsigned int mode;\n };\n \n #ifdef __cplusplus\ndiff --git a/src/ipa/raspberrypi/controller/rpi/sdn.cpp b/src/ipa/raspberrypi/controller/rpi/sdn.cpp\nindex ef84a2dcbf86..899a38417695 100644\n--- a/src/ipa/raspberrypi/controller/rpi/sdn.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/sdn.cpp\n@@ -1,6 +1,6 @@\n /* SPDX-License-Identifier: BSD-2-Clause */\n /*\n- * Copyright (C) 2019, Raspberry Pi (Trading) Limited\n+ * Copyright (C) 2019-2021, Raspberry Pi (Trading) Limited\n  *\n  * sdn.cpp - SDN (spatial denoise) control algorithm\n  */\n@@ -23,7 +23,7 @@ LOG_DEFINE_CATEGORY(RPiSdn)\n #define NAME \"rpi.sdn\"\n \n Sdn::Sdn(Controller *controller)\n-\t: Algorithm(controller)\n+\t: DenoiseAlgorithm(controller), mode_(DenoiseMode::ColourOff)\n {\n }\n \n@@ -53,6 +53,7 @@ void Sdn::Prepare(Metadata *image_metadata)\n \tstatus.noise_constant = noise_status.noise_constant * deviation_;\n \tstatus.noise_slope = noise_status.noise_slope * deviation_;\n \tstatus.strength = strength_;\n+\tstatus.mode = static_cast<std::underlying_type_t<DenoiseMode>>(mode_);\n \timage_metadata->Set(\"sdn.status\", status);\n \tLOG(RPiSdn, Debug)\n \t\t<< \"programmed constant \" << status.noise_constant\n@@ -60,6 +61,12 @@ void Sdn::Prepare(Metadata *image_metadata)\n \t\t<< \" strength \" << status.strength;\n }\n \n+void Sdn::SetMode(DenoiseMode mode)\n+{\n+\t// We only distinguish between off and all other modes.\n+\tmode_ = mode;\n+}\n+\n // Register algorithm with the system.\n static Algorithm *Create(Controller *controller)\n {\ndiff --git a/src/ipa/raspberrypi/controller/rpi/sdn.hpp b/src/ipa/raspberrypi/controller/rpi/sdn.hpp\nindex 486c000d7b77..2371ce04163f 100644\n--- a/src/ipa/raspberrypi/controller/rpi/sdn.hpp\n+++ b/src/ipa/raspberrypi/controller/rpi/sdn.hpp\n@@ -7,12 +7,13 @@\n #pragma once\n \n #include \"../algorithm.hpp\"\n+#include \"../denoise_algorithm.hpp\"\n \n namespace RPiController {\n \n // Algorithm to calculate correct spatial denoise (SDN) settings.\n \n-class Sdn : public Algorithm\n+class Sdn : public DenoiseAlgorithm\n {\n public:\n \tSdn(Controller *controller = NULL);\n@@ -20,10 +21,12 @@ public:\n \tvoid Read(boost::property_tree::ptree const &params) override;\n \tvoid Initialise() override;\n \tvoid Prepare(Metadata *image_metadata) override;\n+\tvoid SetMode(DenoiseMode mode) override;\n \n private:\n \tdouble deviation_;\n \tdouble strength_;\n+\tDenoiseMode mode_;\n };\n \n } // namespace RPiController\n",
    "prefixes": [
        "libcamera-devel",
        "v6",
        "5/6"
    ]
}