The kernels' cut to one place a pixel is worked out ran a 4:2:0 window's
both planes through write_word's loop over the word's block, inside
scaler_transform. On the Radeon 780M that made 720p BGRA to 720p 420v
slower (docs/video/scaler.md recorded 0.26 to 0.31 ms). The old
both_planes, whose loop over a chroma row's two luma rows has a constant
count, is unrolled by the driver into two copies of a pixel's work that
run side by side. Put back inside scaler_transform, it was as fast as
before, but it grew that kernel from 21,524 to 31,216 bytes of code,
which every transform's making would pay for.
So both_planes gets a kernel of its own, scaler_transform_both_planes,
which non-adaptive dispatches of both planes take (Biplanar8,
Biplanar16). scaler_transform keeps its code. The making ahead
dispatches eight kernels, and the probe of first transforms has a 4:2:0
destination.
On the 780M, six alternated processes of each build: GPU time 0.230 to
0.206 ms at the median, the other benches within their spread. The
making ahead went from 274 ms to 298 cold, and the new kernel's own
making takes 27 ms. Its outputs are the same arithmetic in the same
order; the whole suite passes (113 of 113).