pub(crate) fn convert_to_yuv10_mt(
src: &[u8],
src_stride: usize,
width: usize,
height: usize,
rgba_input: bool,
i444: bool,
full_range: bool,
y_buf: &mut [u16],
u_buf: &mut [u16],
v_buf: &mut [u16],
strides: (usize, usize),
bands: usize,
)Expand description
Convert a packed BGRA/RGBA buffer to planar 10-bit YUV (4:2:0 or 4:4:4) in 16-bit samples,
for the software encoders’ 10-bit sessions, across up to bands threads as
convert_to_yuv_mt splits them.
The 10-bit samples are computed from the 8-bit source directly rather than widened from an
8-bit conversion, so the two bits the encoder gains carry the precision an 8-bit Y, Cb, Cr
rounds away. The matrix is BT.709 at full_range or limited range, and a 4:2:0 chroma
sample is the conversion of the mean of its 2x2 block, which sites it at the block’s
center as the 8-bit conversion does. strides are in samples.