mirror of
https://github.com/shinyobjectz/raea.git
synced 2026-12-01 06:53:19 -10:00
nv12.k and nv12buf.k rounded half up into limited range (220 levels of 256), so a slow dark gradient merged into bands and blotches that raea check flagged on every sampled frame of a 1080p60 fog shot. Each sample now rounds through the Bayer threshold of its pixel (a chroma pair's, of its block's top-left), fixed by position, so play and render agree and nv12_cpu (the CPU render) stays bit-equal: core/k/tests/nv12_dither.rs runs both kernels through the interpreter against it, and holds a flat dark grey's mean. Samples are clamped to the nominal range (luma 16..235, chroma 16..240), since 220/256 overshoots 219/255 and the dither would have put some white on 236. The report's dark-gradient repro goes from a blotching error on 2 of 2 frames to clean, at 2.98 MB instead of 0.64 MB for its 4 s: the encoder keeps the gradient it used to flatten. Diagnosis and shape from SirSicard's report.