Patch Detail
Show a patch.
GET /api/patches/10599/?format=api
{ "id": 10599, "url": "https://patchwork.libcamera.org/api/patches/10599/?format=api", "web_url": "https://patchwork.libcamera.org/patch/10599/", "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": "<20201207180121.6374-3-david.plowman@raspberrypi.com>", "date": "2020-12-07T18:01:17", "name": "[libcamera-devel,v2,2/6] src: ipa: raspberrypi: agc: Add GetConvergenceFrames method to AGC base class", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "d46997f525b50480ad5cabad1a04ae29a74404c8", "submitter": { "id": 42, "url": "https://patchwork.libcamera.org/api/people/42/?format=api", "name": "David Plowman", "email": "david.plowman@raspberrypi.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/10599/mbox/", "series": [ { "id": 1511, "url": "https://patchwork.libcamera.org/api/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/10599/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/10599/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 D6A2BBDB1F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 7 Dec 2020 18:02:07 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A080667E6E;\n\tMon, 7 Dec 2020 19:02:07 +0100 (CET)", "from mail-ej1-x629.google.com (mail-ej1-x629.google.com\n\t[IPv6:2a00:1450:4864:20::629])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DA0CB67E6A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 7 Dec 2020 19:02:05 +0100 (CET)", "by mail-ej1-x629.google.com with SMTP id f23so20811435ejk.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 07 Dec 2020 10:02:05 -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.01.54\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 07 Dec 2020 10:01:58 -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=\"ri0Cn6OM\"; 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=wm3NAMcIrBR7j+LiHw5ffTkWgOX8WCAQ0spGz33JFqg=;\n\tb=ri0Cn6OM8wxoW3RQGOlducmwzbC8JX20KHmlR2W/BhDLn5pUsvZp7a6buc27IIAzLp\n\t6gl1d/0pze55VjStrohMrW4rA7GHbxQ8hck8SYvHHQ2KD8kGdgX2OW1ri2UhKxaq5B6B\n\tUEiSk6gCpxMJdXQ4bs92gEWRrFAso0y49t380e8Dq1JHrV3yFpkoYHfGV6lR3F4JoLuu\n\tSX4XyIhi52rCylzSi2P8L1yplpXhT0Y2KD3arzd4kafQ3tBh6qfRukVn1MuZY+AiQYb/\n\tjHiubW6AdTBbInIR+iFc2v3UYW/Ny06g78F2gqMcS869uDeZ5hb93MBpB9lUgo9oJ6iR\n\tpXsQ==", "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=wm3NAMcIrBR7j+LiHw5ffTkWgOX8WCAQ0spGz33JFqg=;\n\tb=fI/JyN+leKVGVZhilAVrH8u807TJOqDqCsweQhlHcFKTeGCCNTjxk9PZYBxQ62S7sK\n\tkARaKLUmwQnL58pJhpJetCCYJaAIT8GfjTsXSR9AkDjvJoR9mV86WWqW0opgBmzzZTX/\n\tS0Rc6LVxsGnGyBJe/Wgo1DQSDSBxBBwwp9/ByD5OLkf/bCY/d/U3SfnwIzkQ+RKx8DCT\n\tNcPmo44Hkeef91o5F65QWHkdjAPsxsXfjsgw/g7ElWo+GfqPtO9USSSZ9WEwZszACOJB\n\tNLrLmgAGDuXVMKz9tryj1h17JIvYbOxbrw/7pmpCKj4uXiitVlYeU4HRhQYJhR7s7No5\n\t5PGQ==", "X-Gm-Message-State": "AOAM532QQ51W6wZCIwJgDnGRUYCsL0YR0EpmFTsoa19RsXYP+TIBqjIO\n\tRLArkolz58ZhVrVRQjAp7t2N7Rkztcih+gNn", "X-Google-Smtp-Source": "ABdhPJyTnN9ubJ/x6guDYY0MoMLdfrZlkqA5EEvoMmx0F3m4fshvjbFBseZn/6C6qgFKZD2mtwgZGQ==", "X-Received": "by 2002:a17:906:c006:: with SMTP id\n\te6mr19882295ejz.374.1607364125290; \n\tMon, 07 Dec 2020 10:02:05 -0800 (PST)", "From": "David Plowman <david.plowman@raspberrypi.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 7 Dec 2020 18:01:17 +0000", "Message-Id": "<20201207180121.6374-3-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 2/6] src: ipa: raspberrypi: agc: Add\n\tGetConvergenceFrames method to AGC 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 AgcAlgorithm class which\ncan be called when the AGC is started from scratch. It suggests how\nmany frames should be dropped before displaying any (while the AGC\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/agc_algorithm.hpp | 1 +\n src/ipa/raspberrypi/controller/rpi/agc.cpp | 13 +++++++++++++\n src/ipa/raspberrypi/controller/rpi/agc.hpp | 2 ++\n 3 files changed, 16 insertions(+)", "diff": "diff --git a/src/ipa/raspberrypi/controller/agc_algorithm.hpp b/src/ipa/raspberrypi/controller/agc_algorithm.hpp\nindex b4ea54fb..85fc6084 100644\n--- a/src/ipa/raspberrypi/controller/agc_algorithm.hpp\n+++ b/src/ipa/raspberrypi/controller/agc_algorithm.hpp\n@@ -15,6 +15,7 @@ class AgcAlgorithm : public Algorithm\n public:\n \tAgcAlgorithm(Controller *controller) : Algorithm(controller) {}\n \t// An AGC algorithm must provide the following:\n+\tvirtual unsigned int GetConvergenceFrames(unsigned int mistrust_frames) const = 0;\n \tvirtual void SetEv(double ev) = 0;\n \tvirtual void SetFlickerPeriod(double flicker_period) = 0;\n \tvirtual void SetFixedShutter(double fixed_shutter) = 0; // microseconds\ndiff --git a/src/ipa/raspberrypi/controller/rpi/agc.cpp b/src/ipa/raspberrypi/controller/rpi/agc.cpp\nindex 9da18c31..787918cc 100644\n--- a/src/ipa/raspberrypi/controller/rpi/agc.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/agc.cpp\n@@ -142,6 +142,7 @@ void AgcConfig::Read(boost::property_tree::ptree const ¶ms)\n \tY_target.Read(params.get_child(\"y_target\"));\n \tspeed = params.get<double>(\"speed\", 0.2);\n \tstartup_frames = params.get<uint16_t>(\"startup_frames\", 10);\n+\tconvergence_frames = params.get<unsigned int>(\"convergence_frames\", 6);\n \tfast_reduce_threshold =\n \t\tparams.get<double>(\"fast_reduce_threshold\", 0.4);\n \tbase_ev = params.get<double>(\"base_ev\", 1.0);\n@@ -206,6 +207,18 @@ void Agc::Resume()\n \tfixed_analogue_gain_ = 0;\n }\n \n+unsigned int Agc::GetConvergenceFrames(unsigned int mistrust_frames) const\n+{\n+\t// If shutter and gain have been explicitly set, there is no\n+\t// convergence 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 (fixed_shutter_ && fixed_analogue_gain_)\n+\t\treturn 0;\n+\telse\n+\t\treturn config_.convergence_frames + mistrust_frames;\n+}\n+\n void Agc::SetEv(double ev)\n {\n \tev_ = ev;\ndiff --git a/src/ipa/raspberrypi/controller/rpi/agc.hpp b/src/ipa/raspberrypi/controller/rpi/agc.hpp\nindex 95db1812..7d41608a 100644\n--- a/src/ipa/raspberrypi/controller/rpi/agc.hpp\n+++ b/src/ipa/raspberrypi/controller/rpi/agc.hpp\n@@ -52,6 +52,7 @@ struct AgcConfig {\n \tPwl Y_target;\n \tdouble speed;\n \tuint16_t startup_frames;\n+\tunsigned int convergence_frames;\n \tdouble max_change;\n \tdouble min_change;\n \tdouble fast_reduce_threshold;\n@@ -74,6 +75,7 @@ public:\n \tbool IsPaused() const override;\n \tvoid Pause() override;\n \tvoid Resume() override;\n+\tunsigned int GetConvergenceFrames(unsigned int mistrust_frames) const override;\n \tvoid SetEv(double ev) override;\n \tvoid SetFlickerPeriod(double flicker_period) override;\n \tvoid SetFixedShutter(double fixed_shutter) override; // microseconds\n", "prefixes": [ "libcamera-devel", "v2", "2/6" ] }