[{"id":24165,"web_url":"https://patchwork.libcamera.org/comment/24165/","msgid":"<YuCYW2qYMEFda7Pl@pendragon.ideasonboard.com>","date":"2022-07-27T01:43:55","subject":"Re: [libcamera-devel] [PATCH 11/17] ipa: raspberrypi: Change to C\n\tstyle code comments","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Naush,\n\nThank you for the patch.\n\nOn Tue, Jul 26, 2022 at 01:45:43PM +0100, Naushir Patuck wrote:\n> As part of the on-going refactor efforts for the source files in\n> src/ipa/raspberrypi/, switch all C++ style comments to C style comments.\n> \n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  src/ipa/raspberrypi/cam_helper.hpp            |  98 ++++---\n>  .../raspberrypi/controller/agc_algorithm.hpp  |   4 +-\n>  src/ipa/raspberrypi/controller/agc_status.h   |  18 +-\n>  src/ipa/raspberrypi/controller/algorithm.cpp  |   2 +-\n>  src/ipa/raspberrypi/controller/algorithm.hpp  |  16 +-\n>  src/ipa/raspberrypi/controller/alsc_status.h  |   6 +-\n>  .../raspberrypi/controller/awb_algorithm.hpp  |   4 +-\n>  src/ipa/raspberrypi/controller/awb_status.h   |   6 +-\n>  .../controller/black_level_status.h           |   4 +-\n>  src/ipa/raspberrypi/controller/camera_mode.h  |  30 +-\n>  .../raspberrypi/controller/ccm_algorithm.hpp  |   4 +-\n>  src/ipa/raspberrypi/controller/ccm_status.h   |   2 +-\n>  .../controller/contrast_algorithm.hpp         |   4 +-\n>  .../raspberrypi/controller/contrast_status.h  |   6 +-\n>  src/ipa/raspberrypi/controller/controller.cpp |   6 +-\n>  src/ipa/raspberrypi/controller/controller.hpp |  20 +-\n>  .../controller/denoise_algorithm.hpp          |   4 +-\n>  .../raspberrypi/controller/denoise_status.h   |   2 +-\n>  src/ipa/raspberrypi/controller/dpc_status.h   |   4 +-\n>  src/ipa/raspberrypi/controller/focus_status.h |   8 +-\n>  src/ipa/raspberrypi/controller/geq_status.h   |   2 +-\n>  src/ipa/raspberrypi/controller/histogram.cpp  |   8 +-\n>  src/ipa/raspberrypi/controller/histogram.hpp  |  18 +-\n>  src/ipa/raspberrypi/controller/lux_status.h   |  18 +-\n>  src/ipa/raspberrypi/controller/metadata.hpp   |  20 +-\n>  src/ipa/raspberrypi/controller/noise_status.h |   2 +-\n>  src/ipa/raspberrypi/controller/pwl.cpp        |  40 ++-\n>  src/ipa/raspberrypi/controller/pwl.hpp        |  60 ++--\n>  src/ipa/raspberrypi/controller/rpi/agc.cpp    | 269 +++++++++++-------\n>  src/ipa/raspberrypi/controller/rpi/agc.hpp    |  24 +-\n>  src/ipa/raspberrypi/controller/rpi/alsc.cpp   | 180 +++++++-----\n>  src/ipa/raspberrypi/controller/rpi/alsc.hpp   |  50 ++--\n>  src/ipa/raspberrypi/controller/rpi/awb.cpp    | 192 ++++++++-----\n>  src/ipa/raspberrypi/controller/rpi/awb.hpp    | 112 ++++----\n>  .../controller/rpi/black_level.cpp            |  10 +-\n>  .../controller/rpi/black_level.hpp            |   4 +-\n>  src/ipa/raspberrypi/controller/rpi/ccm.cpp    |  20 +-\n>  src/ipa/raspberrypi/controller/rpi/ccm.hpp    |   4 +-\n>  .../raspberrypi/controller/rpi/contrast.cpp   |  74 +++--\n>  .../raspberrypi/controller/rpi/contrast.hpp   |   8 +-\n>  src/ipa/raspberrypi/controller/rpi/dpc.cpp    |  10 +-\n>  src/ipa/raspberrypi/controller/rpi/dpc.hpp    |   4 +-\n>  src/ipa/raspberrypi/controller/rpi/geq.cpp    |  10 +-\n>  src/ipa/raspberrypi/controller/rpi/geq.hpp    |   6 +-\n>  src/ipa/raspberrypi/controller/rpi/lux.cpp    |  16 +-\n>  src/ipa/raspberrypi/controller/rpi/lux.hpp    |  14 +-\n>  src/ipa/raspberrypi/controller/rpi/noise.cpp  |  24 +-\n>  src/ipa/raspberrypi/controller/rpi/noise.hpp  |   6 +-\n>  src/ipa/raspberrypi/controller/rpi/sdn.cpp    |  12 +-\n>  src/ipa/raspberrypi/controller/rpi/sdn.hpp    |   4 +-\n>  .../raspberrypi/controller/rpi/sharpen.cpp    |  32 ++-\n>  .../raspberrypi/controller/rpi/sharpen.hpp    |   4 +-\n>  .../controller/sharpen_algorithm.hpp          |   4 +-\n>  .../raspberrypi/controller/sharpen_status.h   |  10 +-\n>  src/ipa/raspberrypi/md_parser.hpp             |   2 +-\n>  55 files changed, 890 insertions(+), 631 deletions(-)\n\n[snip]\n\n> diff --git a/src/ipa/raspberrypi/controller/rpi/awb.cpp b/src/ipa/raspberrypi/controller/rpi/awb.cpp\n> index a305237f31fb..4a7bc869cee4 100644\n> --- a/src/ipa/raspberrypi/controller/rpi/awb.cpp\n> +++ b/src/ipa/raspberrypi/controller/rpi/awb.cpp\n\n[snip]\n\n> @@ -383,14 +401,16 @@ void Awb::prepareStats()\n>  \n>  double Awb::computeDelta2Sum(double gainR, double gainB)\n>  {\n> -\t// Compute the sum of the squared colour error (non-greyness) as it\n> -\t// appears in the log likelihood equation.\n> +\t/*\n> +\t * Compute the sum of the squared colour error (non-greyness) as it\n> +\t * appears in the log likelihood equation.\n> +\t */\n>  \tdouble delta2Sum = 0;\n>  \tfor (auto &z : zones_) {\n>  \t\tdouble deltaR = gainR * z.R - 1 - config_.whitepointR;\n>  \t\tdouble deltaB = gainB * z.B - 1 - config_.whitepointB;\n>  \t\tdouble delta2 = deltaR * deltaR + deltaB * deltaB;\n> -\t\t//LOG(RPiAwb, Debug) << \"delta_r \" << delta_r << \" delta_b \" << delta_b << \" delta2 \" << delta2;\n> +\t\t/*LOG(RPiAwb, Debug) << \"delta_r \" << delta_r << \" delta_b \" << delta_b << \" delta2 \" << delta2; */\n\nMissing space after /*.\n\n>  \t\tdelta2 = std::min(delta2, config_.deltaLimit);\n>  \t\tdelta2Sum += delta2;\n>  \t}\n\n[snip]\n\n> diff --git a/src/ipa/raspberrypi/controller/rpi/awb.hpp b/src/ipa/raspberrypi/controller/rpi/awb.hpp\n> index 91251d6be2da..597f3182da44 100644\n> --- a/src/ipa/raspberrypi/controller/rpi/awb.hpp\n> +++ b/src/ipa/raspberrypi/controller/rpi/awb.hpp\n> @@ -16,63 +16,73 @@\n>  \n>  namespace RPiController {\n>  \n> -// Control algorithm to perform AWB calculations.\n> +/* Control algorithm to perform AWB calculations. */\n>  \n>  struct AwbMode {\n>  \tvoid read(boost::property_tree::ptree const &params);\n> -\tdouble ctLo; // low CT value for search\n> -\tdouble ctHi; // high CT value for search\n> +\tdouble ctLo; /* low CT value for search */\n> +\tdouble ctHi; /* high CT value for search */\n>  };\n>  \n>  struct AwbPrior {\n>  \tvoid read(boost::property_tree::ptree const &params);\n> -\tdouble lux; // lux level\n> -\tPwl prior; // maps CT to prior log likelihood for this lux level\n> +\tdouble lux; /* lux level */\n> +\tPwl prior; /* maps CT to prior log likelihood for this lux level */\n>  };\n>  \n>  struct AwbConfig {\n>  \tAwbConfig() : defaultMode(nullptr) {}\n>  \tvoid read(boost::property_tree::ptree const &params);\n> -\t// Only repeat the AWB calculation every \"this many\" frames\n> +\t/* Only repeat the AWB calculation every \"this many\" frames */\n>  \tuint16_t framePeriod;\n> -\t// number of initial frames for which speed taken as 1.0 (maximum)\n> +\t/* number of initial frames for which speed taken as 1.0 (maximum) */\n>  \tuint16_t startupFrames;\n> -\tunsigned int convergenceFrames; // approx number of frames to converge\n> -\tdouble speed; // IIR filter speed applied to algorithm results\n> -\tbool fast; // \"fast\" mode uses a 16x16 rather than 32x32 grid\n> -\tPwl ctR; // function maps CT to r (= R/G)\n> -\tPwl ctB; // function maps CT to b (= B/G)\n> -\t// table of illuminant priors at different lux levels\n> +\tunsigned int convergenceFrames; /* approx number of frames to converge */\n> +\tdouble speed; /* IIR filter speed applied to algorithm results */\n> +\tbool fast; /* \"fast\" mode uses a 16x16 rather than 32x32 grid */\n> +\tPwl ctR; /* function maps CT to r (= R/G) */\n> +\tPwl ctB; /*\n> +\tPwl ctB;  * function maps CT to b (= B/G)\n> +\t * table of illuminant priors at different lux levels\n> +\t */\n\nThis doesn't look right.\n\n>  \tstd::vector<AwbPrior> priors;\n> -\t// AWB \"modes\" (determines the search range)\n> +\t/* AWB \"modes\" (determines the search range) */\n>  \tstd::map<std::string, AwbMode> modes;\n> -\tAwbMode *defaultMode; // mode used if no mode selected\n> -\t// minimum proportion of pixels counted within AWB region for it to be\n> -\t// \"useful\"\n> +\tAwbMode *defaultMode; /* mode used if no mode selected */\n> +\t/*\n> +\t * minimum proportion of pixels counted within AWB region for it to be\n> +\t * \"useful\"\n> +\t */\n>  \tdouble minPixels;\n> -\t// minimum G value of those pixels, to be regarded a \"useful\"\n> +\t/* minimum G value of those pixels, to be regarded a \"useful\" */\n>  \tuint16_t minG;\n> -\t// number of AWB regions that must be \"useful\" in order to do the AWB\n> -\t// calculation\n> +\t/*\n> +\t * number of AWB regions that must be \"useful\" in order to do the AWB\n> +\t * calculation\n> +\t */\n>  \tuint32_t minRegions;\n> -\t// clamp on colour error term (so as not to penalise non-grey excessively)\n> +\t/* clamp on colour error term (so as not to penalise non-grey excessively) */\n>  \tdouble deltaLimit;\n> -\t// step size control in coarse search\n> +\t/* step size control in coarse search */\n>  \tdouble coarseStep;\n> -\t// how far to wander off CT curve towards \"more purple\"\n> +\t/* how far to wander off CT curve towards \"more purple\" */\n>  \tdouble transversePos;\n> -\t// how far to wander off CT curve towards \"more green\"\n> +\t/* how far to wander off CT curve towards \"more green\" */\n>  \tdouble transverseNeg;\n> -\t// red sensitivity ratio (set to canonical sensor's R/G divided by this\n> -\t// sensor's R/G)\n> +\t/*\n> +\t * red sensitivity ratio (set to canonical sensor's R/G divided by this\n> +\t * sensor's R/G)\n> +\t */\n>  \tdouble sensitivityR;\n> -\t// blue sensitivity ratio (set to canonical sensor's B/G divided by this\n> -\t// sensor's B/G)\n> +\t/*\n> +\t * blue sensitivity ratio (set to canonical sensor's B/G divided by this\n> +\t * sensor's B/G)\n> +\t */\n>  \tdouble sensitivityB;\n> -\t// The whitepoint (which we normally \"aim\" for) can be moved.\n> +\t/* The whitepoint (which we normally \"aim\" for) can be moved. */\n>  \tdouble whitepointR;\n>  \tdouble whitepointB;\n> -\tbool bayes; // use Bayesian algorithm\n> +\tbool bayes; /* use Bayesian algorithm */\n>  };\n>  \n>  class Awb : public AwbAlgorithm\n\n[snip]","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 EBDF4C3275\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 27 Jul 2022 01:43:59 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 692276330E;\n\tWed, 27 Jul 2022 03:43:59 +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 56D85603E8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Jul 2022 03:43:57 +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 C9CD656D;\n\tWed, 27 Jul 2022 03:43:56 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1658886239;\n\tbh=yCb7WliIFSAQiFPIGAPOPjV4q32dnKz1iK2TGgrRZns=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=1caXtuTzlAdeMUHKeAp0lTFHemc1T6KYJa3cbtu2qQBNoNcC6XKVmOQ5AesSKP9+b\n\t1g2ppUdyBkrXuZ/lOwV5qzwb4wwMhGZO2Gqa9GWv1LK7Ot831oewGwuZF//2REN9R2\n\tKn7AxGNohPCtxhyMHuUm43CI7Bev9scjkcoKgwKs/caLPPNXRzTTCZTYDmm+MfTSJ9\n\tLP/mZYyneG0jN3+/73JdCmFQTlTL7c6//dzbDErOyw+p/iQOeNR4hTRTvszLXs0ai6\n\tr9GNQKsSxNs0Mtzdlaq+Fo3Lxg8/wDCuV+vbss4OLn0bEpEz7gEDU7/6nQBexSkGE6\n\tYc3bowIfrUlBQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1658886237;\n\tbh=yCb7WliIFSAQiFPIGAPOPjV4q32dnKz1iK2TGgrRZns=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=UrcAoRwugfGHGwfUZ+WLpHdvs21Db+CkdHsSJ3wXzag4Oklb9Bd3CWCQbJEhokJcb\n\tuOnApmAlKUulWJSWHk7wXVTgQiktxJwJ964RPYLSXfceahe9cdLmkketuc2jzaBtMF\n\tHcpzvNdMmbCx6ZwR3M/bo/XsrYr8ht1oOrXItyLg="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"UrcAoRwu\"; dkim-atps=neutral","Date":"Wed, 27 Jul 2022 04:43:55 +0300","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<YuCYW2qYMEFda7Pl@pendragon.ideasonboard.com>","References":"<20220726124549.1646-1-naush@raspberrypi.com>\n\t<20220726124549.1646-12-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220726124549.1646-12-naush@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH 11/17] ipa: raspberrypi: Change to C\n\tstyle code comments","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":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]