[PATCH] ipa: rpi: controller: rpi: Fix colour gain typo in AGC
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Thu May 22 15:22:58 CEST 2025
Hi David,
On Thu, May 22, 2025 at 02:03:18PM +0100, David Plowman wrote:
> A simple typo crept in where the red gain had been re-typed rather
> than using the correct green gain. In particular, this was causing
> very dark images for sensors that use large red gains, such as the
> IMX477 outdoors.
>
> Fixes: 29892f1c56c6 ("ipa: libipa: colour: Use the RGB class to model RGB values")
Oops :-S Sorry about that.
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> Signed-off-by: David Plowman <david.plowman at raspberrypi.com>
> ---
> src/ipa/rpi/controller/rpi/agc_channel.cpp | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/ipa/rpi/controller/rpi/agc_channel.cpp b/src/ipa/rpi/controller/rpi/agc_channel.cpp
> index a5562760..b2999364 100644
> --- a/src/ipa/rpi/controller/rpi/agc_channel.cpp
> +++ b/src/ipa/rpi/controller/rpi/agc_channel.cpp
> @@ -717,7 +717,7 @@ static double computeInitialY(StatisticsPtr &stats, AwbStatus const &awb,
>
> /* Factor in the AWB correction if needed. */
> if (stats->agcStatsPos == Statistics::AgcStatsPos::PreWb)
> - sum *= RGB<double>{ { awb.gainR, awb.gainR, awb.gainB } };
> + sum *= RGB<double>{ { awb.gainR, awb.gainG, awb.gainB } };
>
> double ySum = ipa::rec601LuminanceFromRGB(sum);
>
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list