{"id":19262,"url":"https://patchwork.libcamera.org/api/covers/19262/?format=json","web_url":"https://patchwork.libcamera.org/cover/19262/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20231204001013.404720-1-andrey.konovalov@linaro.org>","date":"2023-12-04T00:10:06","name":"[libcamera-devel,RFC,0/7] libcamera: introduce Software ISP and Software IPA","submitter":{"id":25,"url":"https://patchwork.libcamera.org/api/people/25/?format=json","name":"Andrey Konovalov","email":"andrey.konovalov@linaro.org"},"mbox":"https://patchwork.libcamera.org/cover/19262/mbox/","series":[{"id":4096,"url":"https://patchwork.libcamera.org/api/series/4096/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4096","date":"2023-12-04T00:10:06","name":"libcamera: introduce Software ISP and Software IPA","version":1,"mbox":"https://patchwork.libcamera.org/series/4096/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/19262/comments/","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 DC740C3226\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  4 Dec 2023 00:10:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 30151629AD;\n\tMon,  4 Dec 2023 01:10:37 +0100 (CET)","from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com\n\t[IPv6:2a00:1450:4864:20::42d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CCE2D629AD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  4 Dec 2023 01:10:35 +0100 (CET)","by mail-wr1-x42d.google.com with SMTP id\n\tffacd0b85a97d-3316c6e299eso3371195f8f.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 03 Dec 2023 16:10:35 -0800 (PST)","from Lat-5310.. ([87.116.165.212]) by smtp.gmail.com with ESMTPSA\n\tid\n\tu29-20020adfa19d000000b003332db7d91dsm8835997wru.39.2023.12.03.16.10.34\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSun, 03 Dec 2023 16:10:35 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1701648638;\n\tbh=+e0PNE4utttoGieJ4PVEGh799g42QoXBhRXUSuJXb9U=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:Cc:From;\n\tb=sQ5QNTrLZjXFWn/pDK0JXze/64Ak9Ctzh/p68k/0selFVmqmbevgzSyMfNn/uPwte\n\twi3I1dlSINssD9rxmixk140pS4JjWohc9Y18R+7qh1bH8mfwmiNzAjb1v9jvcmaR8p\n\tHfxeQS/RyYYCJ+sg6obND96nMZh6NiZaov8FaWcFU2h8xZG60O7lZ6Lj47NVv1pWt5\n\tvB0W7UtkiArbmihO4ftX0jW/Xf0l0i0CEfKratyh3QbfDevNDnmqXM+PWdjymqgWHn\n\tMvNQedEBNiciuA+KXDBwtfyFFI6jH5vzkXsLpgYugjugQUI5nkPzLayeZ8y5M4dK2/\n\tnZ6bUpAjtNYRg==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linaro.org; s=google; t=1701648635; x=1702253435;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:from:to:cc:subject:date:message-id:reply-to;\n\tbh=H8DIcF0lhKcErB75vSHluuRs9rHPAfJJlhotNnBxcSk=;\n\tb=hpHMolsTxw3TDFlirRBRQYMUpyPmSbRfGlNjWUnfO537sc8zrN2koJVkUafOD8Kr1p\n\tnVBEGcZSUryDBFVerrB+335nHfHvP+srOA0Hp7uXC0Iry4LJAe+4EgvKvvUbRvvglDtE\n\tQwxy3t7yzh+0WMTbHv2oU3Bi3TN/d3KK7fSbGt0JWKAWBjOfXLFct/owPqNsOVGBaNoU\n\tI8C4Q3aS1VAgql1Kf2EQJcZIJ4vPVMeM3zURcsFuzhxkl5qQoT5cdV7PiSgUT5YYaI/q\n\tKd86563ikOYQQoJ/ek+VwENThNxlJVQi8ypLod35gT15n8YPHlPVzwanDl9kIG9mZCxZ\n\tGP1w=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=linaro.org\n\theader.i=@linaro.org header.b=\"hpHMolsT\"; \n\tdkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1701648635; x=1702253435;\n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=H8DIcF0lhKcErB75vSHluuRs9rHPAfJJlhotNnBxcSk=;\n\tb=T929aaIsGkRTeaX9LN8RVMqLvBpQTNagUUqGMUEuRxWIkQLNVARZ1CKpwWJ9wrZyWU\n\t0SxnTtanrxqwXkvcwCkMEceUfrBRzmXkkKTc/IISttohq8UTOhebkMODFYB0uj9AxEWC\n\tVcTeEWksrmK8aNJk40UtTQpwWByhVv6FAfth5Hvti+CJNL+oadZSdK2IO7WhPKska8of\n\tCsQyj3FP41Ui/OJs3mh7+XklQAGMqSOOYCoKIrPu5tjxDKbhJsmcn5adOupWTIO5Bd03\n\tQyGOJ1B1FmaWSwJqnvW9b/SuTP2SyaoUs8eVN3qd9mNgqA1nkbMCNbNKKz3diye4dkcX\n\tTpkw==","X-Gm-Message-State":"AOJu0YzgofVtz/4Fv3p4bUm60GL8RKz8cf3kfuiLKgo4dHKR/s5JMhXi\n\t++TRp+hGMYyM/bTaYhaM1adUtFrdK0hwDMEzwpM=","X-Google-Smtp-Source":"AGHT+IHqMiYdAb8jcKUiq3yIw5vaoZAlByQ7xo96J8VOyWVOGen8CcEQOa3IjJz/XxxAjBjND5SVFA==","X-Received":"by 2002:adf:f70d:0:b0:333:34c8:49f with SMTP id\n\tr13-20020adff70d000000b0033334c8049fmr1396870wrp.127.1701648635352; \n\tSun, 03 Dec 2023 16:10:35 -0800 (PST)","To":"libcamera-devel@lists.libcamera.org","Date":"Mon,  4 Dec 2023 03:10:06 +0300","Message-Id":"<20231204001013.404720-1-andrey.konovalov@linaro.org>","X-Mailer":"git-send-email 2.34.1","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [RFC PATCH 0/7] libcamera: introduce Software ISP\n\tand Software IPA","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, bryan.odonoghue@linaro.org,\n\tadmin@dennisbonke.com","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Here is a draft implementation of Software ISP and Software IPA\nwhich provide debayering and implementation of image processing\nalgorithms for systems without a hardware ISP, or in cases when\nthere are no public drivers for the hardware ISP present in the\nsystem.\n\nThe implementation of the Software ISP is a reference one.\nA naive AWB alorithm is implemented as part of a function which\ndoes debayering and statistics calculations - the algorithm part\nis to be moved to the IPA in the next version of the patch set.\nAnd for debayering itself there is already a more efficient\nimplementation by Hans de Goede. This patch set is currently using\nthe earlier debayering implementation as it is less lines of code\nand is OK for the initial discussion.\nOnly RAW10P format from the sensor is currently supported, but\nother debayering functions can be easily added (which of them to\ncall is decided based on the input format).\n\nThe Software IPA has only auto exposure and AGC. For the AGC\nthe analogue gain control of the camera sensor is used (if\navailable). The algorithm is very much simplified, and is\nmostly included as a reference code.\n\nThe 6th patch renames some variables in the simple pipeline\nhandler for the Software ISP to use the same buffer handling\ncode as the Converter currently does. This lets one to\navoid adding extra code to the pipeline handler, but also\nmakes the Software ISP and the Converter mutually exclusive.\n\nThe Software ISP / IPA are intended to be used with the simple\npipeline handler. The proper integration isn't done yet, and\nthe last patch in this series unconditionally creates the\nSoftware ISP and Software IPA instances if the pipeline is\nnot using a Converter. In the future the Software ISP / IPA\nwould be created if the media pipeline can only produce raw\nBayer frames. And a possibility to use different implementations\nof Software ISP and IPA will be added.\n\nThis patch set uses SharedMemObject class used by the RPi pipeline\nhandler - the second patch in the series moves the header file\nto a common directory.\n\nThis patch set has been tested on Qualcomm RB5 board with\na mezzanine board equipped with RPi camera v2 (not the\nstandard RB5 camera mezzanine).\n\nAndrey Konovalov (7):\n  libcamera: introduce SoftwareIsp class\n  libcamera: internal: Move SharedMemObject class to a common directory\n  libcamera: software_isp: add SwIspLinaro implementation of SoftwareIsp\n  libcamera: ipa: add Soft IPA\n  libcamera: software_isp: introduce getStatsFD()\n  libcamera: pipeline: simple: rename converterBuffers_ and related vars\n  [DNI] libcamera: pipeline: simple: enable use of SoftwareISP and Soft\n    IPA\n\n include/libcamera/internal/meson.build        |   3 +\n .../libcamera/internal}/shared_mem_object.h   |   4 -\n include/libcamera/internal/software_isp.h     |  71 +++\n .../internal/software_isp/meson.build         |   6 +\n .../internal/software_isp/statistics-linaro.h |  17 +\n .../internal/software_isp/swisp_linaro.h      | 111 ++++\n include/libcamera/ipa/meson.build             |   1 +\n include/libcamera/ipa/soft.mojom              |  27 +\n meson_options.txt                             |   3 +-\n src/ipa/simple/common/meson.build             |  17 +\n src/ipa/simple/common/soft_base.cpp           |  66 +++\n src/ipa/simple/common/soft_base.h             |  47 ++\n src/ipa/simple/linaro/data/meson.build        |   8 +\n src/ipa/simple/linaro/data/soft.conf          |   3 +\n src/ipa/simple/linaro/meson.build             |  26 +\n src/ipa/simple/linaro/soft_linaro.cpp         | 210 +++++++\n src/ipa/simple/meson.build                    |  12 +\n src/libcamera/meson.build                     |   2 +\n src/libcamera/pipeline/simple/simple.cpp      | 193 +++++--\n src/libcamera/software_isp.cpp                |  25 +\n src/libcamera/software_isp/meson.build        |   5 +\n src/libcamera/software_isp/swisp_linaro.cpp   | 539 ++++++++++++++++++\n 22 files changed, 1339 insertions(+), 57 deletions(-)\n rename {src/libcamera/pipeline/rpi/common => include/libcamera/internal}/shared_mem_object.h (98%)\n create mode 100644 include/libcamera/internal/software_isp.h\n create mode 100644 include/libcamera/internal/software_isp/meson.build\n create mode 100644 include/libcamera/internal/software_isp/statistics-linaro.h\n create mode 100644 include/libcamera/internal/software_isp/swisp_linaro.h\n create mode 100644 include/libcamera/ipa/soft.mojom\n create mode 100644 src/ipa/simple/common/meson.build\n create mode 100644 src/ipa/simple/common/soft_base.cpp\n create mode 100644 src/ipa/simple/common/soft_base.h\n create mode 100644 src/ipa/simple/linaro/data/meson.build\n create mode 100644 src/ipa/simple/linaro/data/soft.conf\n create mode 100644 src/ipa/simple/linaro/meson.build\n create mode 100644 src/ipa/simple/linaro/soft_linaro.cpp\n create mode 100644 src/ipa/simple/meson.build\n create mode 100644 src/libcamera/software_isp.cpp\n create mode 100644 src/libcamera/software_isp/meson.build\n create mode 100644 src/libcamera/software_isp/swisp_linaro.cpp"}