Skip to content

vp9: loop filters from go-videodsp/kernels (AVX2), 1.17x - #5

Merged
tannevaled merged 1 commit into
mainfrom
vp9-lf-kernels
Nov 29, 2026
Merged

tannevaled merged 1 commit into
mainfrom
vp9-lf-kernels

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

What

The six VP9 Dual loop-filter edges (4, 8 and 16 wide, horizontal and vertical) call the AVX2 kernels of go-videodsp/kernels v0.22.0 (lf.VP9Lpf*), guarded by cpu.HasAVX2. Other CPUs and architectures keep the previous paths (lf_kernels_other.go returns false). The call is inserted by tools/portgovpx Patches, so loopfilter_thr.go stays wholly generated.

Measured

fractal (Ryzen 9 7950X), linux/amd64, GOEXPERIMENT=simd, one pinned core, load 2.8 to 3.1, 6 interleaved rounds against a v0.2.0 test binary, BenchmarkDecodeClip, crowd_run 1080p 300 frames, median us/frame:

v0.2.0 this PR speedup
VP9 1 tile 7136 6090 1.172x
VP9 4 tiles 7180 6151 1.167x

libvpx single core on the same clips: 2623 and 2610, so the decoder is still about 2.3 times libvpx per frame. Kernel speed against the scalar reference is in docs/perf/speed-log.md.

Correctness: libvpx test vectors, 376 of 376 match in both TestLibvpxVectors and TestLibvpxVectorsThreaded, 0 failed, run on fractal with the cross-compiled binary. -race runs in CI (the vectors lane).

Not in this PR

Single-edge Thr entry points, high bit depth, VP8 filters, NEON (open issue in go-videodsp/kernels).

🤖 Generated with Claude Code

The six Dual edge filters (4, 8 and 16 wide, horizontal and vertical) now call
the AVX2 kernels of go-videodsp/kernels v0.22.0 when the CPU has AVX2, and fall
back to the previous paths otherwise (and on every other architecture).

The generated loopfilter_thr.go stays wholly generated: the six insertions
are Patches in tools/portgovpx.

fractal (Ryzen 9 7950X, one core, load 3), crowd_run 1080p, 6 interleaved
rounds against v0.2.0, median us/frame: VP9 1 tile 7136 -> 6090 (1.172x),
4 tiles 7180 -> 6151 (1.167x). libvpx test vectors: 376 of 376 match, twice
(plain and 4 threads), 0 failed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 2135842 into main Nov 29, 2026
14 checks passed
@tannevaled
tannevaled deleted the vp9-lf-kernels branch November 29, 2026 12:51
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