Skip to main content

mediaframe/source/
yuv444p9.rs

1//! YUV 4:4:4 planar 9‑bit (`AV_PIX_FMT_YUV444P9LE`).
2//!
3//! Full-resolution chroma, 1:1 with Y. 9 active bits in the low 9 of
4//! each `u16`. Niche format (AVC High 9 profile only). Reuses the
5//! const-generic `yuv_444p_n_to_rgb_*<BITS>` kernel family.
6
7use crate::frame::Yuv444pFrame16;
8
9walker! {
10  planar3_be {
11    /// Zero‑sized marker for the YUV 4:4:4 **9‑bit** source format.
12    #[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash)]
13    marker: Yuv444p9,
14    frame: Yuv444pFrame16<'_, 9, BE>,
15    frame_le: Yuv444pFrame16<'_, 9, false>,
16    row: Yuv444p9Row,
17    sink: Yuv444p9Sink,
18    walker: yuv444p9_to,
19    walker_endian: yuv444p9_to_endian,
20    elem_type: u16,
21    chroma_h: full,
22    chroma_v: full,
23    row_doc: "One output row of a [`Yuv444p9`] source.",
24    walker_doc: "Walks a [`Yuv444p9Frame`](crate::frame::Yuv444p9Frame) row by row into the sink.",
25  }
26}
27
28#[cfg(all(test, feature = "std"))]
29mod tests {
30  use super::*;
31  use crate::color::Matrix;
32
33  // Compile-pass regression for the codex round-1 finding on PR #110
34  // (`planar3_be` arm). The macro emits an LE-only `yuv444p9_to` wrapper
35  // alongside the const-generic `yuv444p9_to_endian` so explicit-turbofish
36  // callers like `yuv444p9_to::<MySink>(...)` keep compiling.
37  #[test]
38  fn yuv444p9_to_explicit_turbofish_one_generic_compiles() {
39    #[allow(clippy::type_complexity)]
40    fn _check<S: Yuv444p9Sink>() {
41      let _: fn(&crate::frame::Yuv444p9LeFrame<'_>, bool, Matrix, &mut S) -> Result<(), S::Error> =
42        yuv444p9_to::<S>;
43    }
44  }
45}