[{"id":29643,"web_url":"https://patchwork.libcamera.org/comment/29643/","msgid":"<20240529002236.GB11144@pendragon.ideasonboard.com>","date":"2024-05-29T00:22:36","subject":"Re: [PATCH v4 4/5] libcamera: software_isp: Remove\n\tDebayerParams::kGain10","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Milan,\n\nThank you for the patch.\n\nOn Tue, May 28, 2024 at 06:11:25PM +0200, Milan Zamazal wrote:\n> The constant is used in a single place internally and doesn't belong to\n> DebayerParams anymore.  Let's use 256 directly.\n> \n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> Reviewed-by: Andrei Konovalov <andrey.konovalov.ynk@gmail.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  include/libcamera/internal/software_isp/debayer_params.h | 1 -\n>  src/ipa/simple/soft_simple.cpp                           | 3 +--\n>  src/libcamera/software_isp/debayer.cpp                   | 5 -----\n>  3 files changed, 1 insertion(+), 8 deletions(-)\n> \n> diff --git a/include/libcamera/internal/software_isp/debayer_params.h b/include/libcamera/internal/software_isp/debayer_params.h\n> index 69fed1e7..2f75b4b5 100644\n> --- a/include/libcamera/internal/software_isp/debayer_params.h\n> +++ b/include/libcamera/internal/software_isp/debayer_params.h\n> @@ -16,7 +16,6 @@\n>  namespace libcamera {\n>  \n>  struct DebayerParams {\n> -\tstatic constexpr unsigned int kGain10 = 256;\n>  \tstatic constexpr unsigned int kRGBLookupSize = 256;\n>  \tstatic constexpr float kGamma = 0.5;\n>  \n> diff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp\n> index 2c9fe98e..26597c99 100644\n> --- a/src/ipa/simple/soft_simple.cpp\n> +++ b/src/ipa/simple/soft_simple.cpp\n> @@ -289,8 +289,7 @@ void IPASoftSimple::processStats(const ControlList &sensorControls)\n>  \n>  \tfor (unsigned int i = 0; i < DebayerParams::kRGBLookupSize; i++) {\n>  \t\tconstexpr unsigned int div =\n> -\t\t\tDebayerParams::kRGBLookupSize * DebayerParams::kGain10 /\n> -\t\t\tkGammaLookupSize;\n> +\t\t\tDebayerParams::kRGBLookupSize * 256 / kGammaLookupSize;\n>  \t\tunsigned int idx;\n>  \n>  \t\t/* Apply gamma after gain! */\n> diff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp\n> index 028bf27e..80bf5dbe 100644\n> --- a/src/libcamera/software_isp/debayer.cpp\n> +++ b/src/libcamera/software_isp/debayer.cpp\n> @@ -18,11 +18,6 @@ namespace libcamera {\n>   * \\brief Struct to hold the debayer parameters.\n>   */\n>  \n> -/**\n> - * \\var DebayerParams::kGain10\n> - * \\brief const value for 1.0 gain\n> - */\n> -\n>  /**\n>   * \\var DebayerParams::kRGBLookupSize\n>   * \\brief Size of a color lookup table","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 38943BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 29 May 2024 00:22:51 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F2C26634B2;\n\tWed, 29 May 2024 02:22:49 +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 C2911634A8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 29 May 2024 02:22:48 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3F72A9CA;\n\tWed, 29 May 2024 02:22:45 +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=\"Zz99Il5h\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1716942165;\n\tbh=KTu16mogqoL3JAuniYz0qGdcjVSHG9UPrk7WaayTPvo=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Zz99Il5h99tnDnTpgiCQNNDeK4/MG/R+iUSBCySbXgjF7UJyyKwztQIsyfcBYj488\n\txS5wmJjVv0Gm7PiK/C//v6LvfmD6xT0zTkySFJ2LdHH7NSX63tN3tWP2h4Cc4THs9+\n\tlaHjoACnJx+6P0/cjAI3NW/QcelnFjzo9QyN+C8M=","Date":"Wed, 29 May 2024 03:22:36 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Milan Zamazal <mzamazal@redhat.com>","Cc":"libcamera-devel@lists.libcamera.org,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tAndrei Konovalov <andrey.konovalov.ynk@gmail.com>","Subject":"Re: [PATCH v4 4/5] libcamera: software_isp: Remove\n\tDebayerParams::kGain10","Message-ID":"<20240529002236.GB11144@pendragon.ideasonboard.com>","References":"<20240528161126.35119-1-mzamazal@redhat.com>\n\t<20240528161126.35119-5-mzamazal@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240528161126.35119-5-mzamazal@redhat.com>","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>"}}]