Show a patch.

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

{
    "id": 10600,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/10600/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/10600/",
    "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": "<20201207180121.6374-4-david.plowman@raspberrypi.com>",
    "date": "2020-12-07T18:01:18",
    "name": "[libcamera-devel,v2,3/6] src: ipa: raspberrypi: agc: Add GetConvergenceFrames method to AWB base class",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "6e6ceb6bd659552544566847ff495801c05eb2e6",
    "submitter": {
        "id": 42,
        "url": "https://patchwork.libcamera.org/api/1.1/people/42/?format=api",
        "name": "David Plowman",
        "email": "david.plowman@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/10600/mbox/",
    "series": [
        {
            "id": 1511,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1511/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1511",
            "date": "2020-12-07T18:01:15",
            "name": "Raspberry Pi AGC: initial frame drop count",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/1511/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/10600/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/10600/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 6F3D9BDB1F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  7 Dec 2020 18:02:15 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 35F1967E6E;\n\tMon,  7 Dec 2020 19:02:15 +0100 (CET)",
            "from mail-ed1-x533.google.com (mail-ed1-x533.google.com\n\t[IPv6:2a00:1450:4864:20::533])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5A74C67E6A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  7 Dec 2020 19:02:14 +0100 (CET)",
            "by mail-ed1-x533.google.com with SMTP id dk8so11818694edb.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 07 Dec 2020 10:02:14 -0800 (PST)",
            "from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72])\n\tby smtp.gmail.com with ESMTPSA id\n\tbe6sm14657977edb.29.2020.12.07.10.02.05\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 07 Dec 2020 10:02:08 -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=\"QKKkQbLB\"; 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=mknaU4XTrtLYRHZO3lNKtJ3aTj6z6MQXh7SDuOwDMTg=;\n\tb=QKKkQbLB4qmjWSRMMi8lNGn1YJRaxfbdMIWRiXR57fn0+o5nhV5c9sBip/rKXlinuI\n\tRwiuJCFO3w1N2qaIzhXjwsYaaSpeQPbxJNQxj3/DBRKQSmiX6GKeAmtuKSm/6i64zwwg\n\tknkdEBBRq+jeQ8jJ2OnidaS+NtGsa7sIaj37K36SRJTtbuALM7ZierEwGAAh9RKLYxdb\n\tR6llxXbKWLfrAuddcp6TrQtwMC5kkt7eEFX0rsV2W4FqKz+N/hD2cn6hTCQWRFkd/+Bx\n\tIhyhyeLXsoVJrJh9v6wHN6FDxbj+IsVt5SrFUYjPHQ8ufUyDvIVkB1sXn5BU+Bd+2tJV\n\tQyUA==",
        "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=mknaU4XTrtLYRHZO3lNKtJ3aTj6z6MQXh7SDuOwDMTg=;\n\tb=bwNfwFixjRhD25yvbdwnTX91FjDIdmFO8POiS4+s1xNQj3KamhId7nLb6CoED4E89G\n\tLAeXJQh46xD9kYcEx2NnaqK5DMuR9iVb2SmjfSr9sxGYtd2uthOF5k+fHI/17NBu4/IQ\n\t+ZfOt8nYtfCooOewAf2pwvYapqGGxVSBkrQhVipnfaZ0i1bDpX3pbRlAa/kMutJ76kdj\n\tTqQ61K4zxK79ra1GDRTsQRb+xeQLG5Mx6mJmEdsV7hfKJAv7cIoYOAzaBjbK1dfiZM9e\n\tcpeMN7rh2qNgPFsS89CRN8UhAV0sPBargdvJTX2Ks7bcT3sxTlXzVP03PtZKbOHQtbN6\n\tVKig==",
        "X-Gm-Message-State": "AOAM533xqJx6i/mbZ3Qe0RE+OlvuF49pDm9SlwB5Fixxo63/udZCMmdb\n\twJ1Sew6/zVEI6Lne1vkXSMlC6N1hxhdYrBr9",
        "X-Google-Smtp-Source": "ABdhPJxdknZq9AOLh/8q+YvhUwmgvr0vwr2MdB2X8Mu8Hy9b+nUwzyLxAKLMh14k9jwRZi+I9po8Mg==",
        "X-Received": "by 2002:aa7:cd71:: with SMTP id\n\tca17mr7226916edb.25.1607364133485; \n\tMon, 07 Dec 2020 10:02:13 -0800 (PST)",
        "From": "David Plowman <david.plowman@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon,  7 Dec 2020 18:01:18 +0000",
        "Message-Id": "<20201207180121.6374-4-david.plowman@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20201207180121.6374-1-david.plowman@raspberrypi.com>",
        "References": "<20201207180121.6374-1-david.plowman@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v2 3/6] src: ipa: raspberrypi: agc: Add\n\tGetConvergenceFrames method to AWB base class",
        "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": "We add a GetConvergenceFrames method to the AwbAlgorithm class which\ncan be called when the AWB is started from scratch. It suggests how\nmany frames should be dropped before displaying any (while the AWB\nconverges).\n\nThe Raspberry Pi specific implementation makes this customisable from\nthe tuning file.\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\n---\n src/ipa/raspberrypi/controller/awb_algorithm.hpp |  1 +\n src/ipa/raspberrypi/controller/rpi/awb.cpp       | 13 +++++++++++++\n src/ipa/raspberrypi/controller/rpi/awb.hpp       |  2 ++\n 3 files changed, 16 insertions(+)",
    "diff": "diff --git a/src/ipa/raspberrypi/controller/awb_algorithm.hpp b/src/ipa/raspberrypi/controller/awb_algorithm.hpp\nindex 5be0c9f4..84ae313b 100644\n--- a/src/ipa/raspberrypi/controller/awb_algorithm.hpp\n+++ b/src/ipa/raspberrypi/controller/awb_algorithm.hpp\n@@ -15,6 +15,7 @@ class AwbAlgorithm : public Algorithm\n public:\n \tAwbAlgorithm(Controller *controller) : Algorithm(controller) {}\n \t// An AWB algorithm must provide the following:\n+\tvirtual unsigned int GetConvergenceFrames(unsigned int mistrust_frames) const = 0;\n \tvirtual void SetMode(std::string const &mode_name) = 0;\n \tvirtual void SetManualGains(double manual_r, double manual_b) = 0;\n };\ndiff --git a/src/ipa/raspberrypi/controller/rpi/awb.cpp b/src/ipa/raspberrypi/controller/rpi/awb.cpp\nindex 020825e3..6b359ac5 100644\n--- a/src/ipa/raspberrypi/controller/rpi/awb.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/awb.cpp\n@@ -59,6 +59,7 @@ void AwbConfig::Read(boost::property_tree::ptree const &params)\n \tbayes = params.get<int>(\"bayes\", 1);\n \tframe_period = params.get<uint16_t>(\"frame_period\", 10);\n \tstartup_frames = params.get<uint16_t>(\"startup_frames\", 10);\n+\tconvergence_frames = params.get<unsigned int>(\"convergence_frames\", 3);\n \tspeed = params.get<double>(\"speed\", 0.05);\n \tif (params.get_child_optional(\"ct_curve\"))\n \t\tread_ct_curve(ct_r, ct_b, params.get_child(\"ct_curve\"));\n@@ -165,6 +166,18 @@ void Awb::Initialise()\n \tprev_sync_results_ = sync_results_;\n }\n \n+unsigned int Awb::GetConvergenceFrames(unsigned int mistrust_frames) const\n+{\n+\t// If colour gains have been explicitly set, there is no convergence\n+\t// to happen, so no need to drop any frames - return zero.\n+\t// Otherwise, any frames for which we have been told not to trust the\n+\t// statistics must be added to our own count.\n+\tif (manual_r_ && manual_b_)\n+\t\treturn 0;\n+\telse\n+\t\treturn config_.convergence_frames + mistrust_frames;\n+}\n+\n void Awb::SetMode(std::string const &mode_name)\n {\n \tstd::unique_lock<std::mutex> lock(settings_mutex_);\ndiff --git a/src/ipa/raspberrypi/controller/rpi/awb.hpp b/src/ipa/raspberrypi/controller/rpi/awb.hpp\nindex 545d85a8..d86b9598 100644\n--- a/src/ipa/raspberrypi/controller/rpi/awb.hpp\n+++ b/src/ipa/raspberrypi/controller/rpi/awb.hpp\n@@ -37,6 +37,7 @@ struct AwbConfig {\n \tuint16_t frame_period;\n \t// number of initial frames for which speed taken as 1.0 (maximum)\n \tuint16_t startup_frames;\n+\tunsigned int convergence_frames; // approx number of frames to converge\n \tdouble speed; // IIR filter speed applied to algorithm results\n \tbool fast; // \"fast\" mode uses a 16x16 rather than 32x32 grid\n \tPwl ct_r; // function maps CT to r (= R/G)\n@@ -82,6 +83,7 @@ public:\n \tchar const *Name() const override;\n \tvoid Initialise() override;\n \tvoid Read(boost::property_tree::ptree const &params) override;\n+\tunsigned int GetConvergenceFrames(unsigned int mistrust_frames) const override;\n \tvoid SetMode(std::string const &name) override;\n \tvoid SetManualGains(double manual_r, double manual_b) override;\n \tvoid SwitchMode(CameraMode const &camera_mode, Metadata *metadata) override;\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "3/6"
    ]
}