perf(bilateral): LUT, interior fast path, rayon, --fast (MK-2) #21
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "perf/bilateral-lut"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Cut
monkey image smooth-bilateralwall time on a 1600x1200 plasma input (--spatial-sigma 10 --value-sigma 7 --iterations 2) from 33.6 s to ~1.0 s for the exact filter, and to ~0.1 s with the new--fastflag. Comfortably under the 3 s acceptance bar.Optimizations land in this order:
exp(-spatial/spatial_denom).value_distin[0, 3]replaces the innerexp(-value/value_denom). Bucket width ~0.000183, well below the 1-LSB correctness bar.get_clampedand reads pixels by direct slice index for the majority of pixels.par_chunks_exact_mut).bilateral_filter_separable: horizontal then vertical 1D passes (r^2->2rsamples per pixel). Same LUT and parallelism.--fastCLI flag onmonkey image smooth-bilateralselects the separable approximation; default stays exact.sharp_abstractkeeps the exact filter.One new dependency:
rayon = "1".#MK-2
Test plan
just check(fmt, clippy, build, tests, docker compile check)smooth-bilateralexact on 1600x1200 plasma finishes in ~1.0 ssmooth-bilateral --faston same input finishes in ~0.1 smonkey image diff exact.png fast.png --threshold 0.005succeedssharp-abstractstill produces output (uses exact filter unchanged)