mirror of
https://github.com/storytold/effectcraft.git
synced 2026-11-07 02:51:24 +00:00
* Roto Brush: reuse scratch vectors in the distance transform matting::distance allocated four vectors per column plus a staging copy and three vectors per row. Run the columns and rows through four reused scratch vectors instead; the dt1 arithmetic is unchanged. Fixes #2324 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Roto Brush: keep the distance transform parallel, with per-split scratch The previous commit made the column and row passes serial, which was measured on one thread only. Both passes are parallel again: the column pass runs on a transposed buffer so every column is a contiguous chunk, and rayon's for_each_init gives each work split one set of scratch vectors instead of four allocations per line. The square root is folded into the row pass. A test keeps the old per-line implementation and checks that the output is bit-identical on a disk, its inverse, 1xN, Nx1, all-true, all-false, seeds on the frame edge and a sparse 333x211 pattern. An ignored benchmark prints the 1080p median and the rayon thread count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Roto matting: size the distance-transform scratch per pass (columns h, rows w) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>