Show a patch.

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

{
    "id": 19310,
    "url": "https://patchwork.libcamera.org/api/patches/19310/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/19310/",
    "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": "<20231212115046.102726-6-andrey.konovalov@linaro.org>",
    "date": "2023-12-12T11:50:44",
    "name": "[libcamera-devel,RFC,v2,5/7] libcamera: software_isp: add SwIspLinaro implementation of SoftwareIsp",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "94fd5e8e67a3a6668ac77e0b582a38060a7b590a",
    "submitter": {
        "id": 25,
        "url": "https://patchwork.libcamera.org/api/people/25/?format=api",
        "name": "Andrey Konovalov",
        "email": "andrey.konovalov@linaro.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/19310/mbox/",
    "series": [
        {
            "id": 4114,
            "url": "https://patchwork.libcamera.org/api/series/4114/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4114",
            "date": "2023-12-12T11:50:39",
            "name": "libcamera: introduce Software ISP and Software IPA",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/4114/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/19310/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/19310/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 884E0C3292\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 12 Dec 2023 11:51:28 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2A44562B49;\n\tTue, 12 Dec 2023 12:51:28 +0100 (CET)",
            "from mail-ej1-x633.google.com (mail-ej1-x633.google.com\n\t[IPv6:2a00:1450:4864:20::633])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BBDB062B3D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 12 Dec 2023 12:51:26 +0100 (CET)",
            "by mail-ej1-x633.google.com with SMTP id\n\ta640c23a62f3a-a1e2f34467aso520418066b.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 12 Dec 2023 03:51:26 -0800 (PST)",
            "from Lat-5310.. ([87.116.161.153]) by smtp.gmail.com with ESMTPSA\n\tid\n\ttx17-20020a1709078e9100b00a1b75e0e061sm6213188ejc.130.2023.12.12.03.51.25\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 12 Dec 2023 03:51:25 -0800 (PST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1702381888;\n\tbh=ZzgDbG5BAr3rpe3OXUbPePZWBKIIm0NVxT0vKz0m8uA=;\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:Cc:\n\tFrom;\n\tb=cEdDqZgMFMXGA5uKEPRYCeu0TnCNfwNorbSbu8C+FmDlLI7VVBktHB2mItkO0FODK\n\t3ofBOWHwB/Gi32v+qWB2hgZ9FSK8tTd8Iil4tVHL7KPMQjxCxCwSufzqelUJH+UpqE\n\tVAyw4/hgMbzDOdXr0KWQgQX5y/gq1UaMwe7iiDQfaqVh2xh/o/fvGVmjDo4ZJh3rUh\n\tWjgLEkxqD+Lwc71dhYkq6bigI19T1Ced9mF7Fe7F4zRCuy8cUJxo7b4qCc1DgpN6gv\n\tM80E1N2X/UtyMtaa6P510iJ0tOoTRGWnZr0TtFJRAG86RjuTHEHWnAK84x439LjcOO\n\tcUz9iT4ndTr9w==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linaro.org; s=google; t=1702381886; x=1702986686;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=hKQg9mAih69LodQyOzERLWYq7VTf2Z8iii77nqI92wQ=;\n\tb=MQbcgsktGHugdvuLnzatzQPDUpvY6YIc7U96EkUoW6jyl8zPg1VJaOsyfX7Cjhh3ML\n\tmG/Gd76rUSBhfohZiSYnFG7WYrsqmZHGT8JgGMshxduYmBKfUAY55n9GGkgOBb3lPdhi\n\tFOtVVaertFSTrrCr5ImRA2fZzEgso0Qwur2SgzurR1PoBrJCk5DGQ9qEh6Y477MWoI7V\n\t8kkKeEJMkZjo6zq2Q5MqmZj3uSuvWt2FMvvXtwIZrD3Ig2YnAJC5opGUe1h3p5YGUuLa\n\tWoyvwqaX42UNgjltj165ZDAElpBJzdtvnD0+t7JLTYi5iYl0TLSCq+O0c1vfKjYV074N\n\ttYtg=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=linaro.org\n\theader.i=@linaro.org header.b=\"MQbcgskt\"; \n\tdkim-atps=neutral",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1702381886; x=1702986686;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=hKQg9mAih69LodQyOzERLWYq7VTf2Z8iii77nqI92wQ=;\n\tb=tc1HGO5S9ZvOLumREAC5bUjh3iztsHBfY1jxJ/Upl2ghCGJ5ewsQ7I4bSpTKFODkJ9\n\tDbf86ChedALCGy/MErZd7DOvcWfA4UdXnDnX0zjSgBkLD6BL4GqOmkT8AY1UHje66qXI\n\t2iVQPBPi8rLrLCQTiNavv90kXE2isT4z7OaRp5cpb+mYNuGD/FHcB5yUS7aX4Ao6Q0Lt\n\twDxvtIM+tsZJv6h4YCcCXj7CtpKB7pKcRlWSH7D0UK3aljJw+r+3kGmyHwdluS5/igpJ\n\tMGASw6uD9GlPrZTlr9ExLYrJCt/uu8X/KKkMiWVuh6PTT5Abvo+yaPkt3mbpEMgfwZ8t\n\tcbrw==",
        "X-Gm-Message-State": "AOJu0YwTiRd5NneqN5x58T0HEcBeb1Ng8Az4xXDubxXp50ahFIOCWNOB\n\tt92lbb8LAoC2jvCDJKjxlDsB0W1UMxvOBwsltLs=",
        "X-Google-Smtp-Source": "AGHT+IGr398qcNcUU3H9InVX2CeGeOektYuF0P83RVZ5lKt68QTBifG8yfqWpP7dwY/fw8F1bLVOkw==",
        "X-Received": "by 2002:a17:906:fcb5:b0:9be:2b53:ac4d with SMTP id\n\tqw21-20020a170906fcb500b009be2b53ac4dmr2976674ejb.74.1702381886220; \n\tTue, 12 Dec 2023 03:51:26 -0800 (PST)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue, 12 Dec 2023 14:50:44 +0300",
        "Message-Id": "<20231212115046.102726-6-andrey.konovalov@linaro.org>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20231212115046.102726-1-andrey.konovalov@linaro.org>",
        "References": "<20231212115046.102726-1-andrey.konovalov@linaro.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [RFC PATCH v2 5/7] libcamera: software_isp: add\n\tSwIspLinaro implementation of SoftwareIsp",
        "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": "Andrey Konovalov via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Andrey Konovalov <andrey.konovalov@linaro.org>",
        "Cc": "mripard@redhat.com, g.martti@gmail.com, t.langendam@gmail.com,\n\tsrinivas.kandagatla@linaro.org, pavel@ucw.cz,\n\tbryan.odonoghue@linaro.org, admin@dennisbonke.com",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "The implementation of SoftwareIsp handles creation of Soft IPA\nand interactions with it, so that the pipeline handler wouldn't\nneed to care about the Soft IPA.\n\nSigned-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>\n---\n include/libcamera/internal/meson.build        |   1 +\n .../internal/software_isp/meson.build         |   1 +\n .../internal/software_isp/swisp_linaro.h      | 117 ++++\n src/libcamera/meson.build                     |   1 +\n src/libcamera/software_isp/meson.build        |  20 +\n src/libcamera/software_isp/swisp_linaro.cpp   | 589 ++++++++++++++++++\n 6 files changed, 729 insertions(+)\n create mode 100644 include/libcamera/internal/software_isp/swisp_linaro.h\n create mode 100644 src/libcamera/software_isp/meson.build\n create mode 100644 src/libcamera/software_isp/swisp_linaro.cpp",
    "diff": "diff --git a/include/libcamera/internal/meson.build b/include/libcamera/internal/meson.build\nindex b780777c..eeae801c 100644\n--- a/include/libcamera/internal/meson.build\n+++ b/include/libcamera/internal/meson.build\n@@ -50,3 +50,4 @@ libcamera_internal_headers = files([\n ])\n \n subdir('converter')\n+subdir('software_isp')\ndiff --git a/include/libcamera/internal/software_isp/meson.build b/include/libcamera/internal/software_isp/meson.build\nindex a24fe7df..9f84f00e 100644\n--- a/include/libcamera/internal/software_isp/meson.build\n+++ b/include/libcamera/internal/software_isp/meson.build\n@@ -2,4 +2,5 @@\n \n libcamera_internal_headers += files([\n     'statistics-linaro.h',\n+    'swisp_linaro.h',\n ])\ndiff --git a/include/libcamera/internal/software_isp/swisp_linaro.h b/include/libcamera/internal/software_isp/swisp_linaro.h\nnew file mode 100644\nindex 00000000..c0df7863\n--- /dev/null\n+++ b/include/libcamera/internal/software_isp/swisp_linaro.h\n@@ -0,0 +1,117 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2023, Linaro Ltd\n+ *\n+ * swisp_linaro.h - software ISP implementation by Linaro\n+ */\n+\n+#pragma once\n+\n+#include <libcamera/base/log.h>\n+#include <libcamera/base/thread.h>\n+\n+#include <libcamera/pixel_format.h>\n+\n+#include <libcamera/ipa/soft_ipa_interface.h>\n+#include <libcamera/ipa/soft_ipa_proxy.h>\n+\n+#include \"libcamera/internal/shared_mem_object.h\"\n+#include \"libcamera/internal/software_isp.h\"\n+#include \"libcamera/internal/software_isp/statistics-linaro.h\"\n+\n+namespace libcamera {\n+\n+class SwIspLinaro : public SoftwareIsp\n+{\n+public:\n+\tSwIspLinaro(PipelineHandler *pipe, const ControlInfoMap &sensorControls);\n+\t~SwIspLinaro() {}\n+\n+\tint loadConfiguration([[maybe_unused]] const std::string &filename) { return 0; }\n+\tbool isValid() const;\n+\n+\tstd::vector<PixelFormat> formats(PixelFormat input);\n+\tSizeRange sizes(PixelFormat inputFormat, const Size &inputSize);\n+\n+\tstd::tuple<unsigned int, unsigned int>\n+\tstrideAndFrameSize(const PixelFormat &outputFormat, const Size &size);\n+\n+\tint configure(const StreamConfiguration &inputCfg,\n+\t\t      const std::vector<std::reference_wrapper<StreamConfiguration>> &outputCfgs);\n+\tint exportBuffers(unsigned int output, unsigned int count,\n+\t\t\t  std::vector<std::unique_ptr<FrameBuffer>> *buffers);\n+\tvoid processStats(const ControlList &sensorControls);\n+\n+\tint start();\n+\tvoid stop();\n+\n+\tint queueBuffers(FrameBuffer *input,\n+\t\t\t const std::map<unsigned int, FrameBuffer *> &outputs);\n+\n+\tSignal<const ControlList &> &getSignalSetSensorControls();\n+\n+\tvoid process(FrameBuffer *input, FrameBuffer *output);\n+\n+private:\n+\tSharedMemObject<SwIspStats> sharedStats_;\n+\n+\tclass IspWorker : public Object\n+\t{\n+\tpublic:\n+\t\tIspWorker(SwIspLinaro *swIsp);\n+\n+\t\tstd::vector<PixelFormat> formats(PixelFormat input);\n+\t\tSizeRange sizes(PixelFormat inputFormat, const Size &inputSize);\n+\t\tunsigned int outStride(const PixelFormat &outputFormat,\n+\t\t\t\t       const Size &outSize);\n+\n+\t\tint configure(const StreamConfiguration &inputCfg,\n+\t\t\t      const StreamConfiguration &outputCfg);\n+\t\tunsigned int outBufferSize();\n+\t\tvoid process(FrameBuffer *input, FrameBuffer *output);\n+\n+\tprivate:\n+\t\tSwIspLinaro *swIsp_;\n+\n+\t\ttypedef void (SwIspLinaro::IspWorker::*debayerFn)(uint8_t *dst, const uint8_t *src);\n+\t\ttypedef SizeRange (*outSizesFn)(const Size &inSize);\n+\t\ttypedef unsigned int (*outStrideFn)(const Size &outSize);\n+\t\tstruct debayerInfo {\n+\t\t\tPixelFormat outPixelFmt;\n+\t\t\tdebayerFn debayer;\n+\t\t\toutSizesFn getOutSizes;\n+\t\t\toutStrideFn getOutStride;\n+\t\t};\n+\t\t// TODO: use inputFormat+outputFormat as the map key\n+\t\t// to enable multiple output formats\n+\t\t// TODO: use BayerFormat instead of PixelFormat as inputFormat\n+\t\tstd::map<PixelFormat, IspWorker::debayerInfo> debayerInfos_;\n+\t\tint setDebayerInfo(PixelFormat format);\n+\t\tdebayerInfo *debayerInfo_;\n+\n+\t\t/* CSI-2 packed 10-bit raw bayer format (all the 4 orders) */\n+\t\tvoid debayerRaw10P(uint8_t *dst, const uint8_t *src);\n+\t\tstatic SizeRange outSizesRaw10P(const Size &inSize);\n+\t\tstatic unsigned int outStrideRaw10P(const Size &outSize);\n+\n+\t\tunsigned int width_;\n+\t\tunsigned int height_;\n+\t\tunsigned int stride_;\n+\t\tPoint redShift_;\n+\t\tunsigned int outHeight_;\n+\t\tunsigned int outStride_;\n+\n+\t\tunsigned long rNumerat_, rDenomin_; /* red gain for AWB */\n+\t\tunsigned long bNumerat_, bDenomin_; /* blue gain for AWB */\n+\t\tunsigned long gNumerat_, gDenomin_; /* green gain for AWB */\n+\n+\t\tSwIspStats stats_;\n+\t};\n+\n+\tstd::unique_ptr<IspWorker> ispWorker_;\n+\tThread ispWorkerThread_;\n+\n+\tstd::unique_ptr<ipa::soft::IPAProxySoft> ipa_;\n+};\n+\n+} /* namespace libcamera */\ndiff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\nindex b3606969..e758ac9c 100644\n--- a/src/libcamera/meson.build\n+++ b/src/libcamera/meson.build\n@@ -70,6 +70,7 @@ subdir('converter')\n subdir('ipa')\n subdir('pipeline')\n subdir('proxy')\n+subdir('software_isp')\n \n null_dep = dependency('', required : false)\n \ndiff --git a/src/libcamera/software_isp/meson.build b/src/libcamera/software_isp/meson.build\nnew file mode 100644\nindex 00000000..d4a8d499\n--- /dev/null\n+++ b/src/libcamera/software_isp/meson.build\n@@ -0,0 +1,20 @@\n+# SPDX-License-Identifier: CC0-1.0\n+\n+# Software ISP is enabled for 'simple' pipeline handler.\n+# The 'pipelines' option value should be\n+# 'simple/<Software ISP implementation>' e.g.:\n+#   -Dpipelines=simple/linaro\n+# The source file should be named swisp_<Software ISP implementation>.cpp,\n+# e.g. 'swisp_linaro.cpp'.\n+\n+foreach pipeline : pipelines\n+    pipeline = pipeline.split('/')\n+    if pipeline.length() == 2 and pipeline[0] == 'simple'\n+        libcamera_sources += files([\n+            'swisp_' + pipeline[1] + '.cpp',\n+        ])\n+        # the 'break' below can be removed if/when multiple\n+        # Software ISP implementations are allowed in single build\n+        break\n+    endif\n+endforeach\ndiff --git a/src/libcamera/software_isp/swisp_linaro.cpp b/src/libcamera/software_isp/swisp_linaro.cpp\nnew file mode 100644\nindex 00000000..b7f36db1\n--- /dev/null\n+++ b/src/libcamera/software_isp/swisp_linaro.cpp\n@@ -0,0 +1,589 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2023, Linaro Ltd\n+ *\n+ * swisp_linaro.cpp - software ISP implementation by Linaro\n+ */\n+\n+#include \"libcamera/internal/software_isp/swisp_linaro.h\"\n+\n+#include <sys/mman.h>\n+#include <sys/types.h>\n+#include <unistd.h>\n+\n+#include <libcamera/formats.h>\n+#include <libcamera/stream.h>\n+\n+#include \"libcamera/internal/bayer_format.h\"\n+#include \"libcamera/internal/framebuffer.h\"\n+#include \"libcamera/internal/ipa_manager.h\"\n+#include \"libcamera/internal/mapped_framebuffer.h\"\n+\n+namespace libcamera {\n+\n+LOG_DECLARE_CATEGORY(SoftwareIsp)\n+\n+SwIspLinaro::SwIspLinaro(PipelineHandler *pipe, const ControlInfoMap &sensorControls)\n+\t: SoftwareIsp(pipe, sensorControls)\n+{\n+\tispWorker_ = std::make_unique<SwIspLinaro::IspWorker>(this);\n+\tif (!ispWorker_) {\n+\t\tLOG(SoftwareIsp, Error)\n+\t\t\t<< \"Failed to create ISP worker\";\n+\t\treturn;\n+\t}\n+\n+\tsharedStats_ = SharedMemObject<SwIspStats>(\"softIsp_stats\");\n+\tif (!sharedStats_.fd().isValid()) {\n+\t\tLOG(SoftwareIsp, Error)\n+\t\t\t<< \"Failed to create shared memory for statistics\";\n+\t\tispWorker_.reset();\n+\t\treturn;\n+\t}\n+\n+\tipa_ = IPAManager::createIPA<ipa::soft::IPAProxySoft>(pipe, 0, 0);\n+\tif (!ipa_) {\n+\t\tLOG(SoftwareIsp, Error)\n+\t\t\t<< \"Creating IPA for software ISP failed\";\n+\t\tispWorker_.reset();\n+\t\treturn;\n+\t}\n+\n+\tint ret = ipa_->init(IPASettings{ \"No cfg file\", \"No sensor model\" },\n+\t\t\t     sharedStats_.fd(),\n+\t\t\t     sensorControls);\n+\tif (ret) {\n+\t\tLOG(SoftwareIsp, Error) << \"IPA init failed\";\n+\t\tispWorker_.reset();\n+\t\treturn;\n+\t}\n+\n+\tipa_->configure(sensorControls);\n+\n+\tispWorker_->moveToThread(&ispWorkerThread_);\n+}\n+\n+void SwIspLinaro::processStats(const ControlList &sensorControls)\n+{\n+\tASSERT(ipa_);\n+\tipa_->processStats(sensorControls);\n+}\n+\n+Signal<const ControlList &> &SwIspLinaro::getSignalSetSensorControls()\n+{\n+\tASSERT(ipa_);\n+\treturn ipa_->setSensorControls;\n+}\n+\n+bool SwIspLinaro::isValid() const\n+{\n+\treturn !!ispWorker_;\n+}\n+\n+/*\n+ * Demosaic Raw10P frame into RGB888 format.\n+ * Two LS bits of the RAW10P's total 10 are ignored.\n+ * Also this function performs the statistics calculations, and has a fairly\n+ * naive grey world AWB algorithm implementation.\n+ * \\todo Split the stats calculations out of this function.\n+ * \\todo Move the AWB algorithm into the IPA module.\n+ */\n+void SwIspLinaro::IspWorker::debayerRaw10P(uint8_t *dst, const uint8_t *src)\n+{\n+\t/* for brightness values in the 0 to 255 range: */\n+\tstatic const unsigned int BRIGHT_LVL = 200U << 8;\n+\tstatic const unsigned int TOO_BRIGHT_LVL = 240U << 8;\n+\n+\tstatic const unsigned int RED_Y_MUL = 77;\t/* 0.30 * 256 */\n+\tstatic const unsigned int GREEN_Y_MUL = 150;\t/* 0.59 * 256 */\n+\tstatic const unsigned int BLUE_Y_MUL = 29;\t/* 0.11 * 256 */\n+\n+\tint w_out = width_ - 2;\n+\tint h_out = height_ - 2;\n+\n+\tunsigned long sumR = 0;\n+\tunsigned long sumB = 0;\n+\tunsigned long sumG = 0;\n+\n+\tunsigned long bright_sum = 0;\n+\tunsigned long too_bright_sum = 0;\n+\n+\tfor (int y = 0; y < h_out; y++) {\n+\t\tconst uint8_t *pin_base = src + (y + 1) * stride_;\n+\t\tuint8_t *pout = dst + y * w_out * 3;\n+\t\tint phase_y = (y + redShift_.y) % 2;\n+\n+\t\tfor (int x = 0; x < w_out; x++) {\n+\t\t\tint phase_x = (x + redShift_.x) % 2;\n+\t\t\tint phase = 2 * phase_y + phase_x;\n+\n+\t\t\t/* x part of the offset in the input buffer: */\n+\t\t\tint x_m1 = x + x / 4;\t\t/* offset for (x-1) */\n+\t\t\tint x_0 = x + 1 + (x + 1) / 4;\t/* offset for x */\n+\t\t\tint x_p1 = x + 2 + (x + 2) / 4;\t/* offset for (x+1) */\n+\t\t\t/* the colour component value to write to the output */\n+\t\t\tunsigned val;\n+\t\t\t/* Y value times 256 */\n+\t\t\tunsigned y_val;\n+\n+\t\t\tswitch (phase) {\n+\t\t\tcase 0: /* at R pixel */\n+\t\t\t\t/* blue: ((-1,-1)+(1,-1)+(-1,1)+(1,1)) / 4 */\n+\t\t\t\tval = ( *(pin_base + x_m1 - stride_)\n+\t\t\t\t\t+ *(pin_base + x_p1 - stride_)\n+\t\t\t\t\t+ *(pin_base + x_m1 + stride_)\n+\t\t\t\t\t+ *(pin_base + x_p1 + stride_) ) >> 2;\n+\t\t\t\ty_val = BLUE_Y_MUL * val;\n+\t\t\t\tval = val * bNumerat_ / bDenomin_;\n+\t\t\t\t*pout++ = (uint8_t)std::min(val, 0xffU);\n+\t\t\t\t/* green: ((0,-1)+(-1,0)+(1,0)+(0,1)) / 4 */\n+\t\t\t\tval = ( *(pin_base + x_0 - stride_)\n+\t\t\t\t\t+ *(pin_base + x_p1)\n+\t\t\t\t\t+ *(pin_base + x_m1)\n+\t\t\t\t\t+ *(pin_base + x_0 + stride_) ) >> 2;\n+\t\t\t\tval = val * gNumerat_ / gDenomin_;\n+\t\t\t\ty_val += GREEN_Y_MUL * val;\n+\t\t\t\t*pout++ = (uint8_t)std::min(val, 0xffU);\n+\t\t\t\t/* red: (0,0) */\n+\t\t\t\tval = *(pin_base + x_0);\n+\t\t\t\tsumR += val;\n+\t\t\t\ty_val += RED_Y_MUL * val;\n+\t\t\t\tif (y_val > BRIGHT_LVL) ++bright_sum;\n+\t\t\t\tif (y_val > TOO_BRIGHT_LVL) ++too_bright_sum;\n+\t\t\t\tval = val * rNumerat_ / rDenomin_;\n+\t\t\t\t*pout++ = (uint8_t)std::min(val, 0xffU);\n+\t\t\t\tbreak;\n+\t\t\tcase 1: /* at Gr pixel */\n+\t\t\t\t/* blue: ((0,-1) + (0,1)) / 2 */\n+\t\t\t\tval = ( *(pin_base + x_0 - stride_)\n+\t\t\t\t\t+ *(pin_base + x_0 + stride_) ) >> 1;\n+\t\t\t\ty_val = BLUE_Y_MUL * val;\n+\t\t\t\tval = val * bNumerat_ / bDenomin_;\n+\t\t\t\t*pout++ = (uint8_t)std::min(val, 0xffU);\n+\t\t\t\t/* green: (0,0) */\n+\t\t\t\tval = *(pin_base + x_0);\n+\t\t\t\tsumG += val;\n+\t\t\t\ty_val += GREEN_Y_MUL * val;\n+\t\t\t\tval = val * gNumerat_ / gDenomin_;\n+\t\t\t\t*pout++ = (uint8_t)std::min(val, 0xffU);\n+\t\t\t\t/* red: ((-1,0) + (1,0)) / 2 */\n+\t\t\t\tval = ( *(pin_base + x_m1)\n+\t\t\t\t\t+ *(pin_base + x_p1) ) >> 1;\n+\t\t\t\ty_val += RED_Y_MUL * val;\n+\t\t\t\tif (y_val > BRIGHT_LVL) ++bright_sum;\n+\t\t\t\tif (y_val > TOO_BRIGHT_LVL) ++too_bright_sum;\n+\t\t\t\tval = val * rNumerat_ / rDenomin_;\n+\t\t\t\t*pout++ = (uint8_t)std::min(val, 0xffU);\n+\t\t\t\tbreak;\n+\t\t\tcase 2: /* at Gb pixel */\n+\t\t\t\t/* blue: ((-1,0) + (1,0)) / 2 */\n+\t\t\t\tval = ( *(pin_base + x_m1)\n+\t\t\t\t\t+ *(pin_base + x_p1) ) >> 1;\n+\t\t\t\ty_val = BLUE_Y_MUL * val;\n+\t\t\t\tval = val * bNumerat_ / bDenomin_;\n+\t\t\t\t*pout++ = (uint8_t)std::min(val, 0xffU);\n+\t\t\t\t/* green: (0,0) */\n+\t\t\t\tval = *(pin_base + x_0);\n+\t\t\t\tsumG += val;\n+\t\t\t\ty_val += GREEN_Y_MUL * val;\n+\t\t\t\tval = val * gNumerat_ / gDenomin_;\n+\t\t\t\t*pout++ = (uint8_t)std::min(val, 0xffU);\n+\t\t\t\t/* red: ((0,-1) + (0,1)) / 2 */\n+\t\t\t\tval = ( *(pin_base + x_0 - stride_)\n+\t\t\t\t\t+ *(pin_base + x_0 + stride_) ) >> 1;\n+\t\t\t\ty_val += RED_Y_MUL * val;\n+\t\t\t\tif (y_val > BRIGHT_LVL) ++bright_sum;\n+\t\t\t\tif (y_val > TOO_BRIGHT_LVL) ++too_bright_sum;\n+\t\t\t\tval = val * rNumerat_ / rDenomin_;\n+\t\t\t\t*pout++ = (uint8_t)std::min(val, 0xffU);\n+\t\t\t\tbreak;\n+\t\t\tdefault: /* at B pixel */\n+\t\t\t\t/* blue: (0,0) */\n+\t\t\t\tval = *(pin_base + x_0);\n+\t\t\t\tsumB += val;\n+\t\t\t\ty_val = BLUE_Y_MUL * val;\n+\t\t\t\tval = val * bNumerat_ / bDenomin_;\n+\t\t\t\t*pout++ = (uint8_t)std::min(val, 0xffU);\n+\t\t\t\t/* green: ((0,-1)+(-1,0)+(1,0)+(0,1)) / 4 */\n+\t\t\t\tval = ( *(pin_base + x_0 - stride_)\n+\t\t\t\t\t+ *(pin_base + x_p1)\n+\t\t\t\t\t+ *(pin_base + x_m1)\n+\t\t\t\t\t+ *(pin_base + x_0 + stride_) ) >> 2;\n+\t\t\t\ty_val += GREEN_Y_MUL * val;\n+\t\t\t\tval = val * gNumerat_ / gDenomin_;\n+\t\t\t\t*pout++ = (uint8_t)std::min(val, 0xffU);\n+\t\t\t\t/* red: ((-1,-1)+(1,-1)+(-1,1)+(1,1)) / 4 */\n+\t\t\t\tval = ( *(pin_base + x_m1 - stride_)\n+\t\t\t\t\t+ *(pin_base + x_p1 - stride_)\n+\t\t\t\t\t+ *(pin_base + x_m1 + stride_)\n+\t\t\t\t\t+ *(pin_base + x_p1 + stride_) ) >> 2;\n+\t\t\t\ty_val += RED_Y_MUL * val;\n+\t\t\t\tif (y_val > BRIGHT_LVL) ++bright_sum;\n+\t\t\t\tif (y_val > TOO_BRIGHT_LVL) ++too_bright_sum;\n+\t\t\t\tval = val * rNumerat_ / rDenomin_;\n+\t\t\t\t*pout++ = (uint8_t)std::min(val, 0xffU);\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+\t/* calculate the fractions of \"bright\" and \"too bright\" pixels */\n+\tstats_.bright_ratio = (float)bright_sum / (h_out * w_out);\n+\tstats_.too_bright_ratio = (float)too_bright_sum / (h_out * w_out);\n+\n+\t/* calculate red and blue gains for simple AWB */\n+\tLOG(SoftwareIsp, Debug)\n+\t\t<< \"sumR = \" << sumR << \", sumB = \" << sumB << \", sumG = \" << sumG;\n+\n+\tsumG /= 2; /* the number of G pixels is twice as big vs R and B ones */\n+\n+\t/* normalize red, blue, and green sums to fit into 22-bit value */\n+\tunsigned long fRed = sumR / 0x400000;\n+\tunsigned long fBlue = sumB / 0x400000;\n+\tunsigned long fGreen = sumG / 0x400000;\n+\tunsigned long fNorm = std::max({ 1UL, fRed, fBlue, fGreen });\n+\tsumR /= fNorm;\n+\tsumB /= fNorm;\n+\tsumG /= fNorm;\n+\n+\tLOG(SoftwareIsp, Debug) << \"fNorm = \" << fNorm;\n+\tLOG(SoftwareIsp, Debug)\n+\t\t<< \"Normalized: sumR = \" << sumR\n+\t\t<< \", sumB= \" << sumB << \", sumG = \" << sumG;\n+\n+\t/* make sure red/blue gains never exceed approximately 256 */\n+\tunsigned long minDenom;\n+\trNumerat_ = (sumR + sumB + sumG) / 3;\n+\tminDenom = rNumerat_ / 0x100;\n+\trDenomin_ = std::max(minDenom, sumR);\n+\tbNumerat_ = rNumerat_;\n+\tbDenomin_ = std::max(minDenom, sumB);\n+\tgNumerat_ = rNumerat_;\n+\tgDenomin_ = std::max(minDenom, sumG);\n+\n+\tLOG(SoftwareIsp, Debug)\n+\t\t<< \"rGain = [ \" << rNumerat_ << \" / \" << rDenomin_\n+\t\t<< \" ], bGain = [ \" << bNumerat_ << \" / \" << bDenomin_\n+\t\t<< \" ], gGain = [ \" << gNumerat_ << \" / \" << gDenomin_\n+\t\t<< \" (minDenom = \" << minDenom << \")\";\n+}\n+\n+SizeRange SwIspLinaro::IspWorker::outSizesRaw10P(const Size &inSize)\n+{\n+\tif (inSize.width < 2 || inSize.height < 2) {\n+\t\tLOG(SoftwareIsp, Error)\n+\t\t\t<< \"Input format size too small: \" << inSize.toString();\n+\t\treturn {};\n+\t}\n+\n+\treturn SizeRange(Size(inSize.width - 2, inSize.height - 2));\n+}\n+\n+unsigned int SwIspLinaro::IspWorker::outStrideRaw10P(const Size &outSize)\n+{\n+\treturn outSize.width * 3;\n+}\n+\n+SwIspLinaro::IspWorker::IspWorker(SwIspLinaro *swIsp)\n+\t: swIsp_(swIsp)\n+{\n+\tdebayerInfos_[formats::SBGGR10_CSI2P] = { formats::RGB888,\n+\t\t\t\t\t\t  &SwIspLinaro::IspWorker::debayerRaw10P,\n+\t\t\t\t\t\t  &SwIspLinaro::IspWorker::outSizesRaw10P,\n+\t\t\t\t\t\t  &SwIspLinaro::IspWorker::outStrideRaw10P };\n+\tdebayerInfos_[formats::SGBRG10_CSI2P] = { formats::RGB888,\n+\t\t\t\t\t\t  &SwIspLinaro::IspWorker::debayerRaw10P,\n+\t\t\t\t\t\t  &SwIspLinaro::IspWorker::outSizesRaw10P,\n+\t\t\t\t\t\t  &SwIspLinaro::IspWorker::outStrideRaw10P };\n+\tdebayerInfos_[formats::SGRBG10_CSI2P] = { formats::RGB888,\n+\t\t\t\t\t\t  &SwIspLinaro::IspWorker::debayerRaw10P,\n+\t\t\t\t\t\t  &SwIspLinaro::IspWorker::outSizesRaw10P,\n+\t\t\t\t\t\t  &SwIspLinaro::IspWorker::outStrideRaw10P };\n+\tdebayerInfos_[formats::SRGGB10_CSI2P] = { formats::RGB888,\n+\t\t\t\t\t\t  &SwIspLinaro::IspWorker::debayerRaw10P,\n+\t\t\t\t\t\t  &SwIspLinaro::IspWorker::outSizesRaw10P,\n+\t\t\t\t\t\t  &SwIspLinaro::IspWorker::outStrideRaw10P };\n+}\n+\n+int SwIspLinaro::IspWorker::setDebayerInfo(PixelFormat format)\n+{\n+\tconst auto it = debayerInfos_.find(format);\n+\tif (it == debayerInfos_.end())\n+\t\treturn -1;\n+\n+\tdebayerInfo_ = &it->second;\n+\treturn 0;\n+}\n+\n+std::vector<PixelFormat> SwIspLinaro::IspWorker::formats(PixelFormat input)\n+{\n+\tstd::vector<PixelFormat> pixelFormats;\n+\n+\tconst auto it = debayerInfos_.find(input);\n+\tif (it == debayerInfos_.end())\n+\t\tLOG(SoftwareIsp, Info)\n+\t\t\t<< \"Unsupported input format \" << input.toString();\n+\telse\n+\t\tpixelFormats.push_back(it->second.outPixelFmt);\n+\n+\treturn pixelFormats;\n+}\n+\n+SizeRange SwIspLinaro::IspWorker::sizes(PixelFormat inputFormat,\n+\t\t\t\t\tconst Size &inputSize)\n+{\n+\tconst auto it = debayerInfos_.find(inputFormat);\n+\tif (it == debayerInfos_.end()) {\n+\t\tLOG(SoftwareIsp, Info)\n+\t\t\t<< \"Unsupported input format \" << inputFormat.toString();\n+\t\treturn {};\n+\t}\n+\n+\treturn (*it->second.getOutSizes)(inputSize);\n+}\n+\n+unsigned int SwIspLinaro::IspWorker::outStride(const PixelFormat &outputFormat,\n+\t\t\t\t\t       const Size &outSize)\n+{\n+\t/*\n+\t * Assuming that the output stride depends only on the outputFormat,\n+\t * we use the first debayerInfos_ entry with the matching output format\n+\t */\n+\tfor (auto it = debayerInfos_.begin(); it != debayerInfos_.end(); it++) {\n+\t\tif (it->second.outPixelFmt == outputFormat)\n+\t\t\treturn (*it->second.getOutStride)(outSize);\n+\t}\n+\n+\treturn 0;\n+}\n+\n+int SwIspLinaro::IspWorker::configure(const StreamConfiguration &inputCfg,\n+\t\t\t\t      const StreamConfiguration &outputCfg)\n+{\n+\tif (setDebayerInfo(inputCfg.pixelFormat) != 0) {\n+\t\tLOG(SoftwareIsp, Error)\n+\t\t\t<< \"Input format \" << inputCfg.pixelFormat\n+\t\t\t<< \"not supported\";\n+\t\treturn -EINVAL;\n+\t}\n+\n+\t/* check that:\n+\t * - output format is valid\n+\t * - output size matches the input size and is valid */\n+\tSizeRange outSizeRange = (*debayerInfo_->getOutSizes)(inputCfg.size);\n+\tif (debayerInfo_->outPixelFmt != outputCfg.pixelFormat ||\n+\t    outputCfg.size.isNull() || !outSizeRange.contains(outputCfg.size) ||\n+\t    (*debayerInfo_->getOutStride)(outputCfg.size) != outputCfg.stride) {\n+\t\tLOG(SoftwareIsp, Error)\n+\t\t\t<< \"Invalid output format/size/stride: \"\n+\t\t\t<< \"\\n  \" << outputCfg.pixelFormat << \" (\"\n+\t\t\t<< debayerInfo_->outPixelFmt << \")\"\n+\t\t\t<< \"\\n  \" << outputCfg.size << \" (\"\n+\t\t\t<< outSizeRange << \")\"\n+\t\t\t<< \"\\n  \" << outputCfg.stride << \" (\"\n+\t\t\t<< (*debayerInfo_->getOutStride)(outputCfg.size) << \")\";\n+\t\treturn -EINVAL;\n+\t}\n+\n+\twidth_ = inputCfg.size.width;\n+\theight_ = inputCfg.size.height;\n+\tstride_ = inputCfg.stride;\n+\n+\tBayerFormat bayerFormat =\n+\t\tBayerFormat::fromPixelFormat(inputCfg.pixelFormat);\n+\tswitch (bayerFormat.order) {\n+\tcase BayerFormat::BGGR:\n+\t\tredShift_ = Point(0, 0);\n+\t\tbreak;\n+\tcase BayerFormat::GBRG:\n+\t\tredShift_ = Point(1, 0);\n+\t\tbreak;\n+\tcase BayerFormat::GRBG:\n+\t\tredShift_ = Point(0, 1);\n+\t\tbreak;\n+\tcase BayerFormat::RGGB:\n+\tdefault:\n+\t\tredShift_ = Point(1, 1);\n+\t\tbreak;\n+\t}\n+\n+\toutStride_ = outputCfg.stride;\n+\toutHeight_ = outputCfg.size.height;\n+\n+\tLOG(SoftwareIsp, Info)\n+\t\t<< \"SoftwareISP configuration: \"\n+\t\t<< inputCfg.size << \"-\" << inputCfg.pixelFormat << \" -> \"\n+\t\t<< outputCfg.size << \"-\" << outputCfg.pixelFormat;\n+\n+\t/* set r/g/b gains to 1.0 until frame data collected */\n+\trNumerat_ = rDenomin_ = 1;\n+\tbNumerat_ = bDenomin_ = 1;\n+\tgNumerat_ = gDenomin_ = 1;\n+\n+\treturn 0;\n+}\n+\n+/* May not be called before SwIspLinaro::IspWorker::configure() */\n+unsigned int SwIspLinaro::IspWorker::outBufferSize()\n+{\n+\treturn outHeight_ * outStride_;\n+}\n+\n+std::vector<PixelFormat> SwIspLinaro::formats(PixelFormat inputFormat)\n+{\n+\tASSERT(ispWorker_ != nullptr);\n+\n+\treturn ispWorker_->formats(inputFormat);\n+}\n+\n+SizeRange SwIspLinaro::sizes(PixelFormat inputFormat, const Size &inputSize)\n+{\n+\tASSERT(ispWorker_ != nullptr);\n+\n+\treturn ispWorker_->sizes(inputFormat, inputSize);\n+}\n+\n+std::tuple<unsigned int, unsigned int>\n+SwIspLinaro::strideAndFrameSize(const PixelFormat &outputFormat, const Size &size)\n+{\n+\tASSERT(ispWorker_ != nullptr);\n+\n+\tunsigned int stride = ispWorker_->outStride(outputFormat, size);\n+\n+\treturn std::make_tuple(stride, stride * size.height);\n+}\n+\n+int SwIspLinaro::configure(const StreamConfiguration &inputCfg,\n+\t\t\t   const std::vector<std::reference_wrapper<StreamConfiguration>> &outputCfgs)\n+{\n+\tASSERT(ispWorker_ != nullptr);\n+\n+\tif (outputCfgs.size() != 1) {\n+\t\tLOG(SoftwareIsp, Error)\n+\t\t\t<< \"Unsupported number of output streams: \"\n+\t\t\t<< outputCfgs.size();\n+\t\treturn -EINVAL;\n+\t}\n+\n+\treturn ispWorker_->configure(inputCfg, outputCfgs[0]);\n+}\n+\n+int SwIspLinaro::exportBuffers(unsigned int output, unsigned int count,\n+\t\t\t       std::vector<std::unique_ptr<FrameBuffer>> *buffers)\n+{\n+\tASSERT(ispWorker_ != nullptr);\n+\n+\t/* single output for now */\n+\tif (output >= 1)\n+\t\treturn -EINVAL;\n+\n+\tunsigned int bufSize = ispWorker_->outBufferSize();\n+\n+\t/* TODO: allocate from dma_heap; memfd buffs aren't allowed in FrameBuffer */\n+\tfor (unsigned int i = 0; i < count; i++) {\n+\t\tstd::string name = \"frame-\" + std::to_string(i);\n+\n+\t\tconst int ispFd = memfd_create(name.c_str(), 0);\n+\t\tint ret = ftruncate(ispFd, bufSize);\n+\t\tif (ret < 0) {\n+\t\t\tLOG(SoftwareIsp, Error)\n+\t\t\t\t<< \"ftruncate() for memfd failed \"\n+\t\t\t\t<< strerror(-ret);\n+\t\t\treturn ret;\n+\t\t}\n+\n+\t\tFrameBuffer::Plane outPlane;\n+\t\toutPlane.fd = SharedFD(std::move(ispFd));\n+\t\toutPlane.offset = 0;\n+\t\toutPlane.length = bufSize;\n+\n+\t\tstd::vector<FrameBuffer::Plane> planes{ outPlane };\n+\t\tbuffers->emplace_back(std::make_unique<FrameBuffer>(std::move(planes)));\n+\t}\n+\n+\treturn count;\n+}\n+\n+int SwIspLinaro::queueBuffers(FrameBuffer *input,\n+\t\t\t      const std::map<unsigned int, FrameBuffer *> &outputs)\n+{\n+\tunsigned int mask = 0;\n+\n+\t/*\n+\t * Validate the outputs as a sanity check: at least one output is\n+\t * required, all outputs must reference a valid stream and no two\n+\t * outputs can reference the same stream.\n+\t */\n+\tif (outputs.empty())\n+\t\treturn -EINVAL;\n+\n+\tfor (auto [index, buffer] : outputs) {\n+\t\tif (!buffer)\n+\t\t\treturn -EINVAL;\n+\t\tif (index >= 1) /* only single stream atm */\n+\t\t\treturn -EINVAL;\n+\t\tif (mask & (1 << index))\n+\t\t\treturn -EINVAL;\n+\n+\t\tmask |= 1 << index;\n+\t}\n+\n+\tprocess(input, outputs.at(0));\n+\n+\treturn 0;\n+}\n+\n+int SwIspLinaro::start()\n+{\n+\tint ret = ipa_->start();\n+\tif (ret)\n+\t\treturn ret;\n+\n+\tispWorkerThread_.start();\n+\treturn 0;\n+}\n+\n+void SwIspLinaro::stop()\n+{\n+\tispWorkerThread_.exit();\n+\tispWorkerThread_.wait();\n+\n+\tipa_->stop();\n+}\n+\n+void SwIspLinaro::IspWorker::process(FrameBuffer *input, FrameBuffer *output)\n+{\n+\t/* Copy metadata from the input buffer */\n+\tFrameMetadata &metadata = output->_d()->metadata();\n+\tmetadata.status = input->metadata().status;\n+\tmetadata.sequence = input->metadata().sequence;\n+\tmetadata.timestamp = input->metadata().timestamp;\n+\n+\tMappedFrameBuffer in(input, MappedFrameBuffer::MapFlag::Read);\n+\tMappedFrameBuffer out(output, MappedFrameBuffer::MapFlag::Write);\n+\tif (!in.isValid() || !out.isValid()) {\n+\t\tLOG(SoftwareIsp, Error) << \"mmap-ing buffer(s) failed\";\n+\t\tmetadata.status = FrameMetadata::FrameError;\n+\t\tswIsp_->outputBufferReady.emit(output);\n+\t\tswIsp_->inputBufferReady.emit(input);\n+\t\treturn;\n+\t}\n+\n+\t(this->*debayerInfo_->debayer)(out.planes()[0].data(), in.planes()[0].data());\n+\tmetadata.planes()[0].bytesused = out.planes()[0].size();\n+\n+\t*swIsp_->sharedStats_ = stats_;\n+\tswIsp_->ispStatsReady.emit(0);\n+\n+\tswIsp_->outputBufferReady.emit(output);\n+\tswIsp_->inputBufferReady.emit(input);\n+}\n+\n+void SwIspLinaro::process(FrameBuffer *input, FrameBuffer *output)\n+{\n+\tispWorker_->invokeMethod(&SwIspLinaro::IspWorker::process,\n+\t\t\t\t ConnectionTypeQueued, input, output);\n+}\n+\n+REGISTER_SOFTWAREISP(SwIspLinaro)\n+\n+} /* namespace libcamera */\n",
    "prefixes": [
        "libcamera-devel",
        "RFC",
        "v2",
        "5/7"
    ]
}