[{"id":20466,"web_url":"https://patchwork.libcamera.org/comment/20466/","msgid":"<YXcg7xZhugb9fs0d@pendragon.ideasonboard.com>","date":"2021-10-25T21:26:07","subject":"Re: [libcamera-devel] [PATCH v3 10/19] ipa: ipu3: tonemapping: Add\n\tthe documentation for ToneMapping","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jean-Michel,\n\nThank you for the patch.\n\nOn Fri, Oct 22, 2021 at 05:12:09PM +0200, Jean-Michel Hautbois wrote:\n> The Tone mapping algorithm is currently undocumented.\n\ns/Tone/tone/\n\n> Provide an introduction and overview to the implementation as the class\n> definition and document how the algorithm operates in the process and\n> prepare methods.\n> \n> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n> v3:\n> - rename gamma control as tone mapping\n> ---\n>  src/ipa/ipu3/algorithms/tone_mapping.cpp | 30 +++++++++++++++++++++++-\n>  1 file changed, 29 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/ipa/ipu3/algorithms/tone_mapping.cpp b/src/ipa/ipu3/algorithms/tone_mapping.cpp\n> index 8fa8c7e9..832e5670 100644\n> --- a/src/ipa/ipu3/algorithms/tone_mapping.cpp\n> +++ b/src/ipa/ipu3/algorithms/tone_mapping.cpp\n> @@ -10,10 +10,22 @@\n>  #include <cmath>\n>  #include <string.h>\n>  \n> +/**\n> + * \\file tone_mapping.h\n> + */\n> +\n>  namespace libcamera {\n>  \n>  namespace ipa::ipu3::algorithms {\n>  \n> +/**\n> + * \\class ToneMapping\n> + * \\brief A class to handle tone mapping based on gamma\n> + *\n> + * This algorithm improves the image dynamic using a look-up table which is\n> + * generated based on a gamma parameter.\n> + */\n> +\n>  ToneMapping::ToneMapping()\n>  \t: gamma_(1.0)\n>  {\n> @@ -35,6 +47,14 @@ int ToneMapping::configure(IPAContext &context,\n>  \treturn 0;\n>  }\n>  \n> +/**\n> + * \\brief Fill in the parameter structure, and enable gamma control\n> + * \\param context The shared IPA context\n> + * \\param params The IPU3 parameters\n> + *\n> + * Populate the IPU3 parameter structure with our tone mapping look up table and\n> + * enable the gamma control module in the processing blocks.\n> + */\n>  void ToneMapping::prepare([[maybe_unused]] IPAContext &context,\n>  \t\t\t  ipu3_uapi_params *params)\n>  {\n> @@ -49,7 +69,15 @@ void ToneMapping::prepare([[maybe_unused]] IPAContext &context,\n>  \tparams->acc_param.gamma.gc_ctrl.enable = 1;\n>  }\n>  \n> -void ToneMapping::process([[maybe_unused]] IPAContext &context,\n> +/**\n> + * \\brief Calculate the tone mapping look up table\n> + * \\param context The shared IPA context\n> + * \\param stats The IPU3 statistics and ISP results\n> + *\n> + * The tone mapping look up table is generated as an inverse power curve from\n> + * our gamma setting.\n> + */\n> +void ToneMapping::process(IPAContext &context,\n>  \t\t\t  [[maybe_unused]] const ipu3_uapi_stats_3a *stats)\n>  {\n>  \t/*","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 E8BE2BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 25 Oct 2021 21:26:31 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A277D64878;\n\tMon, 25 Oct 2021 23:26:31 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1829E60125\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 25 Oct 2021 23:26:31 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9FD7EE0A;\n\tMon, 25 Oct 2021 23:26:30 +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=\"umnhUQ3p\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1635197190;\n\tbh=iXEzIVFHGw/Okt+lKcLd/rcGr74MxkV49OkqdmsJZms=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=umnhUQ3pYeKNwdLMgQ25hP4Z1h1Bv+vawBxsY7IF8s8YHU2NEUKNn+8iFIo+Wv8a4\n\tGEwEZX+O2WqxViOqyAZn40lSk8XhDVJR0jwQ4RWt0vCZCXGZoaOGhbPvP58G1/bG7b\n\t6dFIi3iaq69ikEkswBIOVkygOFW+CHwdvK7SC1xg=","Date":"Tue, 26 Oct 2021 00:26:07 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","Message-ID":"<YXcg7xZhugb9fs0d@pendragon.ideasonboard.com>","References":"<20211022151218.111966-1-jeanmichel.hautbois@ideasonboard.com>\n\t<20211022151218.111966-11-jeanmichel.hautbois@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20211022151218.111966-11-jeanmichel.hautbois@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v3 10/19] ipa: ipu3: tonemapping: Add\n\tthe documentation for ToneMapping","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":20470,"web_url":"https://patchwork.libcamera.org/comment/20470/","msgid":"<163519764581.1095920.16247518607056485224@Monstersaurus>","date":"2021-10-25T21:34:05","subject":"Re: [libcamera-devel] [PATCH v3 10/19] ipa: ipu3: tonemapping: Add\n\tthe documentation for ToneMapping","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2021-10-25 22:26:07)\n> Hi Jean-Michel,\n> \n> Thank you for the patch.\n> \n> On Fri, Oct 22, 2021 at 05:12:09PM +0200, Jean-Michel Hautbois wrote:\n> > The Tone mapping algorithm is currently undocumented.\n> \n> s/Tone/tone/\n> \n> > Provide an introduction and overview to the implementation as the class\n> > definition and document how the algorithm operates in the process and\n> > prepare methods.\n> > \n> > Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> > ---\n> > v3:\n> > - rename gamma control as tone mapping\n> > ---\n> >  src/ipa/ipu3/algorithms/tone_mapping.cpp | 30 +++++++++++++++++++++++-\n> >  1 file changed, 29 insertions(+), 1 deletion(-)\n> > \n> > diff --git a/src/ipa/ipu3/algorithms/tone_mapping.cpp b/src/ipa/ipu3/algorithms/tone_mapping.cpp\n> > index 8fa8c7e9..832e5670 100644\n> > --- a/src/ipa/ipu3/algorithms/tone_mapping.cpp\n> > +++ b/src/ipa/ipu3/algorithms/tone_mapping.cpp\n> > @@ -10,10 +10,22 @@\n> >  #include <cmath>\n> >  #include <string.h>\n> >  \n> > +/**\n> > + * \\file tone_mapping.h\n> > + */\n> > +\n> >  namespace libcamera {\n> >  \n> >  namespace ipa::ipu3::algorithms {\n> >  \n> > +/**\n> > + * \\class ToneMapping\n> > + * \\brief A class to handle tone mapping based on gamma\n> > + *\n> > + * This algorithm improves the image dynamic using a look-up table which is\n> > + * generated based on a gamma parameter.\n> > + */\n> > +\n> >  ToneMapping::ToneMapping()\n> >       : gamma_(1.0)\n> >  {\n> > @@ -35,6 +47,14 @@ int ToneMapping::configure(IPAContext &context,\n> >       return 0;\n> >  }\n> >  \n> > +/**\n> > + * \\brief Fill in the parameter structure, and enable gamma control\n> > + * \\param context The shared IPA context\n> > + * \\param params The IPU3 parameters\n> > + *\n> > + * Populate the IPU3 parameter structure with our tone mapping look up table and\n> > + * enable the gamma control module in the processing blocks.\n> > + */\n> >  void ToneMapping::prepare([[maybe_unused]] IPAContext &context,\n> >                         ipu3_uapi_params *params)\n> >  {\n> > @@ -49,7 +69,15 @@ void ToneMapping::prepare([[maybe_unused]] IPAContext &context,\n> >       params->acc_param.gamma.gc_ctrl.enable = 1;\n> >  }\n> >  \n> > -void ToneMapping::process([[maybe_unused]] IPAContext &context,\n> > +/**\n> > + * \\brief Calculate the tone mapping look up table\n> > + * \\param context The shared IPA context\n> > + * \\param stats The IPU3 statistics and ISP results\n> > + *\n> > + * The tone mapping look up table is generated as an inverse power curve from\n> > + * our gamma setting.\n> > + */\n> > +void ToneMapping::process(IPAContext &context,\n> >                         [[maybe_unused]] const ipu3_uapi_stats_3a *stats)\n> >  {\n> >       /*\n> \n> -- \n> Regards,\n> \n> Laurent Pinchart","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 B9D25BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 25 Oct 2021 21:34:09 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 305066487A;\n\tMon, 25 Oct 2021 23:34:09 +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 67E9560125\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 25 Oct 2021 23:34:08 +0200 (CEST)","from pendragon.ideasonboard.com\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 00D64E0A;\n\tMon, 25 Oct 2021 23:34:07 +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=\"k18vRISj\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1635197648;\n\tbh=biIv6PmfvIDF6Vbyly+vdF4RwUV9sg+5K7HgXoQF0ao=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=k18vRISj8bM78ZC0eEHPdHFpM4/UcOfPLguNwNS56k5ia7rU/a5cjZwLBkdHIcQOt\n\tJkUyjNaSqP6WMTnzoQd9e5mVTwjDXipsnlO0puJbjzvBuk5buaUotP94XopVlBI6yJ\n\tTadbDjDaGg9Vs3G/zbOA/w1/w0VvRclRSXI7AAwM=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<YXcg7xZhugb9fs0d@pendragon.ideasonboard.com>","References":"<20211022151218.111966-1-jeanmichel.hautbois@ideasonboard.com>\n\t<20211022151218.111966-11-jeanmichel.hautbois@ideasonboard.com>\n\t<YXcg7xZhugb9fs0d@pendragon.ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","Date":"Mon, 25 Oct 2021 22:34:05 +0100","Message-ID":"<163519764581.1095920.16247518607056485224@Monstersaurus>","User-Agent":"alot/0.9.1","Subject":"Re: [libcamera-devel] [PATCH v3 10/19] ipa: ipu3: tonemapping: Add\n\tthe documentation for ToneMapping","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]