Files
craft-libs/docs
dotCooCoo d9473fcefb craft-gpu-yuv: run as the craft.yuv provider on craft-gpu
YuvProvider implements craft-gpu's GpuProvider under the id craft.yuv.
YuvJob writes and strictly parses the job's key:value parameters. The
provider checks the source and output sides and the padded read-back
size against the context's DeviceCaps and the input's length before
reading it, so a job is refused the same way on craft-gpu-null and on
a device. YuvProvider::new() converts on the CPU on any context;
with_device runs the render passes on a device the host holds, inside
validation and out-of-memory error scopes.

Code values now round halves away from zero on the CPU and in WGSL, as
INT in BT.709 and BT.2020 and Round in BT.2100 do. Round-half-even gave
full-range cyan a Cr of 0 instead of 1.

oracle_tests.rs checks the conversion against sources outside the
crate: code values computed in f64 from each recommendation's Kr, Kb
and quantization, the nominal levels the recommendations state, the
yuv crate's conversion (a dev-dependency) for every format, matrix and
range, and a 4x4 frame against the byte offsets of the WebCodecs and
Linux media API format definitions.

The README documents the job parameters, the plane layout with its
sources, the rounding rule, and why the CPU scaler takes the shader's
taps. docs/gpu-providers.md lists craft.yuv.
2026-11-17 18:08:53 -08:00
..