{"id":14334,"url":"https://patchwork.libcamera.org/api/patches/14334/?format=json","web_url":"https://patchwork.libcamera.org/patch/14334/","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":"<20211026112340.110169-2-jeanmichel.hautbois@ideasonboard.com>","date":"2021-10-26T11:23:22","name":"[libcamera-devel,v5,01/19] ipa: ipu3: Document IPAIPU3 class interface","commit_ref":"346baa856bbd458ad408a4c021e768a66ab7728f","pull_url":null,"state":"accepted","archived":false,"hash":"632310e8c7e6a248234ea29b455327734257a8cd","submitter":{"id":75,"url":"https://patchwork.libcamera.org/api/people/75/?format=json","name":"Jean-Michel Hautbois","email":"jeanmichel.hautbois@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/14334/mbox/","series":[{"id":2658,"url":"https://patchwork.libcamera.org/api/series/2658/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2658","date":"2021-10-26T11:23:21","name":"Document IPU3 IPA","version":5,"mbox":"https://patchwork.libcamera.org/series/2658/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/14334/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/14334/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 AE604BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 26 Oct 2021 11:23:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 693146488B;\n\tTue, 26 Oct 2021 13:23:47 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BADF960124\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Oct 2021 13:23:44 +0200 (CEST)","from tatooine.ideasonboard.com (unknown\n\t[IPv6:2a01:e0a:169:7140:dce3:eb54:18d7:6f3d])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4EE74DBF;\n\tTue, 26 Oct 2021 13:23:44 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"aHL/b+QB\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1635247424;\n\tbh=eJefIjiY20JPAde93DTlPSiZilgWKsnTbQvVNOYo32I=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=aHL/b+QBlJt/bbuWsJkeNt+5158DWlRD53VhpkBnEVg8+1qF09XKtVHPVY535zq9I\n\tMTPTxvXZ9lI9ooN9bPaSZT9LHMMQrz8iWEqCthzAxdlEuEqAyLU7kwcK+rKZn8JH5+\n\tqiJaSjCjhVFF0Wymz0XnXD2ObHYBYrurBX5vl7hI=","From":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 26 Oct 2021 13:23:22 +0200","Message-Id":"<20211026112340.110169-2-jeanmichel.hautbois@ideasonboard.com>","X-Mailer":"git-send-email 2.32.0","In-Reply-To":"<20211026112340.110169-1-jeanmichel.hautbois@ideasonboard.com>","References":"<20211026112340.110169-1-jeanmichel.hautbois@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v5 01/19] ipa: ipu3: Document IPAIPU3\n\tclass interface","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The IPU3 IPA is maturing to a modular and extensible system capable of\nhandling specific algorithms for the processing blocks on the ImgU.\n\nProvide a top-level class documentation to provide an overview of the\nIPA, detailing what events are used and what algorithms are currently\nsupported, as well as the limitations currently imposed.\n\nSigned-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n---\n src/ipa/ipu3/ipu3.cpp | 68 +++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 68 insertions(+)","diff":"diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\nindex 65d3fd2c..9396926c 100644\n--- a/src/ipa/ipu3/ipu3.cpp\n+++ b/src/ipa/ipu3/ipu3.cpp\n@@ -179,6 +179,74 @@ using namespace std::literals::chrono_literals;\n \n namespace ipa::ipu3 {\n \n+/**\n+ * \\brief The IPU3 IPA implementation\n+ *\n+ * The IPU3 Pipeline defines an IPU3-specific interface for communication\n+ * between the PipelineHandler and the IPA module.\n+ *\n+ * We extend the IPAIPU3Interface to implement our algorithms and handle events\n+ * from the IPU3 PipelineHandler to satisfy requests from the application.\n+ *\n+ * At initialisation time, a CameraSensorHelper is instantiated to support\n+ * camera-specific calculations, while the default controls are computed, and\n+ * the algorithms are constructed and placed in an ordered list.\n+ *\n+ * The IPU3 ImgU operates with a grid layout to divide the overall frame into\n+ * rectangular cells of pixels. When the IPA is configured, we determine the\n+ * best grid for the statistics based on the pipeline handler Bayer Down Scaler\n+ * output size.\n+ *\n+ * Two main events are then handled to operate the IPU3 ImgU by populating its\n+ * parameter buffer, and adapting the settings of the sensor attached to the\n+ * IPU3 CIO2 through sensor-specific V4L2 controls.\n+ *\n+ * When the event \\a EventFillParams occurs we populate the ImgU parameter\n+ * buffer with settings to configure the device in preparation for handling the\n+ * frame queued in the Request.\n+ *\n+ * When the frame has completed processing, the ImgU will generate a statistics\n+ * buffer which is given to the IPA as part of the \\a EventStatReady event. At\n+ * this event we run the algorithms to parse the statistics and cache any\n+ * results for the next \\a EventFillParams event.\n+ *\n+ * The individual algorithms are split into modular components that are called\n+ * iteratively to allow them to process statistics from the ImgU in a defined\n+ * order.\n+ *\n+ * The current implementation supports three core algorithms:\n+ * - Automatic white balance (AWB)\n+ * - Automatic gain and exposure control (AGC)\n+ * - Black level correction (BLC)\n+ * - Tone mapping (Gamma)\n+ *\n+ * AWB is implemented using a Greyworld algorithm, and calculates the red and\n+ * blue gains to apply to generate a neutral grey frame overall.\n+ *\n+ * AGC is handled by calculating a histogram of the green channel to estimate an\n+ * analogue gain and shutter time which will provide a well exposed frame. A\n+ * low-pass IIR filter is used to smooth the changes to the sensor to reduce\n+ * perceivable steps.\n+ *\n+ * The tone mapping algorithm provides a gamma correction table to improve the\n+ * contrast of the scene.\n+ *\n+ * The black level compensation algorithm subtracts a hardcoded black level from\n+ * all pixels.\n+ *\n+ * The IPU3 ImgU has further processing blocks to support image quality\n+ * improvements through bayer and temporal noise reductions, however those are\n+ * not supported in the current implementation, and will use default settings as\n+ * provided by the kernel driver.\n+ *\n+ * Demosaicing is operating with the default parameters and could be further\n+ * optimised to provide improved sharpening coefficients, checker artifact\n+ * removal, and false color correction.\n+ *\n+ * Additional image enhancements can be made by providing lens and\n+ * sensor-specific tuning to adapt for Black Level compensation (BLC), Lens\n+ * shading correction (SHD) and Color correction (CCM).\n+ */\n class IPAIPU3 : public IPAIPU3Interface\n {\n public:\n","prefixes":["libcamera-devel","v5","01/19"]}