Skip to main content

mediaframe/source/
p410.rs

1//! P410 — semi‑planar 4:4:4, 10‑bit, high‑bit‑packed
2//! (`AV_PIX_FMT_P410LE`).
3//!
4//! 4:4:4 twin of [`super::P010`]: same high-bit-packed `u16`
5//! convention (10 active bits in the high 10 positions), but chroma
6//! is **full-width × full-height** (1:1 with Y, no subsampling).
7//! Each chroma row holds `2 * width` `u16` elements (= `width`
8//! interleaved `U, V` pairs). NVDEC / CUDA HDR 4:4:4 download target.
9//!
10//! Per-row kernel: a dedicated 4:4:4 high-bit-depth semi-planar
11//! family `p_n_444_to_rgb_*<10>` (full-width interleaved UV, no
12//! horizontal duplication step). Differs from the 4:2:0 / 4:2:2
13//! `p_n_to_rgb_*<10>` family in the chroma layout only.
14
15use crate::frame::PnFrame444;
16
17walker! {
18  semi_planar_be {
19    /// Zero‑sized marker for the P410 source format.
20    #[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash)]
21    marker: P410,
22    frame: PnFrame444<'_, 10, BE>,
23    frame_le: PnFrame444<'_, 10, false>,
24    row: P410Row,
25    sink: P410Sink,
26    walker: p410_to,
27    walker_endian: p410_to_endian,
28    elem_type: u16,
29    chroma_field: uv_full,
30    chroma_plane: uv,
31    chroma_stride: uv_stride,
32    chroma_elems_per_row: |w| 2 * w,
33    chroma_v: full,
34    row_doc: "One output row of a P410 source handed to a [`P410Sink`].\n\n\
35              Carries borrows to the source slices (full-width Y, full-width interleaved\n\
36              UV — `2 * width` u16 elements) plus the row index and matrix/range\n\
37              carry-throughs. Each `u16` element is high-bit-packed (10 bits).",
38    walker_doc: "Walks a [`P410Frame`](crate::frame::P410Frame) row by row into the sink.",
39  }
40}