Show a patch.

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

{
    "id": 10908,
    "url": "https://patchwork.libcamera.org/api/patches/10908/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/10908/",
    "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": "<20210120083449.642418-5-naush@raspberrypi.com>",
    "date": "2021-01-20T08:34:48",
    "name": "[libcamera-devel,4/5] ipa: raspberrypi: Add a DenoiseAlgorithm class to the Controller",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "788c5d185b1094eab6f05a3ed81163ab760dc32b",
    "submitter": {
        "id": 34,
        "url": "https://patchwork.libcamera.org/api/people/34/?format=api",
        "name": "Naushir Patuck",
        "email": "naush@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/10908/mbox/",
    "series": [
        {
            "id": 1587,
            "url": "https://patchwork.libcamera.org/api/series/1587/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1587",
            "date": "2021-01-20T08:34:44",
            "name": "Raspberry Pi: Colour denoise",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1587/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/10908/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/10908/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 26C61C0F2B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 20 Jan 2021 08:35:02 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EB26568186;\n\tWed, 20 Jan 2021 09:35:01 +0100 (CET)",
            "from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com\n\t[IPv6:2a00:1450:4864:20::32b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 240C368181\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 20 Jan 2021 09:34:59 +0100 (CET)",
            "by mail-wm1-x32b.google.com with SMTP id y187so2031160wmd.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 20 Jan 2021 00:34:59 -0800 (PST)",
            "from naushir-VirtualBox.patuck.local ([88.97.76.4])\n\tby smtp.gmail.com with ESMTPSA id\n\t33sm2809284wrn.35.2021.01.20.00.34.57\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 20 Jan 2021 00:34:57 -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=\"hyHbz7Kb\"; 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=iQ91Dj6nDbxti4/IPz0u4olicXcOg/0dvJWfHEwzSnk=;\n\tb=hyHbz7KbPPIyVC45GOTeZ7PJxsCiWB6h7f5eGs6pN43jI9AWMtwyHmTUiCRYMK/RHY\n\teBAHJJWaEDtM8a9EVvwzHE46ZF2Jmv2z8I383Fi7I38IMBD2QpeulNb9RV8ulhr9KY39\n\tB4ruwZyqYKA7kBpA7iSJ3MkkJqsMpUCEgoyJrMngo933llR6xalA8PBApEF6WzbFw6pg\n\t/DmyvOkyfqsVMeJ/c/aHpL1Lm0An02D+Qj9fuVaWEK6XUYHQ0FKp2AAK+m6aC2ttkgIX\n\tRO0rOcf8hNQpEvuCfFZY3e/b4N44Erdnk/aljVeKPyh3wD8czQQ0KSDlX7cYtJ61J9Lt\n\tVBuQ==",
        "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=iQ91Dj6nDbxti4/IPz0u4olicXcOg/0dvJWfHEwzSnk=;\n\tb=fhQWZK0fxQ/TF5oIFnC357KDjizVJWWQlaYK1dizmpjC5H3/LRH8qxOsy5K51jlSvm\n\tJZ7tSP4lq0zfM8UG9MXmAvfPzFJ2A7UYCb0yw4f0EI/1WoTcmo9VI5VOeJb/Lzpolf4l\n\tEq447aDo9bqEh9sZWRpnDWgYGTAMtWvf1GH+uXCnboBTyg3rFdvD+wz1kX8BCYVPmquw\n\tUKcjt+CV1p9z0+Zt5fmVBWZz5l+PY1KLTgqcUKFY1QOMbWi0/f9s8LdOnJ4Ei2rJmv+M\n\tQcGinGWZItb3MylbS7V15oFvnhTDnV2KHgNA7adl83vXb8XAZUxSh4P6rrRFo6yJ0pkj\n\tjDqQ==",
        "X-Gm-Message-State": "AOAM533epRU6u7pTyZMrdkz8BVWg3txlLLFXRGQoxDSVPDsbs6qF5Nv2\n\tJUVC+P/Yj6/P2/3WoTXCnjUNf7H8SyONrg==",
        "X-Google-Smtp-Source": "ABdhPJyVuiOrGvZ4oyMAp8RNK+EliQPSw/cv0sqYGUHYA3wNTLlv1UGd2Hg7JK9ulz15XI6QvlB0Gw==",
        "X-Received": "by 2002:a1c:8095:: with SMTP id\n\tb143mr3121604wmd.71.1611131698550; \n\tWed, 20 Jan 2021 00:34:58 -0800 (PST)",
        "From": "Naushir Patuck <naush@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 20 Jan 2021 08:34:48 +0000",
        "Message-Id": "<20210120083449.642418-5-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20210120083449.642418-1-naush@raspberrypi.com>",
        "References": "<20210120083449.642418-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH 4/5] 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>\n---\n .../controller/denoise_algorithm.hpp          | 23 +++++++++++++++++++\n src/ipa/raspberrypi/controller/rpi/sdn.cpp    | 11 +++++++--\n src/ipa/raspberrypi/controller/rpi/sdn.hpp    |  5 +++-\n src/ipa/raspberrypi/controller/sdn_status.h   |  1 +\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..05b7d46dad85\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 (spatial and colour) control algorithm interface\n+ */\n+#pragma once\n+\n+#include \"algorithm.hpp\"\n+\n+namespace RPiController {\n+\n+enum DenoiseMode { Off, Fast, HighQuality };\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/rpi/sdn.cpp b/src/ipa/raspberrypi/controller/rpi/sdn.cpp\nindex aa82830b02b4..3a600e07b2f3 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@@ -18,7 +18,7 @@ using namespace RPiController;\n #define NAME \"rpi.sdn\"\n \n Sdn::Sdn(Controller *controller)\n-\t: Algorithm(controller)\n+\t: DenoiseAlgorithm(controller), mode_(DenoiseMode::Fast)\n {\n }\n \n@@ -48,6 +48,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 = mode_;\n \timage_metadata->Set(\"sdn.status\", status);\n \tRPI_LOG(\"Sdn: programmed constant \" << status.noise_constant\n \t\t\t\t\t    << \" slope \" << status.noise_slope\n@@ -55,6 +56,12 @@ void Sdn::Prepare(Metadata *image_metadata)\n \t\t\t\t\t    << 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\ndiff --git a/src/ipa/raspberrypi/controller/sdn_status.h b/src/ipa/raspberrypi/controller/sdn_status.h\nindex 871e0b62af1f..29f2a68aabff 100644\n--- a/src/ipa/raspberrypi/controller/sdn_status.h\n+++ b/src/ipa/raspberrypi/controller/sdn_status.h\n@@ -16,6 +16,7 @@ struct SdnStatus {\n \tdouble noise_constant;\n \tdouble noise_slope;\n \tdouble strength;\n+\tunsigned int mode;\n };\n \n #ifdef __cplusplus\n",
    "prefixes": [
        "libcamera-devel",
        "4/5"
    ]
}