[{"id":29279,"web_url":"https://patchwork.libcamera.org/comment/29279/","msgid":"<171355933749.3257362.1362734428500830854@ping.linuxembedded.co.uk>","date":"2024-04-19T20:42:17","subject":"Re: [PATCH v2] ipa: rkisp1: agc: Fix histogram construction","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Paul Elder (2024-04-19 06:58:49)\n> This histogram reported by the rkisp1 hardware is 20 bits, where the\n> upper 16 bits are meaningful integer data and the lower 4 bits are\n> fractional and meant to be discarded. Remove thse 4 bits when\n> construction the histogram.\n> \n> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n> \n> ---\n> This was meant to be in the same series as \"[PATCH v2] ipa: libipa:\n> histogram: Add transform parameter to constructor\"\n> \n> This depends on v2 of \"Centralise Agc into libipa\".\n\nI assume you mean\n\n\"[PATCH v2] ipa: libipa: histogram: Add transform parameter to constructor\" ?\n\n> \n> Changes in v2:\n> - use a lambda function instead of the rshift parameter\n> ---\n>  src/ipa/rkisp1/algorithms/agc.cpp | 3 ++-\n>  1 file changed, 2 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\n> index 27b6f2c1..26526f5e 100644\n> --- a/src/ipa/rkisp1/algorithms/agc.cpp\n> +++ b/src/ipa/rkisp1/algorithms/agc.cpp\n> @@ -278,7 +278,8 @@ void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n>         const rkisp1_cif_isp_stat *params = &stats->params;\n>         ASSERT(stats->meas_type & RKISP1_CIF_ISP_STAT_AUTOEXP);\n>  \n> -       Histogram hist({ params->hist.hist_bins, context.hw->numHistogramBins });\n> +       Histogram hist({ params->hist.hist_bins, context.hw->numHistogramBins },\n> +                      [](uint32_t x) { return x >> 4; });\n\nIt's a clean fix and more generalised and still optimised so works for\nme.\n\nI would have thought a comment above would be beneficial to explain why\nwe're shifting all the values right 4 here though.\n\nAnyway.\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n>         expMeans_ = { params->ae.exp_mean, context.hw->numAeCells };\n>  \n>         /*\n> -- \n> 2.39.2\n>","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 DAF42C3200\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 19 Apr 2024 20:42:23 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 06C156333F;\n\tFri, 19 Apr 2024 22:42:23 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BDDBD61C15\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 19 Apr 2024 22:42:20 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id EAF29802;\n\tFri, 19 Apr 2024 22:41:31 +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=\"QtewrOq4\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1713559292;\n\tbh=cIU2VS679JOU6qXg+Vs3lDjxU/GXmupZRFlvx82bqcs=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=QtewrOq43GEgrycgiNuCRRuPIgCs1ukOtD8PUEsCwy+l5C4SQUy74GRL+iTz7ijuI\n\tenv8zIKwWBmlrssDjclWRfqBoIpTVtH8/2QbvvJOpDzleNzG2oLuOao6ccG3zuO6Yj\n\tmyiOVBv/M7ouB3om0pjNpERQ5rp6mJ4hIiUHmdW4=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240419055849.1086196-1-paul.elder@ideasonboard.com>","References":"<20240419055849.1086196-1-paul.elder@ideasonboard.com>","Subject":"Re: [PATCH v2] ipa: rkisp1: agc: Fix histogram construction","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Paul Elder <paul.elder@ideasonboard.com>","To":"Paul Elder <paul.elder@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Fri, 19 Apr 2024 21:42:17 +0100","Message-ID":"<171355933749.3257362.1362734428500830854@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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":29305,"web_url":"https://patchwork.libcamera.org/comment/29305/","msgid":"<5f96e3d6-d69a-401f-b09c-7f47452c1866@ideasonboard.com>","date":"2024-04-22T22:41:37","subject":"Re: [PATCH v2] ipa: rkisp1: agc: Fix histogram construction","submitter":{"id":156,"url":"https://patchwork.libcamera.org/api/people/156/","name":"Dan Scally","email":"dan.scally@ideasonboard.com"},"content":"Hi Paul\n\nOn 19/04/2024 06:58, Paul Elder wrote:\n> This histogram reported by the rkisp1 hardware is 20 bits, where the\n> upper 16 bits are meaningful integer data and the lower 4 bits are\n> fractional and meant to be discarded. Remove thse 4 bits when\n> construction the histogram.\n\n\"Remove those 4 bits when constructing the Histogram\", if you end up sending another version, but \notherwise:\n\n\nReviewed-by: Daniel Scally <dan.scally@ideasonboard.com>\n\n> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n>\n> ---\n> This was meant to be in the same series as \"[PATCH v2] ipa: libipa:\n> histogram: Add transform parameter to constructor\"\n>\n> This depends on v2 of \"Centralise Agc into libipa\".\n>\n> Changes in v2:\n> - use a lambda function instead of the rshift parameter\n> ---\n>   src/ipa/rkisp1/algorithms/agc.cpp | 3 ++-\n>   1 file changed, 2 insertions(+), 1 deletion(-)\n>\n> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\n> index 27b6f2c1..26526f5e 100644\n> --- a/src/ipa/rkisp1/algorithms/agc.cpp\n> +++ b/src/ipa/rkisp1/algorithms/agc.cpp\n> @@ -278,7 +278,8 @@ void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n>   \tconst rkisp1_cif_isp_stat *params = &stats->params;\n>   \tASSERT(stats->meas_type & RKISP1_CIF_ISP_STAT_AUTOEXP);\n>   \n> -\tHistogram hist({ params->hist.hist_bins, context.hw->numHistogramBins });\n> +\tHistogram hist({ params->hist.hist_bins, context.hw->numHistogramBins },\n> +\t\t       [](uint32_t x) { return x >> 4; });\n>   \texpMeans_ = { params->ae.exp_mean, context.hw->numAeCells };\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 CD729BE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 22 Apr 2024 22:41:43 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DBCFB63415;\n\tTue, 23 Apr 2024 00:41:42 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 95E2463414\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Apr 2024 00:41:40 +0200 (CEST)","from [192.168.0.43]\n\t(cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C84CCE4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Apr 2024 00:40:49 +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=\"LieVDgTc\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1713825649;\n\tbh=wc8i3TizCR1dYXbbcuYuh/P69YDzqUhPI4kvJ/bxJwk=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=LieVDgTcfD8czpFJbWMSJw0lf82xX8QJpCxPCAaAv9br+f2U/igsB11m5x06M8TP4\n\te7If3OgzeInG8Rt6R6V+j4w2r2CDh08IEnFKKhCOHfWILD5Hdq+VKDrnO73neSK8V5\n\tNX8U+IEA3Yg5LYngh61Wc/if5slSaWAAtd4csFmY=","Message-ID":"<5f96e3d6-d69a-401f-b09c-7f47452c1866@ideasonboard.com>","Date":"Mon, 22 Apr 2024 23:41:37 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v2] ipa: rkisp1: agc: Fix histogram construction","To":"libcamera-devel@lists.libcamera.org","References":"<20240419055849.1086196-1-paul.elder@ideasonboard.com>","Content-Language":"en-US","From":"Dan Scally <dan.scally@ideasonboard.com>","Autocrypt":"addr=dan.scally@ideasonboard.com; keydata=\n\txsFNBGLydlEBEADa5O2s0AbUguprfvXOQun/0a8y2Vk6BqkQALgeD6KnXSWwaoCULp18etYW\n\tB31bfgrdphXQ5kUQibB0ADK8DERB4wrzrUb5CMxLBFE7mQty+v5NsP0OFNK9XTaAOcmD+Ove\n\teIjYvqurAaro91jrRVrS1gBRxIFqyPgNvwwL+alMZhn3/2jU2uvBmuRrgnc/e9cHKiuT3Dtq\n\tMHGPKL2m+plk+7tjMoQFfexoQ1JKugHAjxAhJfrkXh6uS6rc01bYCyo7ybzg53m1HLFJdNGX\n\tsUKR+dQpBs3SY4s66tc1sREJqdYyTsSZf80HjIeJjU/hRunRo4NjRIJwhvnK1GyjOvvuCKVU\n\tRWpY8dNjNu5OeAfdrlvFJOxIE9M8JuYCQTMULqd1NuzbpFMjc9524U3Cngs589T7qUMPb1H1\n\tNTA81LmtJ6Y+IV5/kiTUANflpzBwhu18Ok7kGyCq2a2jsOcVmk8gZNs04gyjuj8JziYwwLbf\n\tvzABwpFVcS8aR+nHIZV1HtOzyw8CsL8OySc3K9y+Y0NRpziMRvutrppzgyMb9V+N31mK9Mxl\n\t1YkgaTl4ciNWpdfUe0yxH03OCuHi3922qhPLF4XX5LN+NaVw5Xz2o3eeWklXdouxwV7QlN33\n\tu4+u2FWzKxDqO6WLQGjxPE0mVB4Gh5Pa1Vb0ct9Ctg0qElvtGQARAQABzShEYW4gU2NhbGx5\n\tIDxkYW4uc2NhbGx5QGlkZWFzb25ib2FyZC5jb20+wsGNBBMBCAA3FiEEsdtt8OWP7+8SNfQe\n\tkiQuh/L+GMQFAmLydlIFCQWjmoACGwMECwkIBwUVCAkKCwUWAgMBAAAKCRCSJC6H8v4YxDI2\n\tEAC2Gz0iyaXJk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gmiZ7g6d0MEK8Ql/4zPItvr1c1rpwpXUC1\n\tu1kQWgtnNjFHX3KiYdqjcZeRBiry1X0zY+4Y24wUU0KsEewJwjhmCKAsju1RpdlPg2kC","In-Reply-To":"<20240419055849.1086196-1-paul.elder@ideasonboard.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>"}},{"id":29347,"web_url":"https://patchwork.libcamera.org/comment/29347/","msgid":"<ZitjcmYDEmUSvIcZ@pyrite.rasen.tech>","date":"2024-04-26T08:18:58","subject":"Re: [PATCH v2] ipa: rkisp1: agc: Fix histogram construction","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"On Fri, Apr 19, 2024 at 09:42:17PM +0100, Kieran Bingham wrote:\n> Quoting Paul Elder (2024-04-19 06:58:49)\n> > This histogram reported by the rkisp1 hardware is 20 bits, where the\n> > upper 16 bits are meaningful integer data and the lower 4 bits are\n> > fractional and meant to be discarded. Remove thse 4 bits when\n> > construction the histogram.\n> > \n> > Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n> > \n> > ---\n> > This was meant to be in the same series as \"[PATCH v2] ipa: libipa:\n> > histogram: Add transform parameter to constructor\"\n> > \n> > This depends on v2 of \"Centralise Agc into libipa\".\n> \n> I assume you mean\n> \n> \"[PATCH v2] ipa: libipa: histogram: Add transform parameter to constructor\" ?\n\nI mean I depend on that too (see above \"This was meant to be in the same\nseries...\") but this specific patch also depends on Dan's agc series.\n\nOr I could preempt his series :)\n\n\nPaul\n\n> \n> > \n> > Changes in v2:\n> > - use a lambda function instead of the rshift parameter\n> > ---\n> >  src/ipa/rkisp1/algorithms/agc.cpp | 3 ++-\n> >  1 file changed, 2 insertions(+), 1 deletion(-)\n> > \n> > diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\n> > index 27b6f2c1..26526f5e 100644\n> > --- a/src/ipa/rkisp1/algorithms/agc.cpp\n> > +++ b/src/ipa/rkisp1/algorithms/agc.cpp\n> > @@ -278,7 +278,8 @@ void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n> >         const rkisp1_cif_isp_stat *params = &stats->params;\n> >         ASSERT(stats->meas_type & RKISP1_CIF_ISP_STAT_AUTOEXP);\n> >  \n> > -       Histogram hist({ params->hist.hist_bins, context.hw->numHistogramBins });\n> > +       Histogram hist({ params->hist.hist_bins, context.hw->numHistogramBins },\n> > +                      [](uint32_t x) { return x >> 4; });\n> \n> It's a clean fix and more generalised and still optimised so works for\n> me.\n> \n> I would have thought a comment above would be beneficial to explain why\n> we're shifting all the values right 4 here though.\n> \n> Anyway.\n> \n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> >         expMeans_ = { params->ae.exp_mean, context.hw->numAeCells };\n> >  \n> >         /*\n> > -- \n> > 2.39.2\n> >","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 F106AC3220\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 26 Apr 2024 08:19:07 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 108BF633FD;\n\tFri, 26 Apr 2024 10:19:07 +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 06F23633EA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 26 Apr 2024 10:19:05 +0200 (CEST)","from pyrite.rasen.tech (h175-177-049-156.catv02.itscom.jp\n\t[175.177.49.156])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id CD12A66B;\n\tFri, 26 Apr 2024 10:18:11 +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=\"uH7gyEhq\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1714119492;\n\tbh=+pvjqS7Qq8Jgo0NYdAH3Z/EJ7oP3EJ3n2l45xZ8oLns=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=uH7gyEhqSuCk3nRYl7/4Px+YzVuByyraAINcHKil1CzA/XJmX3giCuk1mQyvToPnU\n\tT3I1ziSPo6W0TuKtP7qgKOYliLhIjTyxol09CscTpEsQCPoEmfXeyXjlCNzTWZPTON\n\tjRNfm0IqTdHjP4eZnpF5rAV4bfYoQMkeOCMEF2F0=","Date":"Fri, 26 Apr 2024 17:18:58 +0900","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v2] ipa: rkisp1: agc: Fix histogram construction","Message-ID":"<ZitjcmYDEmUSvIcZ@pyrite.rasen.tech>","References":"<20240419055849.1086196-1-paul.elder@ideasonboard.com>\n\t<171355933749.3257362.1362734428500830854@ping.linuxembedded.co.uk>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<171355933749.3257362.1362734428500830854@ping.linuxembedded.co.uk>","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":29401,"web_url":"https://patchwork.libcamera.org/comment/29401/","msgid":"<20240503001746.GJ4959@pendragon.ideasonboard.com>","date":"2024-05-03T00:17:46","subject":"Re: [PATCH v2] ipa: rkisp1: agc: Fix histogram construction","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Fri, Apr 26, 2024 at 05:18:58PM +0900, Paul Elder wrote:\n> On Fri, Apr 19, 2024 at 09:42:17PM +0100, Kieran Bingham wrote:\n> > Quoting Paul Elder (2024-04-19 06:58:49)\n> > > This histogram reported by the rkisp1 hardware is 20 bits, where the\n> > > upper 16 bits are meaningful integer data and the lower 4 bits are\n> > > fractional and meant to be discarded. Remove thse 4 bits when\n> > > construction the histogram.\n> > > \n> > > Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n> > > \n> > > ---\n> > > This was meant to be in the same series as \"[PATCH v2] ipa: libipa:\n> > > histogram: Add transform parameter to constructor\"\n> > > \n> > > This depends on v2 of \"Centralise Agc into libipa\".\n> > \n> > I assume you mean\n> > \n> > \"[PATCH v2] ipa: libipa: histogram: Add transform parameter to constructor\" ?\n> \n> I mean I depend on that too (see above \"This was meant to be in the same\n> series...\") but this specific patch also depends on Dan's agc series.\n> \n> Or I could preempt his series :)\n> \n> > > \n> > > Changes in v2:\n> > > - use a lambda function instead of the rshift parameter\n> > > ---\n> > >  src/ipa/rkisp1/algorithms/agc.cpp | 3 ++-\n> > >  1 file changed, 2 insertions(+), 1 deletion(-)\n> > > \n> > > diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\n> > > index 27b6f2c1..26526f5e 100644\n> > > --- a/src/ipa/rkisp1/algorithms/agc.cpp\n> > > +++ b/src/ipa/rkisp1/algorithms/agc.cpp\n> > > @@ -278,7 +278,8 @@ void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n> > >         const rkisp1_cif_isp_stat *params = &stats->params;\n> > >         ASSERT(stats->meas_type & RKISP1_CIF_ISP_STAT_AUTOEXP);\n> > >  \n> > > -       Histogram hist({ params->hist.hist_bins, context.hw->numHistogramBins });\n> > > +       Histogram hist({ params->hist.hist_bins, context.hw->numHistogramBins },\n> > > +                      [](uint32_t x) { return x >> 4; });\n> > \n> > It's a clean fix and more generalised and still optimised so works for\n> > me.\n> > \n> > I would have thought a comment above would be beneficial to explain why\n> > we're shifting all the values right 4 here though.\n\nAdd\n\n\t/* The lower 4 bits are fractional and meant to be discarded. */\n\nand get my\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nif you also fix the typo in the commit message.\n\n> > \n> > Anyway.\n> > \n> > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > \n> > >         expMeans_ = { params->ae.exp_mean, context.hw->numAeCells };\n> > >  \n> > >         /*","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 DFA44BDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  3 May 2024 00:17:57 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C92B163418;\n\tFri,  3 May 2024 02:17:56 +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 15D3C62C9F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  3 May 2024 02:17:55 +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 6C8A2720;\n\tFri,  3 May 2024 02:16:56 +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=\"foWhM1Ko\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1714695416;\n\tbh=PppP/rgdHUDr3H49GPFSfP73tFMVCTNhC2XX5GAu3k8=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=foWhM1Ko3yRqjuU8J/My5A5a7HILq0O5ZkS42FMjyG17rIZze1fb7I34AIUiYRkTK\n\tWYU2RUKoJL7BpV0cvaIRgZzBVzVtUcSolCG1gsqkp1NGmx4G5j3yCqqrSRBHkAkj79\n\twjLqG4qtGo4m1VIg323sHzunZ8HZKz9ORyOlb9QY=","Date":"Fri, 3 May 2024 03:17:46 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v2] ipa: rkisp1: agc: Fix histogram construction","Message-ID":"<20240503001746.GJ4959@pendragon.ideasonboard.com>","References":"<20240419055849.1086196-1-paul.elder@ideasonboard.com>\n\t<171355933749.3257362.1362734428500830854@ping.linuxembedded.co.uk>\n\t<ZitjcmYDEmUSvIcZ@pyrite.rasen.tech>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<ZitjcmYDEmUSvIcZ@pyrite.rasen.tech>","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>"}}]