Skip to main content

mediaframe/source/
yuv422p.rs

1//! YUV 4:2:2 planar (`AV_PIX_FMT_YUV422P`, `yuvj422p`).
2//!
3//! Three planes: full-size Y + half-width, **full-height** U/V.
4//! The per-row kernel is identical to [`super::Yuv420p`]'s — the
5//! 4:2:0 → 4:2:2 difference is purely vertical: YUV420p reads chroma
6//! row `r / 2`, YUV422p reads chroma row `r`. The sinker calls
7//! [`crate::row::yuv_420_to_rgb_row`] directly.
8
9use crate::frame::Yuv422pFrame;
10
11walker! {
12  planar3 {
13    /// Zero-sized marker for the YUV 4:2:2 source format. Used as the
14    /// `F` type parameter on `MixedSinker`.
15    #[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash)]
16    marker: Yuv422p,
17    frame: Yuv422pFrame<'_>,
18    row: Yuv422pRow,
19    sink: Yuv422pSink,
20    walker: yuv422p_to,
21    elem_type: u8,
22    chroma_h: half,
23    chroma_v: full,
24    row_doc: "One output row of a YUV 4:2:2 source handed to a [`Yuv422pSink`].\n\n\
25              Carries borrows to the source slices (full-width Y, half-width U/V) plus\n\
26              the row index and matrix/range carry-throughs. Unlike 4:2:0, no two Y\n\
27              rows share a chroma row — the walker advances U/V every row.",
28    walker_doc: "Converts a YUV 4:2:2 frame by walking its rows and feeding each one\n\
29                 to the [`Yuv422pSink`]. Chroma advances every row (vs 4:2:0's `row / 2`).",
30  }
31}