#pragma once // YUV semiplanar layouts: Y plane + interleaved UV plane. // NV12/NV21 — 4:2:0 (h_sub=2, v_sub=2) // NV16/NV61 — 4:2:2 (h_sub=2, v_sub=1) // P030/P230 — multi-pixel-per-word semiplanar (10-bit Y triplets). #include "../layout.h" #include "../io/semiplanar.h" namespace pixpat::formats { struct NV12 : Layout, Plane > { using Source = SemiplanarSource; using Sink = SemiplanarSink; }; struct NV21 : Layout, Plane > { using Source = SemiplanarSource; using Sink = SemiplanarSink; }; struct NV16 : Layout, Plane > { using Source = SemiplanarSource; using Sink = SemiplanarSink; }; struct NV61 : Layout, Plane > { using Source = SemiplanarSource; using Sink = SemiplanarSink; }; // Multi-pixel-per-word semiplanar (P030: 4:2:0, P230: 4:2:2). Y plane // holds 3 × 10-bit Y samples per uint32_t (top 2 bits unused). UV plane // holds 3 × (Cb,Cr) pairs per uint64_t (10 bits each, with 2-bit gaps // at bits 30-31 and 62-63 — left implicit, no X declared). struct P030 : Layout, Plane > { using Source = MultiPixelSemiplanarSource; using Sink = MultiPixelSemiplanarSink; }; struct P230 : Layout, Plane > { using Source = MultiPixelSemiplanarSource; using Sink = MultiPixelSemiplanarSink; }; } // namespace pixpat::formats