[{"id":29355,"web_url":"https://patchwork.libcamera.org/comment/29355/","msgid":"<20240426155906.GA18442@pendragon.ideasonboard.com>","date":"2024-04-26T15:59:06","subject":"Re: [PATCH 3/5] libcamera: software_isp: Move color mappings out of\n\tdebayering","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, Apr 23, 2024 at 08:19:58PM +0200, Milan Zamazal wrote:\n> Constructing the color mapping tables is related to stats rather than\n> debayering, where they are applied.  Let's move the corresponding code\n> to stats processing.\n> \n> This is a preliminary step towards building this functionality on top of\n> libipa/algorithm.h, which should follow.\n> \n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> ---\n>  .../internal/software_isp/debayer_params.h    | 18 ++--\n>  src/ipa/simple/soft_simple.cpp                | 84 ++++++++++++-------\n>  src/libcamera/software_isp/debayer.cpp        | 29 ++++---\n>  src/libcamera/software_isp/debayer_cpu.cpp    | 41 ++-------\n>  src/libcamera/software_isp/debayer_cpu.h      |  9 +-\n>  src/libcamera/software_isp/software_isp.cpp   |  4 +-\n>  6 files changed, 87 insertions(+), 98 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 32cd448a..09f4ff00 100644\n> --- a/include/libcamera/internal/software_isp/debayer_params.h\n> +++ b/include/libcamera/internal/software_isp/debayer_params.h\n> @@ -1,6 +1,6 @@\n>  /* SPDX-License-Identifier: LGPL-2.1-or-later */\n>  /*\n> - * Copyright (C) 2023, Red Hat Inc.\n> + * Copyright (C) 2023, 2024 Red Hat Inc.\n>   *\n>   * Authors:\n>   * Hans de Goede <hdegoede@redhat.com>\n> @@ -10,20 +10,20 @@\n>  \n>  #pragma once\n>  \n> +#include <array>\n> +#include <stdint.h>\n> +\n>  namespace libcamera {\n>  \n>  struct DebayerParams {\n>  \tstatic constexpr unsigned int kGain10 = 256;\n> +\tstatic constexpr unsigned int kRGBLookupSize = 256;\n>  \n> -\tunsigned int gainR;\n> -\tunsigned int gainG;\n> -\tunsigned int gainB;\n> +\tusing ColorLookupTable = std::array<uint8_t, kRGBLookupSize>;\n>  \n> -\tfloat gamma;\n> -\t/**\n> -\t * \\brief Level of the black point, 0..255, 0 is no correction.\n> -\t */\n> -\tunsigned int blackLevel;\n> +\tColorLookupTable red;\n> +\tColorLookupTable green;\n> +\tColorLookupTable blue;\n>  };\n>  \n>  } /* namespace libcamera */\n> diff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp\n> index 30956a19..c5085f71 100644\n> --- a/src/ipa/simple/soft_simple.cpp\n> +++ b/src/ipa/simple/soft_simple.cpp\n> @@ -5,6 +5,7 @@\n>   * soft_simple.cpp - Simple Software Image Processing Algorithm module\n>   */\n>  \n> +#include <math.h>\n>  #include <numeric>\n>  #include <stdint.h>\n>  #include <sys/mman.h>\n> @@ -84,6 +85,10 @@ private:\n>  \tControlInfoMap sensorInfoMap_;\n>  \tBlackLevel blackLevel_;\n>  \n> +\tstatic constexpr unsigned int kGammaLookupSize = 1024;\n> +\tstd::array<uint8_t, kGammaLookupSize> gammaTable_;\n> +\tint lastBlackLevel_ = -1;\n> +\n>  \tint32_t exposureMin_, exposureMax_;\n>  \tint32_t exposure_;\n>  \tdouble againMin_, againMax_, againMinStep_;\n> @@ -246,40 +251,59 @@ void IPASoftSimple::processStats(const ControlList &sensorControls)\n>  \tif (ignoreUpdates_ > 0)\n>  \t\tblackLevel_.update(histogram);\n>  \tconst uint8_t blackLevel = blackLevel_.get();\n> -\tparams_->blackLevel = blackLevel;\n>  \n>  \t/*\n>  \t * Calculate red and blue gains for AWB.\n>  \t * Clamp max gain at 4.0, this also avoids 0 division.\n>  \t */\n> -\t{\n> -\t\tconst uint64_t nPixels = std::accumulate(\n> -\t\t\thistogram.begin(), histogram.end(), 0);\n> -\t\tauto subtractBlackLevel = [blackLevel, nPixels](\n> -\t\t\t\t\t\t  uint64_t sum, uint64_t div)\n> -\t\t\t-> uint64_t {\n> -\t\t\tuint64_t reducedSum = sum - blackLevel * nPixels / div;\n> -\t\t\tuint64_t spreadSum = reducedSum * 256 / (256 - blackLevel);\n> -\t\t\treturn spreadSum;\n> -\t\t};\n> -\t\tconst uint64_t sumR = subtractBlackLevel(stats_->sumR_, 4);\n> -\t\tconst uint64_t sumG = subtractBlackLevel(stats_->sumG_, 2);\n> -\t\tconst uint64_t sumB = subtractBlackLevel(stats_->sumB_, 4);\n> -\n> -\t\tif (sumR <= sumG / 4)\n> -\t\t\tparams_->gainR = 1024;\n> -\t\telse\n> -\t\t\tparams_->gainR = 256 * sumG / sumR;\n> -\n> -\t\tif (sumB <= sumG / 4)\n> -\t\t\tparams_->gainB = 1024;\n> -\t\telse\n> -\t\t\tparams_->gainB = 256 * sumG / sumB;\n> +\tconst uint64_t nPixels = std::accumulate(\n> +\t\thistogram.begin(), histogram.end(), 0);\n> +\tauto subtractBlackLevel = [blackLevel, nPixels](\n> +\t\t\t\t\t  uint64_t sum, uint64_t div)\n> +\t\t-> uint64_t {\n> +\t\tconst uint64_t reducedSum = sum - blackLevel * nPixels / div;\n> +\t\tconst uint64_t spreadSum = reducedSum * 256 / (256 - blackLevel);\n> +\t\treturn spreadSum;\n> +\t};\n> +\tconst uint64_t sumR = subtractBlackLevel(stats_->sumR_, 4);\n> +\tconst uint64_t sumG = subtractBlackLevel(stats_->sumG_, 2);\n> +\tconst uint64_t sumB = subtractBlackLevel(stats_->sumB_, 4);\n\nThe above belongs to the previous patch, including adding the const\nkeyword to the local variables in subtractBlackLevel().\n\n> +\n> +\t/* Gain: 128 = 0.5, 256 = 1.0, 512 = 2.0, etc. */\n> +\tunsigned int gainR = sumR <= sumG / 4 ? 1024 : 256 * sumG / sumR;\n> +\tunsigned int gainB = sumB <= sumG / 4 ? 1024 : 256 * sumG / sumB;\n> +\t/* Green gain and gamma values are fixed */\n> +\tconstexpr unsigned int gainG = 256;\n> +\t/* gamma == 1.0 means no correction */\n> +\tconstexpr float gamma = 0.5;\n> +\n> +\t/* Update the gamma table if needed */\n> +\tif (blackLevel != lastBlackLevel_) {\n> +\t\tconst unsigned int blackIndex = blackLevel * kGammaLookupSize / 256;\n> +\t\tstd::fill(gammaTable_.begin(), gammaTable_.begin() + blackIndex, 0);\n> +\t\tconst float divisor = kGammaLookupSize - blackIndex - 1.0;\n> +\t\tfor (unsigned int i = blackIndex; i < kGammaLookupSize; i++)\n> +\t\t\tgammaTable_[i] = UINT8_MAX * powf((i - blackIndex) / divisor, gamma);\n> +\n> +\t\tlastBlackLevel_ = blackLevel;\n>  \t}\n>  \n> -\t/* Green gain and gamma values are fixed */\n> -\tparams_->gainG = 256;\n> -\tparams_->gamma = 0.5;\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\tunsigned int idx;\n> +\n> +\t\t/* Apply gamma after gain! */\n> +\t\tidx = std::min({ i * gainR / div, (kGammaLookupSize - 1) });\n> +\t\tparams_->red[i] = gammaTable_[idx];\n> +\n> +\t\tidx = std::min({ i * gainG / div, (kGammaLookupSize - 1) });\n> +\t\tparams_->green[i] = gammaTable_[idx];\n> +\n> +\t\tidx = std::min({ i * gainB / div, (kGammaLookupSize - 1) });\n> +\t\tparams_->blue[i] = gammaTable_[idx];\n> +\t}\n>  \n>  \tsetIspParams.emit();\n>  \n> @@ -300,7 +324,7 @@ void IPASoftSimple::processStats(const ControlList &sensorControls)\n>  \t * https://www.araa.asn.au/acra/acra2007/papers/paper84final.pdf\n>  \t */\n>  \tconst unsigned int blackLevelHistIdx =\n> -\t\tparams_->blackLevel / (256 / SwIspStats::kYHistogramSize);\n> +\t\tblackLevel / (256 / SwIspStats::kYHistogramSize);\n>  \tconst unsigned int histogramSize =\n>  \t\tSwIspStats::kYHistogramSize - blackLevelHistIdx;\n>  \tconst unsigned int yHistValsPerBin = histogramSize / kExposureBinsCount;\n> @@ -348,8 +372,8 @@ void IPASoftSimple::processStats(const ControlList &sensorControls)\n>  \n>  \tLOG(IPASoft, Debug) << \"exposureMSV \" << exposureMSV\n>  \t\t\t    << \" exp \" << exposure_ << \" again \" << again_\n> -\t\t\t    << \" gain R/B \" << params_->gainR << \"/\" << params_->gainB\n> -\t\t\t    << \" black level \" << params_->blackLevel;\n> +\t\t\t    << \" gain R/B \" << gainR << \"/\" << gainB\n> +\t\t\t    << \" black level \" << blackLevel;\n>  }\n>  \n>  void IPASoftSimple::updateExposure(double exposureMSV)\n> diff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp\n> index 1c035e9b..ac438a33 100644\n> --- a/src/libcamera/software_isp/debayer.cpp\n> +++ b/src/libcamera/software_isp/debayer.cpp\n> @@ -1,7 +1,7 @@\n>  /* SPDX-License-Identifier: LGPL-2.1-or-later */\n>  /*\n>   * Copyright (C) 2023, Linaro Ltd\n> - * Copyright (C) 2023, Red Hat Inc.\n> + * Copyright (C) 2023, 2024 Red Hat Inc.\n>   *\n>   * Authors:\n>   * Hans de Goede <hdegoede@redhat.com>\n> @@ -24,29 +24,28 @@ namespace libcamera {\n>   */\n>  \n>  /**\n> - * \\var DebayerParams::gainR\n> - * \\brief Red gain\n> - *\n> - * 128 = 0.5, 256 = 1.0, 512 = 2.0, etc.\n> + * \\var DebayerParams::kRGBLookupSize\n> + * \\brief Size of a color lookup table\n>   */\n>  \n>  /**\n> - * \\var DebayerParams::gainG\n> - * \\brief Green gain\n> - *\n> - * 128 = 0.5, 256 = 1.0, 512 = 2.0, etc.\n> + * \\typedef DebayerParams::ColorLookupTable\n> + * \\brief Type of the lookup tables for red, green, blue values\n>   */\n>  \n>  /**\n> - * \\var DebayerParams::gainB\n> - * \\brief Blue gain\n> - *\n> - * 128 = 0.5, 256 = 1.0, 512 = 2.0, etc.\n> + * \\var DebayerParams::red\n> + * \\brief Lookup table for red color, mapping input values to output values\n> + */\n> +\n> +/**\n> + * \\var DebayerParams::green\n> + * \\brief Lookup table for green color, mapping input values to output values\n>   */\n>  \n>  /**\n> - * \\var DebayerParams::gamma\n> - * \\brief Gamma correction, 1.0 is no correction\n> + * \\var DebayerParams::blue\n> + * \\brief Lookup table for blue color, mapping input values to output values\n>   */\n>  \n>  /**\n> diff --git a/src/libcamera/software_isp/debayer_cpu.cpp b/src/libcamera/software_isp/debayer_cpu.cpp\n> index 88d6578b..8b2b2f40 100644\n> --- a/src/libcamera/software_isp/debayer_cpu.cpp\n> +++ b/src/libcamera/software_isp/debayer_cpu.cpp\n> @@ -11,7 +11,6 @@\n>  \n>  #include \"debayer_cpu.h\"\n>  \n> -#include <math.h>\n>  #include <stdlib.h>\n>  #include <time.h>\n>  \n> @@ -47,9 +46,9 @@ DebayerCpu::DebayerCpu(std::unique_ptr<SwStatsCpu> stats)\n>  \t */\n>  \tenableInputMemcpy_ = true;\n>  \n> -\t/* Initialize gamma to 1.0 curve */\n> -\tfor (unsigned int i = 0; i < kGammaLookupSize; i++)\n> -\t\tgamma_[i] = i / (kGammaLookupSize / kRGBLookupSize);\n> +\t/* Initialize color lookup tables */\n> +\tfor (unsigned int i = 0; i < DebayerParams::kRGBLookupSize; i++)\n> +\t\tred_[i] = green_[i] = blue_[i] = i;\n>  \n>  \tfor (unsigned int i = 0; i < kMaxLineBuffers; i++)\n>  \t\tlineBuffers_[i] = nullptr;\n> @@ -698,37 +697,9 @@ void DebayerCpu::process(FrameBuffer *input, FrameBuffer *output, DebayerParams\n>  \t\tclock_gettime(CLOCK_MONOTONIC_RAW, &frameStartTime);\n>  \t}\n>  \n> -\t/* Apply DebayerParams */\n> -\tif (params.gamma != gammaCorrection_ || params.blackLevel != blackLevel_) {\n> -\t\tconst unsigned int blackIndex =\n> -\t\t\tparams.blackLevel * kGammaLookupSize / 256;\n> -\t\tstd::fill(gamma_.begin(), gamma_.begin() + blackIndex, 0);\n> -\t\tconst float divisor = kGammaLookupSize - blackIndex - 1.0;\n> -\t\tfor (unsigned int i = blackIndex; i < kGammaLookupSize; i++)\n> -\t\t\tgamma_[i] = UINT8_MAX * powf((i - blackIndex) / divisor, params.gamma);\n> -\n> -\t\tgammaCorrection_ = params.gamma;\n> -\t\tblackLevel_ = params.blackLevel;\n> -\t}\n> -\n> -\tif (swapRedBlueGains_)\n> -\t\tstd::swap(params.gainR, params.gainB);\n> -\n> -\tfor (unsigned int i = 0; i < kRGBLookupSize; i++) {\n> -\t\tconstexpr unsigned int div =\n> -\t\t\tkRGBLookupSize * DebayerParams::kGain10 / kGammaLookupSize;\n> -\t\tunsigned int idx;\n> -\n> -\t\t/* Apply gamma after gain! */\n> -\t\tidx = std::min({ i * params.gainR / div, (kGammaLookupSize - 1) });\n> -\t\tred_[i] = gamma_[idx];\n> -\n> -\t\tidx = std::min({ i * params.gainG / div, (kGammaLookupSize - 1) });\n> -\t\tgreen_[i] = gamma_[idx];\n> -\n> -\t\tidx = std::min({ i * params.gainB / div, (kGammaLookupSize - 1) });\n> -\t\tblue_[i] = gamma_[idx];\n> -\t}\n> +\tgreen_ = params.green;\n> +\tred_ = swapRedBlueGains_ ? params.blue : params.red;\n> +\tblue_ = swapRedBlueGains_ ? params.red : params.blue;\n>  \n>  \t/* Copy metadata from the input buffer */\n>  \tFrameMetadata &metadata = output->_d()->metadata();\n> diff --git a/src/libcamera/software_isp/debayer_cpu.h b/src/libcamera/software_isp/debayer_cpu.h\n> index 689c1075..47373426 100644\n> --- a/src/libcamera/software_isp/debayer_cpu.h\n> +++ b/src/libcamera/software_isp/debayer_cpu.h\n> @@ -122,15 +122,12 @@ private:\n>  \tvoid process2(const uint8_t *src, uint8_t *dst);\n>  \tvoid process4(const uint8_t *src, uint8_t *dst);\n>  \n> -\tstatic constexpr unsigned int kGammaLookupSize = 1024;\n> -\tstatic constexpr unsigned int kRGBLookupSize = 256;\n>  \t/* Max. supported Bayer pattern height is 4, debayering this requires 5 lines */\n>  \tstatic constexpr unsigned int kMaxLineBuffers = 5;\n>  \n> -\tstd::array<uint8_t, kGammaLookupSize> gamma_;\n> -\tstd::array<uint8_t, kRGBLookupSize> red_;\n> -\tstd::array<uint8_t, kRGBLookupSize> green_;\n> -\tstd::array<uint8_t, kRGBLookupSize> blue_;\n> +\tDebayerParams::ColorLookupTable red_;\n> +\tDebayerParams::ColorLookupTable green_;\n> +\tDebayerParams::ColorLookupTable blue_;\n>  \tdebayerFn debayer0_;\n>  \tdebayerFn debayer1_;\n>  \tdebayerFn debayer2_;\n> diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp\n> index e4e56086..3e07453d 100644\n> --- a/src/libcamera/software_isp/software_isp.cpp\n> +++ b/src/libcamera/software_isp/software_isp.cpp\n> @@ -63,9 +63,7 @@ LOG_DEFINE_CATEGORY(SoftwareIsp)\n>   * handler\n>   */\n>  SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor)\n> -\t: debayerParams_{ DebayerParams::kGain10, DebayerParams::kGain10,\n> -\t\t\t  DebayerParams::kGain10, 0.5f, 0 },\n> -\t  dmaHeap_(DmaHeap::DmaHeapFlag::Cma | DmaHeap::DmaHeapFlag::System)\n> +\t: dmaHeap_(DmaHeap::DmaHeapFlag::Cma | DmaHeap::DmaHeapFlag::System)\n>  {\n>  \tif (!dmaHeap_.isValid()) {\n>  \t\tLOG(SoftwareIsp, Error) << \"Failed to create DmaHeap object\";","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 DA274BE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 26 Apr 2024 15:59:15 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0913E63416;\n\tFri, 26 Apr 2024 17:59:15 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5200161A9B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 26 Apr 2024 17:59:14 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(117.145-247-81.adsl-dyn.isp.belgacom.be [81.247.145.117])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C8CA82B3;\n\tFri, 26 Apr 2024 17:58:20 +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=\"NIGAbjMR\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1714147100;\n\tbh=2ZdlEghBdBiupv4Hl0+hkbVLsm1Nky37BusNX/9r/z8=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=NIGAbjMRYq8kqXaidFsovdVJCfjV+19Jrr5isTEks4KNW84p5s1y6ar4FITcGFmPg\n\tOwvlQbxyV1Xnh6odrHFNfjONxu8QIck7+dBbFkyquSrIcCLWkT7u1AZuzFI+0fNDbu\n\tVtterpCUa8jb13ltL9wtuu+TIsoQdkZUtqPK/69s=","Date":"Fri, 26 Apr 2024 18:59:06 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Milan Zamazal <mzamazal@redhat.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH 3/5] libcamera: software_isp: Move color mappings out of\n\tdebayering","Message-ID":"<20240426155906.GA18442@pendragon.ideasonboard.com>","References":"<20240423182000.1527425-1-mzamazal@redhat.com>\n\t<20240423182000.1527425-4-mzamazal@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240423182000.1527425-4-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>"}},{"id":29356,"web_url":"https://patchwork.libcamera.org/comment/29356/","msgid":"<87sez8ypm1.fsf@redhat.com>","date":"2024-04-26T17:56:38","subject":"Re: [PATCH 3/5] libcamera: software_isp: Move color mappings out of\n\tdebayering","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Laurent Pinchart <laurent.pinchart@ideasonboard.com> writes:\n\n> Hi Milan,\n>\n> Thank you for the patch.\n\nHi Laurent,\n\nthank you for the review.\n\n> On Tue, Apr 23, 2024 at 08:19:58PM +0200, Milan Zamazal wrote:\n>> Constructing the color mapping tables is related to stats rather than\n>> debayering, where they are applied.  Let's move the corresponding code\n>> to stats processing.\n>> \n>> This is a preliminary step towards building this functionality on top of\n>> libipa/algorithm.h, which should follow.\n>> \n>> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n>> ---\n>>  .../internal/software_isp/debayer_params.h    | 18 ++--\n>>  src/ipa/simple/soft_simple.cpp                | 84 ++++++++++++-------\n>>  src/libcamera/software_isp/debayer.cpp        | 29 ++++---\n>>  src/libcamera/software_isp/debayer_cpu.cpp    | 41 ++-------\n>>  src/libcamera/software_isp/debayer_cpu.h      |  9 +-\n>>  src/libcamera/software_isp/software_isp.cpp   |  4 +-\n>>  6 files changed, 87 insertions(+), 98 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 32cd448a..09f4ff00 100644\n>> --- a/include/libcamera/internal/software_isp/debayer_params.h\n>> +++ b/include/libcamera/internal/software_isp/debayer_params.h\n>> @@ -1,6 +1,6 @@\n>>  /* SPDX-License-Identifier: LGPL-2.1-or-later */\n>>  /*\n>> - * Copyright (C) 2023, Red Hat Inc.\n>> + * Copyright (C) 2023, 2024 Red Hat Inc.\n>>   *\n>>   * Authors:\n>>   * Hans de Goede <hdegoede@redhat.com>\n>> @@ -10,20 +10,20 @@\n>>  \n>>  #pragma once\n>>  \n>> +#include <array>\n>> +#include <stdint.h>\n>> +\n>>  namespace libcamera {\n>>  \n>>  struct DebayerParams {\n>>  \tstatic constexpr unsigned int kGain10 = 256;\n>> +\tstatic constexpr unsigned int kRGBLookupSize = 256;\n>>  \n>> -\tunsigned int gainR;\n>> -\tunsigned int gainG;\n>> -\tunsigned int gainB;\n>> +\tusing ColorLookupTable = std::array<uint8_t, kRGBLookupSize>;\n>>  \n>> -\tfloat gamma;\n>> -\t/**\n>> -\t * \\brief Level of the black point, 0..255, 0 is no correction.\n>> -\t */\n>> -\tunsigned int blackLevel;\n>> +\tColorLookupTable red;\n>> +\tColorLookupTable green;\n>> +\tColorLookupTable blue;\n>>  };\n>>  \n>>  } /* namespace libcamera */\n>> diff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp\n>> index 30956a19..c5085f71 100644\n>> --- a/src/ipa/simple/soft_simple.cpp\n>> +++ b/src/ipa/simple/soft_simple.cpp\n>> @@ -5,6 +5,7 @@\n>>   * soft_simple.cpp - Simple Software Image Processing Algorithm module\n>>   */\n>>  \n>> +#include <math.h>\n>>  #include <numeric>\n>>  #include <stdint.h>\n>>  #include <sys/mman.h>\n>> @@ -84,6 +85,10 @@ private:\n>>  \tControlInfoMap sensorInfoMap_;\n>>  \tBlackLevel blackLevel_;\n>>  \n>> +\tstatic constexpr unsigned int kGammaLookupSize = 1024;\n>> +\tstd::array<uint8_t, kGammaLookupSize> gammaTable_;\n>> +\tint lastBlackLevel_ = -1;\n>> +\n>>  \tint32_t exposureMin_, exposureMax_;\n>>  \tint32_t exposure_;\n>>  \tdouble againMin_, againMax_, againMinStep_;\n>> @@ -246,40 +251,59 @@ void IPASoftSimple::processStats(const ControlList &sensorControls)\n>>  \tif (ignoreUpdates_ > 0)\n>>  \t\tblackLevel_.update(histogram);\n>>  \tconst uint8_t blackLevel = blackLevel_.get();\n>> -\tparams_->blackLevel = blackLevel;\n>>  \n>>  \t/*\n>>  \t * Calculate red and blue gains for AWB.\n>>  \t * Clamp max gain at 4.0, this also avoids 0 division.\n>>  \t */\n>> -\t{\n>> -\t\tconst uint64_t nPixels = std::accumulate(\n>> -\t\t\thistogram.begin(), histogram.end(), 0);\n>> -\t\tauto subtractBlackLevel = [blackLevel, nPixels](\n>> -\t\t\t\t\t\t  uint64_t sum, uint64_t div)\n>> -\t\t\t-> uint64_t {\n>> -\t\t\tuint64_t reducedSum = sum - blackLevel * nPixels / div;\n>> -\t\t\tuint64_t spreadSum = reducedSum * 256 / (256 - blackLevel);\n>> -\t\t\treturn spreadSum;\n>> -\t\t};\n>> -\t\tconst uint64_t sumR = subtractBlackLevel(stats_->sumR_, 4);\n>> -\t\tconst uint64_t sumG = subtractBlackLevel(stats_->sumG_, 2);\n>> -\t\tconst uint64_t sumB = subtractBlackLevel(stats_->sumB_, 4);\n>> -\n>> -\t\tif (sumR <= sumG / 4)\n>> -\t\t\tparams_->gainR = 1024;\n>> -\t\telse\n>> -\t\t\tparams_->gainR = 256 * sumG / sumR;\n>> -\n>> -\t\tif (sumB <= sumG / 4)\n>> -\t\t\tparams_->gainB = 1024;\n>> -\t\telse\n>> -\t\t\tparams_->gainB = 256 * sumG / sumB;\n>> +\tconst uint64_t nPixels = std::accumulate(\n>> +\t\thistogram.begin(), histogram.end(), 0);\n>> +\tauto subtractBlackLevel = [blackLevel, nPixels](\n>> +\t\t\t\t\t  uint64_t sum, uint64_t div)\n>> +\t\t-> uint64_t {\n>> +\t\tconst uint64_t reducedSum = sum - blackLevel * nPixels / div;\n>> +\t\tconst uint64_t spreadSum = reducedSum * 256 / (256 - blackLevel);\n>> +\t\treturn spreadSum;\n>> +\t};\n>> +\tconst uint64_t sumR = subtractBlackLevel(stats_->sumR_, 4);\n>> +\tconst uint64_t sumG = subtractBlackLevel(stats_->sumG_, 2);\n>> +\tconst uint64_t sumB = subtractBlackLevel(stats_->sumB_, 4);\n>\n> The above belongs to the previous patch, \n\nYes, I'll move it there.\n\n> including adding the const keyword to the local variables in\n> subtractBlackLevel().\n\nYes.  Nevertheless, the variables will be dropped as we agreed on removing the\nsuperfluous multiplication.\n\n>> +\n>> +\t/* Gain: 128 = 0.5, 256 = 1.0, 512 = 2.0, etc. */\n>> +\tunsigned int gainR = sumR <= sumG / 4 ? 1024 : 256 * sumG / sumR;\n>> +\tunsigned int gainB = sumB <= sumG / 4 ? 1024 : 256 * sumG / sumB;\n>> +\t/* Green gain and gamma values are fixed */\n>> +\tconstexpr unsigned int gainG = 256;\n>> +\t/* gamma == 1.0 means no correction */\n>> +\tconstexpr float gamma = 0.5;\n>> +\n>> +\t/* Update the gamma table if needed */\n>> +\tif (blackLevel != lastBlackLevel_) {\n>> +\t\tconst unsigned int blackIndex = blackLevel * kGammaLookupSize / 256;\n>> +\t\tstd::fill(gammaTable_.begin(), gammaTable_.begin() + blackIndex, 0);\n>> +\t\tconst float divisor = kGammaLookupSize - blackIndex - 1.0;\n>> +\t\tfor (unsigned int i = blackIndex; i < kGammaLookupSize; i++)\n>> +\t\t\tgammaTable_[i] = UINT8_MAX * powf((i - blackIndex) / divisor, gamma);\n>> +\n>> +\t\tlastBlackLevel_ = blackLevel;\n>>  \t}\n>>  \n>> -\t/* Green gain and gamma values are fixed */\n>> -\tparams_->gainG = 256;\n>> -\tparams_->gamma = 0.5;\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\tunsigned int idx;\n>> +\n>> +\t\t/* Apply gamma after gain! */\n>> +\t\tidx = std::min({ i * gainR / div, (kGammaLookupSize - 1) });\n>> +\t\tparams_->red[i] = gammaTable_[idx];\n>> +\n>> +\t\tidx = std::min({ i * gainG / div, (kGammaLookupSize - 1) });\n>> +\t\tparams_->green[i] = gammaTable_[idx];\n>> +\n>> +\t\tidx = std::min({ i * gainB / div, (kGammaLookupSize - 1) });\n>> +\t\tparams_->blue[i] = gammaTable_[idx];\n>> +\t}\n>>  \n>>  \tsetIspParams.emit();\n>>  \n>> @@ -300,7 +324,7 @@ void IPASoftSimple::processStats(const ControlList &sensorControls)\n>>  \t * https://www.araa.asn.au/acra/acra2007/papers/paper84final.pdf\n>>  \t */\n>>  \tconst unsigned int blackLevelHistIdx =\n>> -\t\tparams_->blackLevel / (256 / SwIspStats::kYHistogramSize);\n>> +\t\tblackLevel / (256 / SwIspStats::kYHistogramSize);\n>>  \tconst unsigned int histogramSize =\n>>  \t\tSwIspStats::kYHistogramSize - blackLevelHistIdx;\n>>  \tconst unsigned int yHistValsPerBin = histogramSize / kExposureBinsCount;\n>> @@ -348,8 +372,8 @@ void IPASoftSimple::processStats(const ControlList &sensorControls)\n>>  \n>>  \tLOG(IPASoft, Debug) << \"exposureMSV \" << exposureMSV\n>>  \t\t\t    << \" exp \" << exposure_ << \" again \" << again_\n>> -\t\t\t    << \" gain R/B \" << params_->gainR << \"/\" << params_->gainB\n>> -\t\t\t    << \" black level \" << params_->blackLevel;\n>> +\t\t\t    << \" gain R/B \" << gainR << \"/\" << gainB\n>> +\t\t\t    << \" black level \" << blackLevel;\n>>  }\n>>  \n>>  void IPASoftSimple::updateExposure(double exposureMSV)\n>> diff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp\n>> index 1c035e9b..ac438a33 100644\n>> --- a/src/libcamera/software_isp/debayer.cpp\n>> +++ b/src/libcamera/software_isp/debayer.cpp\n>> @@ -1,7 +1,7 @@\n>>  /* SPDX-License-Identifier: LGPL-2.1-or-later */\n>>  /*\n>>   * Copyright (C) 2023, Linaro Ltd\n>> - * Copyright (C) 2023, Red Hat Inc.\n>> + * Copyright (C) 2023, 2024 Red Hat Inc.\n>>   *\n>>   * Authors:\n>>   * Hans de Goede <hdegoede@redhat.com>\n>> @@ -24,29 +24,28 @@ namespace libcamera {\n>>   */\n>>  \n>>  /**\n>> - * \\var DebayerParams::gainR\n>> - * \\brief Red gain\n>> - *\n>> - * 128 = 0.5, 256 = 1.0, 512 = 2.0, etc.\n>> + * \\var DebayerParams::kRGBLookupSize\n>> + * \\brief Size of a color lookup table\n>>   */\n>>  \n>>  /**\n>> - * \\var DebayerParams::gainG\n>> - * \\brief Green gain\n>> - *\n>> - * 128 = 0.5, 256 = 1.0, 512 = 2.0, etc.\n>> + * \\typedef DebayerParams::ColorLookupTable\n>> + * \\brief Type of the lookup tables for red, green, blue values\n>>   */\n>>  \n>>  /**\n>> - * \\var DebayerParams::gainB\n>> - * \\brief Blue gain\n>> - *\n>> - * 128 = 0.5, 256 = 1.0, 512 = 2.0, etc.\n>> + * \\var DebayerParams::red\n>> + * \\brief Lookup table for red color, mapping input values to output values\n>> + */\n>> +\n>> +/**\n>> + * \\var DebayerParams::green\n>> + * \\brief Lookup table for green color, mapping input values to output values\n>>   */\n>>  \n>>  /**\n>> - * \\var DebayerParams::gamma\n>> - * \\brief Gamma correction, 1.0 is no correction\n>> + * \\var DebayerParams::blue\n>> + * \\brief Lookup table for blue color, mapping input values to output values\n>>   */\n>>  \n>>  /**\n>> diff --git a/src/libcamera/software_isp/debayer_cpu.cpp b/src/libcamera/software_isp/debayer_cpu.cpp\n>> index 88d6578b..8b2b2f40 100644\n>> --- a/src/libcamera/software_isp/debayer_cpu.cpp\n>> +++ b/src/libcamera/software_isp/debayer_cpu.cpp\n>> @@ -11,7 +11,6 @@\n>>  \n>>  #include \"debayer_cpu.h\"\n>>  \n>> -#include <math.h>\n>>  #include <stdlib.h>\n>>  #include <time.h>\n>>  \n>> @@ -47,9 +46,9 @@ DebayerCpu::DebayerCpu(std::unique_ptr<SwStatsCpu> stats)\n>>  \t */\n>>  \tenableInputMemcpy_ = true;\n>>  \n>> -\t/* Initialize gamma to 1.0 curve */\n>> -\tfor (unsigned int i = 0; i < kGammaLookupSize; i++)\n>> -\t\tgamma_[i] = i / (kGammaLookupSize / kRGBLookupSize);\n>> +\t/* Initialize color lookup tables */\n>> +\tfor (unsigned int i = 0; i < DebayerParams::kRGBLookupSize; i++)\n>> +\t\tred_[i] = green_[i] = blue_[i] = i;\n>>  \n>>  \tfor (unsigned int i = 0; i < kMaxLineBuffers; i++)\n>>  \t\tlineBuffers_[i] = nullptr;\n>> @@ -698,37 +697,9 @@ void DebayerCpu::process(FrameBuffer *input, FrameBuffer *output, DebayerParams\n>>  \t\tclock_gettime(CLOCK_MONOTONIC_RAW, &frameStartTime);\n>>  \t}\n>>  \n>> -\t/* Apply DebayerParams */\n>> -\tif (params.gamma != gammaCorrection_ || params.blackLevel != blackLevel_) {\n>> -\t\tconst unsigned int blackIndex =\n>> -\t\t\tparams.blackLevel * kGammaLookupSize / 256;\n>> -\t\tstd::fill(gamma_.begin(), gamma_.begin() + blackIndex, 0);\n>> -\t\tconst float divisor = kGammaLookupSize - blackIndex - 1.0;\n>> -\t\tfor (unsigned int i = blackIndex; i < kGammaLookupSize; i++)\n>> -\t\t\tgamma_[i] = UINT8_MAX * powf((i - blackIndex) / divisor, params.gamma);\n>> -\n>> -\t\tgammaCorrection_ = params.gamma;\n>> -\t\tblackLevel_ = params.blackLevel;\n>> -\t}\n>> -\n>> -\tif (swapRedBlueGains_)\n>> -\t\tstd::swap(params.gainR, params.gainB);\n>> -\n>> -\tfor (unsigned int i = 0; i < kRGBLookupSize; i++) {\n>> -\t\tconstexpr unsigned int div =\n>> -\t\t\tkRGBLookupSize * DebayerParams::kGain10 / kGammaLookupSize;\n>> -\t\tunsigned int idx;\n>> -\n>> -\t\t/* Apply gamma after gain! */\n>> -\t\tidx = std::min({ i * params.gainR / div, (kGammaLookupSize - 1) });\n>> -\t\tred_[i] = gamma_[idx];\n>> -\n>> -\t\tidx = std::min({ i * params.gainG / div, (kGammaLookupSize - 1) });\n>> -\t\tgreen_[i] = gamma_[idx];\n>> -\n>> -\t\tidx = std::min({ i * params.gainB / div, (kGammaLookupSize - 1) });\n>> -\t\tblue_[i] = gamma_[idx];\n>> -\t}\n>> +\tgreen_ = params.green;\n>> +\tred_ = swapRedBlueGains_ ? params.blue : params.red;\n>> +\tblue_ = swapRedBlueGains_ ? params.red : params.blue;\n>>  \n>>  \t/* Copy metadata from the input buffer */\n>>  \tFrameMetadata &metadata = output->_d()->metadata();\n>> diff --git a/src/libcamera/software_isp/debayer_cpu.h b/src/libcamera/software_isp/debayer_cpu.h\n>> index 689c1075..47373426 100644\n>> --- a/src/libcamera/software_isp/debayer_cpu.h\n>> +++ b/src/libcamera/software_isp/debayer_cpu.h\n>> @@ -122,15 +122,12 @@ private:\n>>  \tvoid process2(const uint8_t *src, uint8_t *dst);\n>>  \tvoid process4(const uint8_t *src, uint8_t *dst);\n>>  \n>> -\tstatic constexpr unsigned int kGammaLookupSize = 1024;\n>> -\tstatic constexpr unsigned int kRGBLookupSize = 256;\n>>  \t/* Max. supported Bayer pattern height is 4, debayering this requires 5 lines */\n>>  \tstatic constexpr unsigned int kMaxLineBuffers = 5;\n>>  \n>> -\tstd::array<uint8_t, kGammaLookupSize> gamma_;\n>> -\tstd::array<uint8_t, kRGBLookupSize> red_;\n>> -\tstd::array<uint8_t, kRGBLookupSize> green_;\n>> -\tstd::array<uint8_t, kRGBLookupSize> blue_;\n>> +\tDebayerParams::ColorLookupTable red_;\n>> +\tDebayerParams::ColorLookupTable green_;\n>> +\tDebayerParams::ColorLookupTable blue_;\n>>  \tdebayerFn debayer0_;\n>>  \tdebayerFn debayer1_;\n>>  \tdebayerFn debayer2_;\n>> diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp\n>> index e4e56086..3e07453d 100644\n>> --- a/src/libcamera/software_isp/software_isp.cpp\n>> +++ b/src/libcamera/software_isp/software_isp.cpp\n>> @@ -63,9 +63,7 @@ LOG_DEFINE_CATEGORY(SoftwareIsp)\n>>   * handler\n>>   */\n>>  SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor)\n>> -\t: debayerParams_{ DebayerParams::kGain10, DebayerParams::kGain10,\n>> -\t\t\t  DebayerParams::kGain10, 0.5f, 0 },\n>> -\t  dmaHeap_(DmaHeap::DmaHeapFlag::Cma | DmaHeap::DmaHeapFlag::System)\n>> +\t: dmaHeap_(DmaHeap::DmaHeapFlag::Cma | DmaHeap::DmaHeapFlag::System)\n>>  {\n>>  \tif (!dmaHeap_.isValid()) {\n>>  \t\tLOG(SoftwareIsp, Error) << \"Failed to create DmaHeap object\";","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 CA70FC3220\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 26 Apr 2024 17:56:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 59A9B63416;\n\tFri, 26 Apr 2024 19:56:49 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4B8C261A9B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 26 Apr 2024 19:56:47 +0200 (CEST)","from mail-ej1-f72.google.com (mail-ej1-f72.google.com\n\t[209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-260-y9kewxNDO-al8_Zd0H2c2A-1; Fri, 26 Apr 2024 13:56:44 -0400","by mail-ej1-f72.google.com with SMTP id\n\ta640c23a62f3a-a52539e4970so148546666b.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 26 Apr 2024 10:56:43 -0700 (PDT)","from nuthatch (ip-77-48-47-2.net.vodafone.cz. [77.48.47.2])\n\tby smtp.gmail.com with ESMTPSA id\n\tgx20-20020a1709068a5400b00a5885a7cb8csm4060729ejc.119.2024.04.26.10.56.39\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 26 Apr 2024 10:56:39 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"J/oe3dC4\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1714154206;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=Cl5loL/o4cZaRzE1jLjMkoEuEyV8FV5ReDbDLtcRihM=;\n\tb=J/oe3dC4gnP79hLeyQbsm50BXbNJ5VM6vaHPO6kq48WyXDo/kegQfHEaNCifQfJZIrv3wx\n\tlkoe0dq3CTQHg+M1dM3iF3Q4RCuCo5zFkhACQlPl6VjjLsEA7+gMe1Rlj35+zKC83TjWQJ\n\tcLGBzuFnjgri5Ea1RUa3Y8Z9lCrNP7c=","X-MC-Unique":"y9kewxNDO-al8_Zd0H2c2A-1","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1714154202; x=1714759002;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=Cl5loL/o4cZaRzE1jLjMkoEuEyV8FV5ReDbDLtcRihM=;\n\tb=noR48DzdV/WadkpzwTZkw6VLG0bMebVGwtuOTuX+7zICIxiZXGBBZjCO8+fH9mFjut\n\t+EJyVDxYRCoMQgdFW/oHj5NZOSe3nCUED9jBRvSn9augPt0msGUDRIGS+aZH0WDooAT0\n\tva9TFf2WtrPlqwuDsSfsV7I2o/B9vDM4yrCqcmcnhAUfR2YTprSyht/34W/GooBk85qy\n\tVmbc+J1bQZLk6cgnn2UglamGNI3jBJYJJgQBghl2MFEu92PldOg1+19+j+sJM/f9fcpx\n\tbmxVQrPYH/2OFkLl2XjIPZAfHNCNDu+xeSNb4n+3DVU6YwCItFQu2pHj3KWLYAbU/BQy\n\tDpFQ==","X-Gm-Message-State":"AOJu0YydeHC/2kTMYFTTXAxujRGapT81WU8qFD8myoinnbxWoDT7BKiR\n\tfDB+bmWNaGxHULpaC+ENwzt+nymdxy1k8r/C1LJ4U+x/07erzdQcxd/klXTcbCV3jpKmWx14AXN\n\tMGz+jpIrQnDWsNqN32e5Ztp4HUxqHoenl7GpKtjilkuXHIPD+NPwSV1YRMPwLwpkpI7BE5Q8x67\n\tTjHcDKyfGj4IX9IzMitK7/iXQNpEYAtg96BsBcZxurwB/Xbe0ZPXXWEao=","X-Received":["by 2002:a17:907:78ca:b0:a58:bda9:cf2c with SMTP id\n\tkv10-20020a17090778ca00b00a58bda9cf2cmr2187990ejc.3.1714154202512; \n\tFri, 26 Apr 2024 10:56:42 -0700 (PDT)","by 2002:a17:907:78ca:b0:a58:bda9:cf2c with SMTP id\n\tkv10-20020a17090778ca00b00a58bda9cf2cmr2187921ejc.3.1714154199906; \n\tFri, 26 Apr 2024 10:56:39 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IEXtDeFItanCRostgRJuEATX2MmaUCZcVcl/iVn73ooRApWCKJOCjHP0SmdV0Ug1887ccE5gw==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH 3/5] libcamera: software_isp: Move color mappings out of\n\tdebayering","In-Reply-To":"<20240426155906.GA18442@pendragon.ideasonboard.com> (Laurent\n\tPinchart's message of \"Fri, 26 Apr 2024 18:59:06 +0300\")","References":"<20240423182000.1527425-1-mzamazal@redhat.com>\n\t<20240423182000.1527425-4-mzamazal@redhat.com>\n\t<20240426155906.GA18442@pendragon.ideasonboard.com>","Date":"Fri, 26 Apr 2024 19:56:38 +0200","Message-ID":"<87sez8ypm1.fsf@redhat.com>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain","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>"}}]