[v5,0/7] Fix stats related problems in software ISP
mbox series

Message ID 20250929201924.45019-1-mzamazal@redhat.com
Headers show
Series
  • Fix stats related problems in software ISP
Related show

Message

Milan Zamazal Sept. 29, 2025, 8:19 p.m. UTC
Fixes of https://bugs.libcamera.org/show_bug.cgi?id=280 and the related
problems discussed there.

Tested-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Tested-by: Robert Mader <robert.mader@collabora.com>

Changes in v5:
- Docstring changes as suggested by Barnabás.
- Assertion on non-negative window corner values in
  SwStatsCpu::setWindow() added.
- Cosmetic code changes in debayer_cpu.cpp suggested by Hans.
- “Check processed window size alignment” patch dropped (the requirement
  is already enforced elsewhere.)
- Minor code change in awb.cpp suggested by Barnabás.
- New patch fixing the initial value type in std::accumulate().

Changes in v4:
- unsigned int underflow in SwStatsCpu::setWindow eliminated.
- Window adjustment clarified in SwStatsCpu::setWindow.

Changes in v3:
- Possible uint64_t underflow eliminated.

Changes in v2:
- An extra semicolon removed.
- A note about the debayering alignment being an implementation
  limitation added.
- A check for division by zero in AGC added.

Milan Zamazal (7):
  libcamera: software_isp: Fix width adjustment in SwStatsCpu::setWindow
  libcamera: software_isp: Clarify SwStatsCpu::setWindow use
  libcamera: software_isp: Pass correct y-coordinate to stats
  ipa: simple: awb: Avoid incorrect arithmetic in AWB
  ipa: simple: awb: Use correct type in std::accumulate
  ipa: simple: blc: Prevent division by zero in BLC
  ipa: simple: agc: Prevent division by zero in AGC

 src/ipa/simple/algorithms/agc.cpp          |  6 +++++
 src/ipa/simple/algorithms/awb.cpp          | 10 +++++----
 src/ipa/simple/algorithms/blc.cpp          |  5 +++++
 src/libcamera/software_isp/debayer_cpu.cpp | 18 ++++++++++-----
 src/libcamera/software_isp/swstats_cpu.cpp | 26 +++++++++++++++++++++-
 5 files changed, 54 insertions(+), 11 deletions(-)

Comments

Hans de Goede Sept. 29, 2025, 9:03 p.m. UTC | #1
Hi All,

On 29-Sep-25 10:19 PM, Milan Zamazal wrote:
> Fixes of https://bugs.libcamera.org/show_bug.cgi?id=280 and the related
> problems discussed there.
> 
> Tested-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
> Tested-by: Robert Mader <robert.mader@collabora.com>
> 
> Changes in v5:
> - Docstring changes as suggested by Barnabás.
> - Assertion on non-negative window corner values in
>   SwStatsCpu::setWindow() added.
> - Cosmetic code changes in debayer_cpu.cpp suggested by Hans.
> - “Check processed window size alignment” patch dropped (the requirement
>   is already enforced elsewhere.)
> - Minor code change in awb.cpp suggested by Barnabás.
> - New patch fixing the initial value type in std::accumulate().
> 
> Changes in v4:
> - unsigned int underflow in SwStatsCpu::setWindow eliminated.
> - Window adjustment clarified in SwStatsCpu::setWindow.
> 
> Changes in v3:
> - Possible uint64_t underflow eliminated.
> 
> Changes in v2:
> - An extra semicolon removed.
> - A note about the debayering alignment being an implementation
>   limitation added.
> - A check for division by zero in AGC added.
> 
> Milan Zamazal (7):
>   libcamera: software_isp: Fix width adjustment in SwStatsCpu::setWindow
>   libcamera: software_isp: Clarify SwStatsCpu::setWindow use
>   libcamera: software_isp: Pass correct y-coordinate to stats
>   ipa: simple: awb: Avoid incorrect arithmetic in AWB
>   ipa: simple: awb: Use correct type in std::accumulate
>   ipa: simple: blc: Prevent division by zero in BLC
>   ipa: simple: agc: Prevent division by zero in AG

While preparing a libcamera Fedora package with some fixes added
(including these fixes) I've run various tests on these patches:

Tested-by: Hans de Goede <hansg@kernel.org>

for the series

Regards,

Hans