[PATCH] ipa: rpi: controller: rpi: Fix colour gain typo in AGC

Naushir Patuck naush at raspberrypi.com
Thu May 22 15:25:58 CEST 2025


Hi David,


On Thu, 22 May 2025 at 14:03, David Plowman <david.plowman at raspberrypi.com>
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")
> Signed-off-by: David Plowman <david.plowman at raspberrypi.com>
>

Reviewed-by: Naushir Patuck <naush at raspberrypi.com>
Tested-by: Naushir Patuck <naush 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);
>
> --
> 2.34.1
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20250522/620cf0c0/attachment.htm>


More information about the libcamera-devel mailing list