[{"id":30109,"web_url":"https://patchwork.libcamera.org/comment/30109/","msgid":"<1620ee27-387a-4198-a9d7-0c8b85006dc9@ideasonboard.com>","date":"2024-06-28T03:37:13","subject":"Re: [PATCH 04/19] libcamera: software_isp: Define skeletons for IPA\n\trefactoring","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Milan,\n\nThank you for the patch.\n\nOn 26/06/24 12:50 pm, Milan Zamazal wrote:\n> Software ISP image processing algorithms are currently defined in a\n> simplified way, different from other libcamera pipelines.  This is not\n> good for several reasons:\n>\n> - It makes the software ISP code harder to understand due to its\n>    different structuring.\n> - Adding more algorithms may make the code harder to understand\n>    generally.\n> - Mass libcamera code changes may not be easily applicable to software\n>    ISP.\n> - Algorithm sharing with other pipelines is not easily possible.\n>\n> This patch introduces basic software ISP IPA skeletons structured\n> similarly to the other pipelines.  The newly added files are currently\n> not used or compiled and the general skeleton structures don't contain\n> anything particular.  It is just a preparation step for a larger\n> refactoring and the code will be actually used and extended as needed in\n> followup patches.\n>\n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n\nI think you also need a ipa_context.cpp here, to document(doxygen \ngenerate) the structures in ipa_context.h, like done in other IPAs.\n(and obviously it should be compiled).\n\n> ---\n>   src/ipa/simple/algorithms/algorithm.h | 22 +++++++++++++++++\n>   src/ipa/simple/ipa_context.h          | 34 +++++++++++++++++++++++++++\n>   src/ipa/simple/module.h               | 30 +++++++++++++++++++++++\n>   3 files changed, 86 insertions(+)\n>   create mode 100644 src/ipa/simple/algorithms/algorithm.h\n>   create mode 100644 src/ipa/simple/ipa_context.h\n>   create mode 100644 src/ipa/simple/module.h\n>\n> diff --git a/src/ipa/simple/algorithms/algorithm.h b/src/ipa/simple/algorithms/algorithm.h\n> new file mode 100644\n> index 00000000..41f63170\n> --- /dev/null\n> +++ b/src/ipa/simple/algorithms/algorithm.h\n> @@ -0,0 +1,22 @@\n> +/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> +/*\n> + * Copyright (C) 2024 Red Hat, Inc.\n> + *\n> + * Software ISP control algorithm interface\n> + */\n> +\n> +#pragma once\n> +\n> +#include <libipa/algorithm.h>\n> +\n> +#include \"module.h\"\n> +\n> +namespace libcamera {\n> +\n> +namespace ipa::soft {\n> +\n> +using Algorithm = libcamera::ipa::Algorithm<Module>;\n> +\n> +} /* namespace ipa::soft */\n> +\n> +} /* namespace libcamera */\n> diff --git a/src/ipa/simple/ipa_context.h b/src/ipa/simple/ipa_context.h\n> new file mode 100644\n> index 00000000..bc1235b6\n> --- /dev/null\n> +++ b/src/ipa/simple/ipa_context.h\n> @@ -0,0 +1,34 @@\n> +/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> +/*\n> + * Copyright (C) 2024 Red Hat, Inc.\n> + *\n> + * Simple pipeline IPA Context\n> + *\n> + */\n> +\n> +#pragma once\n> +\n> +#include <libipa/fc_queue.h>\n> +\n> +namespace libcamera {\n> +\n> +namespace ipa::soft {\n> +\n> +struct IPASessionConfiguration {\n> +};\n> +\n> +struct IPAActiveState {\n> +};\n> +\n> +struct IPAFrameContext : public FrameContext {\n> +};\n> +\n> +struct IPAContext {\n> +\tIPASessionConfiguration configuration;\n> +\tIPAActiveState activeState;\n> +\tFCQueue<IPAFrameContext> frameContexts;\n> +};\n> +\n> +} /* namespace ipa::soft */\n> +\n> +} /* namespace libcamera */\n> diff --git a/src/ipa/simple/module.h b/src/ipa/simple/module.h\n> new file mode 100644\n> index 00000000..21328ecd\n> --- /dev/null\n> +++ b/src/ipa/simple/module.h\n> @@ -0,0 +1,30 @@\n> +/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> +/*\n> + * Copyright (C) 2024 Red Hat, Inc.\n> + *\n> + * Software ISP IPA Module\n> + */\n> +\n> +#pragma once\n> +\n> +#include <libcamera/controls.h>\n> +\n> +#include <libcamera/ipa/core_ipa_interface.h>\n> +\n> +#include \"libcamera/internal/software_isp/debayer_params.h\"\n> +#include \"libcamera/internal/software_isp/swisp_stats.h\"\n> +\n> +#include <libipa/module.h>\n> +\n> +#include \"ipa_context.h\"\n> +\n> +namespace libcamera {\n> +\n> +namespace ipa::soft {\n> +\n> +using Module = ipa::Module<IPAContext, IPAFrameContext, ControlInfoMap,\n> +\t\t\t   DebayerParams, SwIspStats>;\n> +\n> +} /* namespace ipa::soft */\n> +\n> +} /* namespace libcamera */","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 333FCBD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 28 Jun 2024 03:37:21 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9C39B62C9C;\n\tFri, 28 Jun 2024 05:37:20 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 16C1262C98\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 28 Jun 2024 05:37:19 +0200 (CEST)","from [IPV6:2405:201:2015:f873:55d7:c02e:b2eb:ee3f] (unknown\n\t[IPv6:2405:201:2015:f873:55d7:c02e:b2eb:ee3f])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 40929BEB;\n\tFri, 28 Jun 2024 05:36:54 +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=\"K3QWhjYl\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1719545814;\n\tbh=BL6dsfhWQv7UlI/qlWYTgSlNvcmKd/jPAHDFpq27hg0=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=K3QWhjYlN0GRofSkfiumKYyCUGkcKLGFFipqP5J98OpYJL50UOH2giMjn8YRGwrY1\n\t0nqyMH597r/a4QhB/Gc6qCnHEqzIQyqUr8eqJPooixCwiHCIdwbOtI+5Olh/OP/uHK\n\tPi/6InsRKRKJacZn6+o7x/QI3U6KmID52sO26hkA=","Message-ID":"<1620ee27-387a-4198-a9d7-0c8b85006dc9@ideasonboard.com>","Date":"Fri, 28 Jun 2024 09:07:13 +0530","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 04/19] libcamera: software_isp: Define skeletons for IPA\n\trefactoring","Content-Language":"en-US","To":"Milan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","References":"<20240626072100.55497-1-mzamazal@redhat.com>\n\t<20240626072100.55497-5-mzamazal@redhat.com>","From":"Umang Jain <umang.jain@ideasonboard.com>","In-Reply-To":"<20240626072100.55497-5-mzamazal@redhat.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","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>"}}]