Commit Graph

20 Commits

Author SHA1 Message Date
Niklas Haas 3a2a874994 tests/checkasm: switch to external checkasm
There are a number of benefits tied to the upstream / third-party checkasm
version, including:

- Improved long-term maintainability, code reuse with other projects, etc.

- Vastly improved overall performance / runtime for benchmarking, due
  primarily to the ability to scale the runtime of each test to that test's
  complexity.

- Much more robust statistical analysis of benchmarking results; including
  robust outlier rejection, an estimation of the histogram, and the ability
  to report the variance / stddev in addition to the (trimmed) mean.

- Interactive HTML and JSON output formats in addition to CSV/TSV.

- More readable and user-friendly output across the board, especially for
  failures and data dumps (e.g. also showing errors inside padding bytes).

- Better cross-platform support, including dynamic fallback of timer
  implementations on ARM platforms, a better RISC-V harness, and more.

There are multiple approaches to how we can solve the problem of integrating
this third party checkasm into dav1d, but I think the hybrid approach of
loading it as an external dependency, falling back to a meson wrap file,
provides the best overall compromise. This avoids the messiness of git e.g.
git submodules, while still allowing us to pin individual tags.
2026-01-01 17:33:55 +01:00
Victorien Le Couviour--Tuffet b4f9eac858 checkasm: Fix uninitialized variable
fg_data->num_y_points is used in generate_grain_uv, but is only set
after the call: move the initialization above.
2022-05-31 16:28:34 +00:00
Henrik Gramner 87f9a81cd7 checkasm: Fix alignment of stack buffers in the film grain tests 2022-03-19 03:09:31 +01:00
Henrik Gramner 0028e8ea57 x86: Add 8-bit film grain AVX-512 (Ice Lake) asm 2022-02-28 19:23:36 +01:00
Henrik Gramner 20e154aa74 build: Make "film_grain" vs "filmgrain" DSP file names consistent 2022-02-28 19:20:47 +01:00
Henrik Gramner ace8efe60a x86: Improve AVX2 generate_grain asm 2022-01-09 22:18:59 +00:00
Martin Storsjö 185194be2f checkasm: Make sure that all pixels are in range before benchmarking
The pixel data as initialized by the test above only have proper
pixels up to whatever random 'w' it used last.
2021-06-07 11:39:14 +03:00
Ronald S. Bultje e00e741161 checkasm: allow 1 >= h >= 2 in fgy_32x32xn unit test 2021-06-05 20:22:44 +00:00
Martin Storsjö 3aac025204 arm64: filmgrain16: Guard against out of range pixels in the gather function
In 16 bpc, the pixels are 16 bit integers, but valid pixels only
are up to 12 bits, and the scaling buffer only contains 4096
elements.

The src pixels are, normally, supposed to be valid pixels, but when
processing blocks of 32 pixels at a time, it can operate on
uninitialized pixels past the right edge.

Before:               Cortex A53      A72      A73  Apple M1
fgy_32x32xn_16bpc_neon:  10372.5   8194.4   8612.1  24.2
After:
fgy_32x32xn_16bpc_neon:  10837.9   8469.5   8885.1   24.6
2021-05-13 08:49:02 +00:00
Martin Storsjö 1206819d98 checkasm: Implement printing of grain lut entries 2021-04-27 15:32:40 +03:00
Martin Storsjö ee54837b0b checkasm: filmgrain: Add a padded check for fgy and fguv
This clearly specifies how much overwrite is allowed.
2021-04-22 15:31:04 +03:00
Martin Storsjö ca29d17901 checkasm: filmgrain: Check all overlap combinations in each run
Previously, only some combinations of overlap were tested in each run.

Also benchmark with and without overlap.
2021-04-14 14:57:30 +00:00
Martin Storsjö 152391b28d checkasm: filmgrain: Fix benchmarking in 16 bpc mode
When benchmarking, the functions are called with a fixed width
of 64x32 or 32x16, while the test itself is run with a random size
in the range up to 128x32.

In 16 bpc mode, the source pixels must be within the valid range,
because they otherwise cause accesses out of bounds in the scaling
array.
2020-05-12 09:29:07 +02:00
Henrik Gramner 9c29f229c5 checkasm: Increase buffer alignment to 64-byte on x86-64
Required for AVX-512.
2020-01-29 14:11:38 +01:00
Ronald S. Bultje 8ff894639b SSSE3 implementations of film grain
gen_grain_y_ar0_8bpc_c: 84853.3
gen_grain_y_ar0_8bpc_ssse3: 23528.0
gen_grain_y_ar1_8bpc_c: 140775.5
gen_grain_y_ar1_8bpc_ssse3: 70410.2
gen_grain_y_ar2_8bpc_c: 251311.3
gen_grain_y_ar2_8bpc_ssse3: 95222.2
gen_grain_y_ar3_8bpc_c: 394763.0
gen_grain_y_ar3_8bpc_ssse3: 103541.9

gen_grain_uv_ar0_8bpc_420_c: 29773.7
gen_grain_uv_ar0_8bpc_420_ssse3: 7068.9
gen_grain_uv_ar1_8bpc_420_c: 46113.2
gen_grain_uv_ar1_8bpc_420_ssse3: 22148.1
gen_grain_uv_ar2_8bpc_420_c: 70061.4
gen_grain_uv_ar2_8bpc_420_ssse3: 25479.0
gen_grain_uv_ar3_8bpc_420_c: 113826.0
gen_grain_uv_ar3_8bpc_420_ssse3: 30004.9

fguv_32x32xn_8bpc_420_csfl0_c: 8148.9
fguv_32x32xn_8bpc_420_csfl0_ssse3: 1371.3
fguv_32x32xn_8bpc_420_csfl1_c: 6391.9
fguv_32x32xn_8bpc_420_csfl1_ssse3: 1034.8

fgy_32x32xn_8bpc_c: 14201.3
fgy_32x32xn_8bpc_ssse3: 3443.0
2020-01-10 18:50:32 -05:00
James Almer a7c024ce07 x86: fix generate_grain_uv checkasm crashes on Windows x64
The uv argument is normally in a gpr, but in checkasm it's forcefully
loaded from stack.
2019-10-09 23:11:49 -03:00
Ronald S. Bultje 4e22ef3a82 Add AVX2 version of generate_grain_uv (4:2:0)
gen_grain_uv_ar0_8bpc_420_c: 30131.8
gen_grain_uv_ar0_8bpc_420_avx2: 6600.4
gen_grain_uv_ar1_8bpc_420_c: 46110.5
gen_grain_uv_ar1_8bpc_420_avx2: 17887.2
gen_grain_uv_ar2_8bpc_420_c: 73593.2
gen_grain_uv_ar2_8bpc_420_avx2: 26918.6
gen_grain_uv_ar3_8bpc_420_c: 114499.3
gen_grain_uv_ar3_8bpc_420_avx2: 29804.6
2019-10-07 17:33:50 +02:00
Ronald S. Bultje 556890be42 AVX2 for chroma 4:2:0 film grain reconstruction
fguv_32x32xn_8bpc_420_csfl0_c: 8945.4
fguv_32x32xn_8bpc_420_csfl0_avx2: 1001.6
fguv_32x32xn_8bpc_420_csfl1_c: 6363.4
fguv_32x32xn_8bpc_420_csfl1_avx2: 1299.5
2019-09-10 20:20:38 +02:00
Ronald S. Bultje 99307bf33d Y grain AVX2 implementations
fgy_32x32xn_8bpc_c: 16181.8
fgy_32x32xn_8bpc_avx2: 3231.4
gen_grain_y_ar0_8bpc_c: 108857.6
gen_grain_y_ar0_8bpc_avx2: 22826.7
gen_grain_y_ar1_8bpc_c: 168239.8
gen_grain_y_ar1_8bpc_avx2: 72117.2
gen_grain_y_ar2_8bpc_c: 266165.9
gen_grain_y_ar2_8bpc_avx2: 126281.8
gen_grain_y_ar3_8bpc_c: 448139.4
gen_grain_y_ar3_8bpc_avx2: 137047.1
2019-09-10 20:20:38 +02:00
Ronald S. Bultje 04ca711268 Add film grain checkasm tests 2019-09-10 20:20:38 +02:00