Message ID | 20210923081625.60276-6-jeanmichel.hautbois@ideasonboard.com |
---|---|
State | Superseded |
Headers | show |
Series |
|
Related | show |
Hi Jean-Michel, Thank you for the patch. On Thu, Sep 23, 2021 at 10:16:18AM +0200, Jean-Michel Hautbois wrote: > Until now, the limits used to calculate the grid based on the Bayer Down > Scaler configuration where taken from the kernel documentation [0]. > While testing and understanding the format of the ImgU statistics, it > appears that the ones defined in CrOs [1] are the correct ones. Use s/CrOs/CrOS/ > those. > > [0] https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/pixfmt-meta-intel-ipu3.html?highlight=v4l2_meta_fmt_ipu3_params#intel-ipu3-imgu-uapi-data-types > [1] https://chromium.googlesource.com/chromiumos/platform/arc-camera/+/refs/heads/master/hal/intel/include/ia_imaging/awb_public.h > > Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > src/ipa/ipu3/ipu3.cpp | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp > index 30d2a539..b97aff80 100644 > --- a/src/ipa/ipu3/ipu3.cpp > +++ b/src/ipa/ipu3/ipu3.cpp > @@ -136,8 +136,8 @@ > * <linux/intel-ipu3.h> struct ipu3_uapi_gamma_corr_lut for further details. > */ > > -static constexpr uint32_t kMaxCellWidthPerSet = 160; > -static constexpr uint32_t kMaxCellHeightPerSet = 56; > +static constexpr uint32_t kMaxCellWidthPerSet = 80; > +static constexpr uint32_t kMaxCellHeightPerSet = 60; > > namespace libcamera { > > @@ -300,11 +300,11 @@ void IPAIPU3::calculateBdsGrid(const Size &bdsOutputSize) > /* Set the BDS output size in the IPAConfiguration structure */ > context_.configuration.grid.bdsOutputSize = bdsOutputSize; > > - for (uint32_t widthShift = 3; widthShift <= 7; ++widthShift) { > + for (uint32_t widthShift = 3; widthShift <= 6; ++widthShift) { > uint32_t width = std::min(kMaxCellWidthPerSet, > bdsOutputSize.width >> widthShift); > width = width << widthShift; > - for (uint32_t heightShift = 3; heightShift <= 7; ++heightShift) { > + for (uint32_t heightShift = 3; heightShift <= 6; ++heightShift) { > int32_t height = std::min(kMaxCellHeightPerSet, > bdsOutputSize.height >> heightShift); > height = height << heightShift;
diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp index 30d2a539..b97aff80 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -136,8 +136,8 @@ * <linux/intel-ipu3.h> struct ipu3_uapi_gamma_corr_lut for further details. */ -static constexpr uint32_t kMaxCellWidthPerSet = 160; -static constexpr uint32_t kMaxCellHeightPerSet = 56; +static constexpr uint32_t kMaxCellWidthPerSet = 80; +static constexpr uint32_t kMaxCellHeightPerSet = 60; namespace libcamera { @@ -300,11 +300,11 @@ void IPAIPU3::calculateBdsGrid(const Size &bdsOutputSize) /* Set the BDS output size in the IPAConfiguration structure */ context_.configuration.grid.bdsOutputSize = bdsOutputSize; - for (uint32_t widthShift = 3; widthShift <= 7; ++widthShift) { + for (uint32_t widthShift = 3; widthShift <= 6; ++widthShift) { uint32_t width = std::min(kMaxCellWidthPerSet, bdsOutputSize.width >> widthShift); width = width << widthShift; - for (uint32_t heightShift = 3; heightShift <= 7; ++heightShift) { + for (uint32_t heightShift = 3; heightShift <= 6; ++heightShift) { int32_t height = std::min(kMaxCellHeightPerSet, bdsOutputSize.height >> heightShift); height = height << heightShift;
Until now, the limits used to calculate the grid based on the Bayer Down Scaler configuration where taken from the kernel documentation [0]. While testing and understanding the format of the ImgU statistics, it appears that the ones defined in CrOs [1] are the correct ones. Use those. [0] https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/pixfmt-meta-intel-ipu3.html?highlight=v4l2_meta_fmt_ipu3_params#intel-ipu3-imgu-uapi-data-types [1] https://chromium.googlesource.com/chromiumos/platform/arc-camera/+/refs/heads/master/hal/intel/include/ia_imaging/awb_public.h Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> --- src/ipa/ipu3/ipu3.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)