[libcamera-devel] [PATCH 07/11] ipu3: ipa: agc: Determine cell size from ipu3_uapi_awb_set_item

Laurent Pinchart laurent.pinchart at ideasonboard.com
Tue Sep 14 06:08:13 CEST 2021


Hi Jean-Michel,

Thank you for the patch.

On Mon, Sep 13, 2021 at 04:58:06PM +0200, Jean-Michel Hautbois wrote:
> The kCellSize was hardcoded from the size determined by examining the
> statistics from the ImgU.  The cell definition is now described as a
> struct. Utilise the struct size to express the cell size.
> 
> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois at ideasonboard.com>
> ---
>  src/ipa/ipu3/algorithms/agc.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp
> index 8740dcdf..e085599a 100644
> --- a/src/ipa/ipu3/algorithms/agc.cpp
> +++ b/src/ipa/ipu3/algorithms/agc.cpp
> @@ -48,7 +48,7 @@ static constexpr uint32_t knumHistogramBins = 256;
>  static constexpr double kEvGainTarget = 0.5;
>  
>  /* A cell is 8 bytes and contains averages for RGB values and saturation ratio */
> -static constexpr uint8_t kCellSize = 8;
> +static constexpr uint8_t kCellSize = sizeof(ipu3_uapi_awb_set_item);

And now I'm horrified that I've reviewed commit
4d57a806422a46038ee3d0896162d15f931ef109 without noticing how badly it
broke AGC :-(

>  
>  Agc::Agc()
>  	: frameCount_(0), lastFrame_(0), iqMean_(0.0), lineDuration_(0s),

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list