Repository navigation
speed: fuse scalar downsampling and add AArch64 NEON covariance - #1653
Conversation
Compute the vertical pass only at retained rows and the horizontal pass only at retained columns. Preserve the scalar filter's accumulation order and edge reflection. Keep the existing x86 convolution path. Add exact-output tests covering filter widths, image patterns, unaligned inputs, and padded strides.
|
Hi @dantrapp. These changes look promising, thank you. Can you please also add a checkasm test for this? |
|
Thanks for taking a look, Kyle! Added in da332c2. The new checkasm test compares the fused filter against the original filter-and-decimate path and benchmarks both. Release and sanitizer checks pass. |
|
Tested #1653 at cea2b4d on x86-64 and on aarch64 under QEMU; no defect found. The description says x86 execution was not tested locally, so this covers that side. Builds and tests (
The extra test is Fused filter against filter-then-decimate. To run the fused path on x86 I changed aarch64. Same inputs, 8e7a1ac vs cea2b4d under QEMU, 130 configurations, 856 frames, 3304 scores: all bit-identical, with NEON on (fused filter and NEON kernel) and with NEON masked off (fused filter only). New build with NEON on vs masked off: also identical. NEON covariance kernel. Against Timings under QEMU are not meaningful and I did not measure any. |
SpEED's scalar antialias filter computes a full image before decimation retains one sample per 16 rows and columns. This computes the vertical pass only at retained rows and the horizontal pass only at retained columns, preserving the scalar accumulation order and edge reflection. The existing x86 filtering path is unchanged.
The AArch64 covariance kernel now uses NEON with double-precision accumulation and scalar handling of the final odd sample. Tests cover short widths, vector tails, unaligned inputs, padded strides, and constant and near-mean inputs. The fused filter is checked byte-for-byte against full filtering followed by decimation.
Performance
Apple M4, macOS 15.6.1, Apple Clang 17, release builds, one thread. Medians of seven runs with alternating build order and one warmup per build; baseline is
6ec23e8, candidate is3632e81.Inputs are the
src01_hrc00_1920x1080_5frames.yuvandsrc01_hrc01_1920x1080_5frames.yuvclips from Netflix/vmaf_resource, each repeated ten times to make a 50-frame sequence. Timings include the CLI process and file reads. These measurements use repeated content on one machine.Validation
Validation was performed on Apple M4; x86 execution was not tested locally.