[PATCH 0/5] Fix histogram for some (corner) cases

Stefan Klug stefan.klug at ideasonboard.com
Mon Mar 24 18:07:35 CET 2025


Hi all,

during my work on WDR I stumbled over a few non-linearities when dealing
with small inter quantile mean ranges. These led to hard to handle
oscillations. This series adds a testcase for the histogram class and
fixes the related issues.

Patch 1 adds the basic tests that pass with the current implementation.

Patch 2-3 fix issues in the quantile() implementation and add
corresponding tests.

Patch 4-5 fix issues in the interQuantileMean() implementation and also
add tests.

I added the tests after the fixes, so that I don't have to toggle should_fail
in the meson.build file all the time (And CI doesn't test every commit anyways).
To test that in review, I believe the easiest is to temporarily revert the
corresponding fix and see the test fail.

Best regards,
Stefan

Stefan Klug (5):
  test: ipa: libipa: Add histogram tests
  libipa: histogram: Fix quantile() calculation for fractional results
  test: ipa: libipa: histogram: Add tests for quantile() returning a
    fraction
  libipa: histogram: Fix interQuantileMean() for small ranges
  test: ipa: libipa: histogram: Add tests for small inter quantile mean
    ranges

 src/ipa/libipa/histogram.cpp  | 23 ++++++------
 test/ipa/libipa/histogram.cpp | 66 +++++++++++++++++++++++++++++++++++
 test/ipa/libipa/meson.build   |  1 +
 3 files changed, 80 insertions(+), 10 deletions(-)
 create mode 100644 test/ipa/libipa/histogram.cpp

-- 
2.43.0



More information about the libcamera-devel mailing list