Skip to main content

mediaframe/source/
yuv420p16.rs

1//! YUV 4:2:0 planar 16‑bit (`AV_PIX_FMT_YUV420P16LE`).
2//!
3//! Storage mirrors [`super::Yuv420p10`] / [`super::Yuv420p12`] /
4//! [`super::Yuv420p14`] — three planes, Y at full size plus U / V at
5//! half width and half height — with **`u16`** samples. At 16 bits
6//! there is no upper-bit-zero slack; the full `u16` range is active.
7//!
8//! Runs on the **parallel i64 kernel family** —
9//! [`crate::row::yuv420p16_to_rgb_row`] and companions dispatch to
10//! `scalar::yuv_420p16_to_rgb_*` plus the matching per-backend SIMD
11//! kernels, which carry i64 intermediates for the chroma matrix
12//! multiply. The 10/12/14 families stay on the Q15 i32 pipeline.
13
14use crate::frame::Yuv420pFrame16;
15
16walker! {
17  planar3_bits_be {
18    /// Zero‑sized marker for the YUV 4:2:0 **16‑bit** source format. Used
19    /// as the `F` type parameter on `MixedSinker`.
20    #[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash)]
21    marker: Yuv420p16,
22    frame: Yuv420pFrame16<'_, 16, BE>,
23    frame_le: Yuv420pFrame16<'_, 16, false>,
24    generic_frame: Yuv420pFrame16<'_, BITS, BE>,
25    bits: 16,
26    row: Yuv420p16Row,
27    sink: Yuv420p16Sink,
28    walker: yuv420p16_to,
29    walker_endian: yuv420p16_to_endian,
30    walker_inner: yuv420p16_walker,
31    elem_type: u16,
32    chroma_h: half,
33    chroma_v: half,
34    row_doc: "One output row of a 16‑bit YUV 4:2:0 source handed to a\n\
35              [`Yuv420p16Sink`]. Structurally identical to [`super::Yuv420p10Row`],\n\
36              just with values covering the full `u16` range.",
37    walker_doc: "Converts a 16‑bit YUV 4:2:0 frame by walking its rows and feeding\n\
38                 each one to the [`Yuv420p16Sink`]. Pure row walker — all color\n\
39                 arithmetic happens inside the Sink via the i64 16‑bit kernel\n\
40                 family.",
41  }
42}