Skip to main content

Module colorspace

Module colorspace 

Source

Functions§

bilinear_scale_plane
Runtime-dispatched bilinear scale. AVX2 on x86_64 when available.
bilinear_scale_plane_scalar
bilinear_scale_plane_u16
Runtime-dispatched 10-bit bilinear scale. AVX2 on x86_64 when available; falls back to bilinear_scale_plane_u16_scalar otherwise.
bilinear_scale_plane_u16_scalar
Scalar bilinear scale on u16 (10-bit) samples. Mirrors the 8-bit bilinear_scale_plane_scalar algorithm; the only differences are the wider sample type and the absence of u8 saturation at the output (10-bit values up to 1023 fit comfortably in u16, no overflow risk in the f64 intermediate).
bt601_to_bt709_planes
Runtime-dispatched entry point. Uses AVX2 if the CPU advertises it, scalar fallback otherwise. Safe wrapper around the unsafe target-feature specialization.
bt601_to_bt709_planes_10bit
Runtime-dispatched 10-bit BT.601 → BT.709. AVX2 on x86_64 when available, scalar fallback otherwise. Squad-29.
bt601_to_bt709_planes_10bit_scalar
Scalar 10-bit BT.601 → BT.709 reference. Same algorithm as the 8-bit bt601_to_bt709_scalar, but operates on u16 planes (10-bit values in 0..=1023). width / height are luma dimensions; chroma planes are half-resolution per axis (4:2:0).
bt601_to_bt709_planes_scalar
Public scalar entry point — for bench / tests.
convert_to_sdr_bt709
Normalize a decoder frame for the encoder.
convert_to_yuv420p_bt709
downsample_444_to_420_frame
High-level frame-shaped wrapper. Takes a Yuv444p10le / Yuva444p10le VideoFrame and returns a Yuv420p10le VideoFrame ready for the 10-bit AV1 encoder. Alpha plane (if present) is dropped with a warn-log — see module docstring for rationale. 8-bit equivalent (Yuv444pYuv420p) follows the same pattern, plumbed through downsample_chroma_444_to_420.
downsample_chroma_444_to_420
2×2 box-average chroma downsample for 8-bit Yuv444pYuv420p. Y plane is copied verbatim; Cb and Cr planes shrink 2× in each axis with rounded averages.
downsample_chroma_444_to_420_10bit
10-bit variant for Yuv444p10leYuv420p10le. Operates on u16 samples in the 0..=1023 range; output samples are written as LE u16 bytes packed alongside the copied Y plane.
scale_frame