ReviewOS

also looking at this

home-lang/home

feat(video): add checked capture plane packing

#915
Merged chris wants to merge feat/checked-plane-packing into main
3 files +68 -0
8 days ago

Camera YUV420 and RGB buffers commonly contain row padding or separate chroma planes. Add allocation-free plane_pack.rows and plane_pack.packI420 helpers to copy active pixels into caller-owned tight buffers, with checked geometry/length arithmetic and validation of every plane before any destination writes.

Export the module from video and document borrowed source ownership, non-overlapping output, independent plane strides, and explicit DMA synchronization responsibilities. zig-camera reuses this module for owned copies of its new lores stream.

Validation: the focused module's two regression tests pass on Zig 0.15.2 and Home's installed 0.17 development toolchain; targeted Pickier and Zig formatting pass. Cases cover padded rows, missing final padding, truncated chroma, small output, odd dimensions, overflow, and unchanged output after validation errors. This focused validation does not cover the rest of the video dependency graph.

3 changed files on the files tab, with 0 review threads.

Sign in to comment on this pull request.