[{"id":18018,"web_url":"https://patchwork.libcamera.org/comment/18018/","msgid":"<9a038b46-f03c-288c-2c4d-242b2388d8fb@ideasonboard.com>","date":"2021-07-07T16:03:12","subject":"Re: [libcamera-devel] [PATCH v1 4/7] ipa: ipu3: use process method\n\tfor all algorithms","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi JM,\n\nOn 28/06/2021 21:22, Jean-Michel Hautbois wrote:\n> The main goal will be to have the same process() prototype for all\n> algorithms, each of them would then grab the values needed using a\n> metadata exchange way (for instance, current analogue gain, shutter time,\n> or red/blue gains calculated in the AWB algorithm from AGC, etc.).\n\nWe need to document how algorithms should operate, what is the expected\nflow and interactions and how does the IPA function overall.\n\nAs part of introducing this new method - I would expect to see updates\nto the documentation as to how the new API change is expected to be\nused, but we don't have /any/ documentation yet.\n\nThe goal is to define this in a way that describes how any algorithm\nwhich is used by libipa\n\nIdeally, the documentation should describe the design of how algorithms\nare called and expected to operate.\n\nWe have a libipa/algorithm.h which is where I would probably expect to\nsee this documentation.\n\nWhich also infers that this new ->process() call should be a member of\nthe base algorithm class?\n\nBut - we haven't been able to actually use the base class due to these\nmethods directly specifying / referencing IPU3 specific parameters.\n\n\nThat means that we can't have generic documentation for algorithms in\nlibipa - but we should have something for the IPU3 directly in that case.\n\nIdeally, then this documentation can be moved or used as part of the\ngeneric libipa abstractions.\n\n\n\n> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> ---\n>  src/ipa/ipu3/ipu3.cpp     | 2 +-\n>  src/ipa/ipu3/ipu3_awb.cpp | 5 +++++\n>  src/ipa/ipu3/ipu3_awb.h   | 3 ++-\n>  3 files changed, 8 insertions(+), 2 deletions(-)\n> \n> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\n> index f43f8620..4466391a 100644\n> --- a/src/ipa/ipu3/ipu3.cpp\n> +++ b/src/ipa/ipu3/ipu3.cpp\n> @@ -296,7 +296,7 @@ void IPAIPU3::parseStatistics(unsigned int frame,\n>  \tagcAlgo_->process(stats, exposure_, gain);\n>  \tgain_ = camHelper_->gainCode(gain);\n>  \n> -\tawbAlgo_->calculateWBGains(stats);\n> +\tawbAlgo_->process(stats);\n>  \n>  \tif (agcAlgo_->updateControls())\n>  \t\tsetControls(frame);\n> diff --git a/src/ipa/ipu3/ipu3_awb.cpp b/src/ipa/ipu3/ipu3_awb.cpp\n> index 9b409c8f..a94935c5 100644\n> --- a/src/ipa/ipu3/ipu3_awb.cpp\n> +++ b/src/ipa/ipu3/ipu3_awb.cpp\n> @@ -351,6 +351,11 @@ void IPU3Awb::calculateWBGains(const ipu3_uapi_stats_3a *stats)\n>  \t}\n>  }\n>  \n> +void IPU3Awb::process(const ipu3_uapi_stats_3a *stats)\n> +{\n> +\tcalculateWBGains(stats);\n> +}\n> +\n>  void IPU3Awb::updateWbParameters(ipu3_uapi_params &params, double agcGamma)\n>  {\n>  \t/*\n> diff --git a/src/ipa/ipu3/ipu3_awb.h b/src/ipa/ipu3/ipu3_awb.h\n> index f4100f4a..795e32e3 100644\n> --- a/src/ipa/ipu3/ipu3_awb.h\n> +++ b/src/ipa/ipu3/ipu3_awb.h\n> @@ -33,7 +33,7 @@ public:\n>  \t~IPU3Awb();\n>  \n>  \tvoid initialise(ipu3_uapi_params &params, const Size &bdsOutputSize, struct ipu3_uapi_grid_config &bdsGrid);\n> -\tvoid calculateWBGains(const ipu3_uapi_stats_3a *stats);\n> +\tvoid process(const ipu3_uapi_stats_3a *stats);\n>  \tvoid updateWbParameters(ipu3_uapi_params &params, double agcGamma);\n>  \n>  private:\n> @@ -42,6 +42,7 @@ private:\n>  \tvoid clearAwbStats();\n>  \tvoid awbGreyWorld();\n>  \tuint32_t estimateCCT(double red, double green, double blue);\n> +\tvoid calculateWBGains(const ipu3_uapi_stats_3a *stats);\n>  \n>  \tstruct ipu3_uapi_grid_config awbGrid_;\n>  \n>","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 5EE39C3224\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  7 Jul 2021 16:03:18 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B88696028E;\n\tWed,  7 Jul 2021 18:03:17 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A2D1060284\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  7 Jul 2021 18:03:15 +0200 (CEST)","from [192.168.0.20]\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3A8AC2E4;\n\tWed,  7 Jul 2021 18:03:15 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"nAChsSeB\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1625673795;\n\tbh=ZMq41EoZw5YHXgU4emMDmeGN7qno4T9q/frQ4XRsofk=;\n\th=To:References:From:Subject:Date:In-Reply-To:From;\n\tb=nAChsSeBccQULYoJSXoFFm1/r29jyHfp5sPdMc/G4uuq7dAxwVTUKype8qUIGEsR8\n\tvIcJ7MdgU+O+2HEYd10sve+iMZycoMhvd4IMyfmy1EunYCTfBTRXvo+9rjUFj7uFKW\n\tBukOICbITxB0YanAUcMblHIipnAW3iCAhH3plcow=","To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20210628202255.138874-1-jeanmichel.hautbois@ideasonboard.com>\n\t<20210628202255.138874-5-jeanmichel.hautbois@ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<9a038b46-f03c-288c-2c4d-242b2388d8fb@ideasonboard.com>","Date":"Wed, 7 Jul 2021 17:03:12 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.11.0","MIME-Version":"1.0","In-Reply-To":"<20210628202255.138874-5-jeanmichel.hautbois@ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH v1 4/7] ipa: ipu3: use process method\n\tfor all algorithms","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>"}}]