Skip to content

pixel: horizontal 8-tap convolution with VPMADDUBSW (VP9 +3.8%) - #3

Merged
tannevaled merged 1 commit into
mainfrom
speed-f1
Nov 29, 2026
Merged

tannevaled merged 1 commit into
mainfrom
speed-f1

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Horizontal 8-tap convolution with VPMADDUBSW for the step == 1 case of filterWide8 / filterNarrow8, taken from govpx commit 43f826d8 (BSD-3, attributed in the file header). Exactness is proved per tap set (maddPairs); other tap sets fall back to the existing kernels.

crowd_run 1080p, 300 frames, fractal (Ryzen 9 7950X), one pinned core, 6 interleaved rounds against v0.1.0, load under 3, median us/frame:

clip v0.1.0 this PR ratio
VP9 1 tile 7210 6944 1.038
VP9 4 tiles 7581 7304 1.038
VP8 4969 4961 1.002

libvpx single core is 2623 / 2610 / 2427, so the gap stays about 2.6x (VP9) and 2.0x (VP8). The libvpx per-stage column cannot be produced (stripped symbols), so only totals are compared.

Also adds BenchmarkDecodeClip (set VPX_BENCH_FILES), TestMaddKernelsAgainstScalar (libvpx tap tables plus 200 random tap sets, extremal inputs, sources cut exactly at the footprint), and docs/perf/speed-log.md, which records what was tried and not kept (VP8 six-tap through the same kernel: slower; vertical VPMADDUBSW: archsimd on amd64 has no byte interleave) and what is not done (F1, loop filter, move into go-videodsp/kernels).

Vector suite and the vet matrix (22 configurations) are left to CI; the madd test passes on fractal.

🤖 Generated with Claude Code

Take filterHorizMadd and filterHorizMadd8 from govpx 43f826d8 (BSD-3, attributed in the file
header) for the step == 1 case of filterWide8 and filterNarrow8. Tap pairs multiply byte pairs
with DotProductPairsSaturated, the instruction libvpx's vpx_filter_block1d*_h8 kernels use.
maddPairs proves per tap set that no partial sum saturates except the last add, so the result is
exactly clamp((sum+64)>>7, 0, 255); other tap sets fall back to the existing kernels.

Add TestMaddKernelsAgainstScalar (regular, sharp, smooth, bilinear and 200 random tap sets,
extremal inputs, sources cut exactly at the footprint), BenchmarkDecodeClip, and docs/perf/speed-log.md.

crowd_run 1080p, fractal, one core, 6 interleaved rounds, median us/frame:
VP9 1 tile 7210 -> 6944, VP9 4 tiles 7581 -> 7304, VP8 4969 -> 4961.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit e33da94 into main Nov 29, 2026
14 checks passed
@tannevaled
tannevaled deleted the speed-f1 branch November 29, 2026 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant