#[cfg(any(
target_arch = "aarch64",
target_arch = "x86_64",
target_arch = "wasm32"
))]
use crate::row::arch;
#[cfg(target_arch = "aarch64")]
use crate::row::neon_available;
#[cfg(target_arch = "wasm32")]
use crate::row::simd128_available;
#[cfg(target_arch = "x86_64")]
use crate::row::{avx2_available, avx512_available, sse41_available};
use crate::{
KernelMatrix,
row::{rgba_row_bytes, rgba_row_elems, scalar},
};
#[cfg(any(feature = "std", feature = "alloc"))]
use crate::ColorMatrix;
#[cfg(any(feature = "std", feature = "alloc"))]
use crate::row::{rgb_row_bytes, rgb_row_elems};
use super::{yuv_444p_n_to_rgb_row, yuv_444p_n_to_rgb_u16_row};
#[cfg_attr(not(tarpaulin), inline(always))]
#[allow(clippy::too_many_arguments)]
pub fn yuv444p12_to_rgb_row_endian(
y: &[u16],
u: &[u16],
v: &[u16],
rgb_out: &mut [u8],
width: usize,
matrix: KernelMatrix,
full_range: bool,
use_simd: bool,
big_endian: bool,
) {
if big_endian {
yuv_444p_n_to_rgb_row::<12, true>(y, u, v, rgb_out, width, matrix, full_range, use_simd);
} else {
yuv_444p_n_to_rgb_row::<12, false>(y, u, v, rgb_out, width, matrix, full_range, use_simd);
}
}
#[cfg_attr(not(tarpaulin), inline(always))]
#[allow(clippy::too_many_arguments)]
pub fn yuv444p12_to_rgb_row(
y: &[u16],
u: &[u16],
v: &[u16],
rgb_out: &mut [u8],
width: usize,
matrix: KernelMatrix,
full_range: bool,
use_simd: bool,
) {
yuv444p12_to_rgb_row_endian(y, u, v, rgb_out, width, matrix, full_range, use_simd, false);
}
#[cfg_attr(not(tarpaulin), inline(always))]
#[allow(clippy::too_many_arguments)]
pub fn yuv444p12_to_rgb_u16_row_endian(
y: &[u16],
u: &[u16],
v: &[u16],
rgb_out: &mut [u16],
width: usize,
matrix: KernelMatrix,
full_range: bool,
use_simd: bool,
big_endian: bool,
) {
if big_endian {
yuv_444p_n_to_rgb_u16_row::<12, true>(y, u, v, rgb_out, width, matrix, full_range, use_simd);
} else {
yuv_444p_n_to_rgb_u16_row::<12, false>(y, u, v, rgb_out, width, matrix, full_range, use_simd);
}
}
#[cfg_attr(not(tarpaulin), inline(always))]
#[allow(clippy::too_many_arguments)]
pub fn yuv444p12_to_rgb_u16_row(
y: &[u16],
u: &[u16],
v: &[u16],
rgb_out: &mut [u16],
width: usize,
matrix: KernelMatrix,
full_range: bool,
use_simd: bool,
) {
yuv444p12_to_rgb_u16_row_endian(y, u, v, rgb_out, width, matrix, full_range, use_simd, false);
}
#[cfg_attr(not(tarpaulin), inline(always))]
#[allow(clippy::too_many_arguments)]
pub fn yuv444p12_to_rgba_row_endian(
y: &[u16],
u: &[u16],
v: &[u16],
rgba_out: &mut [u8],
width: usize,
matrix: KernelMatrix,
full_range: bool,
use_simd: bool,
big_endian: bool,
) {
let rgba_min = rgba_row_bytes(width);
assert!(y.len() >= width, "y row too short");
assert!(u.len() >= width, "u row too short");
assert!(v.len() >= width, "v row too short");
assert!(rgba_out.len() >= rgba_min, "rgba_out row too short");
macro_rules! dispatch_be {
($call_le:expr, $call_be:expr) => {
if big_endian { $call_be } else { $call_le }
};
}
if use_simd {
cfg_select! {
target_arch = "aarch64" => {
if neon_available() {
dispatch_be!(
unsafe {
arch::neon::yuv_444p_n_to_rgba_row::<12, false>(
y, u, v, rgba_out, width, matrix, full_range,
);
},
unsafe {
arch::neon::yuv_444p_n_to_rgba_row::<12, true>(
y, u, v, rgba_out, width, matrix, full_range,
);
}
);
return;
}
}
target_arch = "x86_64" => {
if avx512_available() {
dispatch_be!(
unsafe {
arch::x86_avx512::yuv_444p_n_to_rgba_row::<12, false>(
y, u, v, rgba_out, width, matrix, full_range,
);
},
unsafe {
arch::x86_avx512::yuv_444p_n_to_rgba_row::<12, true>(
y, u, v, rgba_out, width, matrix, full_range,
);
}
);
return;
}
if avx2_available() {
dispatch_be!(
unsafe {
arch::x86_avx2::yuv_444p_n_to_rgba_row::<12, false>(
y, u, v, rgba_out, width, matrix, full_range,
);
},
unsafe {
arch::x86_avx2::yuv_444p_n_to_rgba_row::<12, true>(
y, u, v, rgba_out, width, matrix, full_range,
);
}
);
return;
}
if sse41_available() {
dispatch_be!(
unsafe {
arch::x86_sse41::yuv_444p_n_to_rgba_row::<12, false>(
y, u, v, rgba_out, width, matrix, full_range,
);
},
unsafe {
arch::x86_sse41::yuv_444p_n_to_rgba_row::<12, true>(
y, u, v, rgba_out, width, matrix, full_range,
);
}
);
return;
}
}
target_arch = "wasm32" => {
if simd128_available() {
dispatch_be!(
unsafe {
arch::wasm_simd128::yuv_444p_n_to_rgba_row::<12, false>(
y, u, v, rgba_out, width, matrix, full_range,
);
},
unsafe {
arch::wasm_simd128::yuv_444p_n_to_rgba_row::<12, true>(
y, u, v, rgba_out, width, matrix, full_range,
);
}
);
return;
}
}
_ => {}
}
}
dispatch_be!(
scalar::yuv_444p_n_to_rgba_row::<12, false>(y, u, v, rgba_out, width, matrix, full_range),
scalar::yuv_444p_n_to_rgba_row::<12, true>(y, u, v, rgba_out, width, matrix, full_range)
);
}
#[cfg_attr(not(tarpaulin), inline(always))]
#[allow(clippy::too_many_arguments)]
pub fn yuv444p12_to_rgba_row(
y: &[u16],
u: &[u16],
v: &[u16],
rgba_out: &mut [u8],
width: usize,
matrix: KernelMatrix,
full_range: bool,
use_simd: bool,
) {
yuv444p12_to_rgba_row_endian(
y, u, v, rgba_out, width, matrix, full_range, use_simd, false,
);
}
#[cfg_attr(not(tarpaulin), inline(always))]
#[allow(clippy::too_many_arguments)]
pub fn yuv444p12_to_rgba_u16_row_endian(
y: &[u16],
u: &[u16],
v: &[u16],
rgba_out: &mut [u16],
width: usize,
matrix: KernelMatrix,
full_range: bool,
use_simd: bool,
big_endian: bool,
) {
let rgba_min = rgba_row_elems(width);
assert!(y.len() >= width, "y row too short");
assert!(u.len() >= width, "u row too short");
assert!(v.len() >= width, "v row too short");
assert!(rgba_out.len() >= rgba_min, "rgba_out row too short");
macro_rules! dispatch_be {
($call_le:expr, $call_be:expr) => {
if big_endian { $call_be } else { $call_le }
};
}
if use_simd {
cfg_select! {
target_arch = "aarch64" => {
if neon_available() {
dispatch_be!(
unsafe {
arch::neon::yuv_444p_n_to_rgba_u16_row::<12, false>(
y, u, v, rgba_out, width, matrix, full_range,
);
},
unsafe {
arch::neon::yuv_444p_n_to_rgba_u16_row::<12, true>(
y, u, v, rgba_out, width, matrix, full_range,
);
}
);
return;
}
}
target_arch = "x86_64" => {
if avx512_available() {
dispatch_be!(
unsafe {
arch::x86_avx512::yuv_444p_n_to_rgba_u16_row::<12, false>(
y, u, v, rgba_out, width, matrix, full_range,
);
},
unsafe {
arch::x86_avx512::yuv_444p_n_to_rgba_u16_row::<12, true>(
y, u, v, rgba_out, width, matrix, full_range,
);
}
);
return;
}
if avx2_available() {
dispatch_be!(
unsafe {
arch::x86_avx2::yuv_444p_n_to_rgba_u16_row::<12, false>(
y, u, v, rgba_out, width, matrix, full_range,
);
},
unsafe {
arch::x86_avx2::yuv_444p_n_to_rgba_u16_row::<12, true>(
y, u, v, rgba_out, width, matrix, full_range,
);
}
);
return;
}
if sse41_available() {
dispatch_be!(
unsafe {
arch::x86_sse41::yuv_444p_n_to_rgba_u16_row::<12, false>(
y, u, v, rgba_out, width, matrix, full_range,
);
},
unsafe {
arch::x86_sse41::yuv_444p_n_to_rgba_u16_row::<12, true>(
y, u, v, rgba_out, width, matrix, full_range,
);
}
);
return;
}
}
target_arch = "wasm32" => {
if simd128_available() {
dispatch_be!(
unsafe {
arch::wasm_simd128::yuv_444p_n_to_rgba_u16_row::<12, false>(
y, u, v, rgba_out, width, matrix, full_range,
);
},
unsafe {
arch::wasm_simd128::yuv_444p_n_to_rgba_u16_row::<12, true>(
y, u, v, rgba_out, width, matrix, full_range,
);
}
);
return;
}
}
_ => {}
}
}
dispatch_be!(
scalar::yuv_444p_n_to_rgba_u16_row::<12, false>(y, u, v, rgba_out, width, matrix, full_range),
scalar::yuv_444p_n_to_rgba_u16_row::<12, true>(y, u, v, rgba_out, width, matrix, full_range)
);
}
#[cfg_attr(not(tarpaulin), inline(always))]
#[allow(clippy::too_many_arguments)]
pub fn yuv444p12_to_rgba_u16_row(
y: &[u16],
u: &[u16],
v: &[u16],
rgba_out: &mut [u16],
width: usize,
matrix: KernelMatrix,
full_range: bool,
use_simd: bool,
) {
yuv444p12_to_rgba_u16_row_endian(
y, u, v, rgba_out, width, matrix, full_range, use_simd, false,
);
}
#[cfg_attr(not(tarpaulin), inline(always))]
#[allow(clippy::too_many_arguments)]
pub fn yuv444p12_to_hsv_row_endian(
y: &[u16],
u: &[u16],
v: &[u16],
h_out: &mut [u8],
s_out: &mut [u8],
v_out: &mut [u8],
width: usize,
matrix: KernelMatrix,
full_range: bool,
use_simd: bool,
big_endian: bool,
) {
if big_endian {
super::yuv_444p_n_to_hsv_row::<12, true>(
y, u, v, h_out, s_out, v_out, width, matrix, full_range, use_simd,
);
} else {
super::yuv_444p_n_to_hsv_row::<12, false>(
y, u, v, h_out, s_out, v_out, width, matrix, full_range, use_simd,
);
}
}
#[cfg(any(feature = "std", feature = "alloc"))]
use crate::Transfer;
#[cfg(any(feature = "std", feature = "alloc"))]
use scalar::ictcp::{self, IctcpTransfer};
#[cfg(any(feature = "std", feature = "alloc"))]
#[cfg_attr(not(tarpaulin), inline(always))]
#[allow(clippy::too_many_arguments)]
pub fn yuv444p12_to_rgb_row_ictcp_endian(
y: &[u16],
u: &[u16],
v: &[u16],
rgb_out: &mut [u8],
width: usize,
matrix: KernelMatrix,
tag: &ColorMatrix,
full_range: bool,
transfer: &Transfer,
use_simd: bool,
big_endian: bool,
) {
if matches!(tag, ColorMatrix::Ictcp)
&& let Some(tf) = IctcpTransfer::for_transfer(transfer)
{
if big_endian {
ictcp::ictcp_444p_n_to_rgb_row::<12, true>(y, u, v, rgb_out, width, full_range, tf);
} else {
ictcp::ictcp_444p_n_to_rgb_row::<12, false>(y, u, v, rgb_out, width, full_range, tf);
}
return;
}
yuv444p12_to_rgb_row_endian(
y, u, v, rgb_out, width, matrix, full_range, use_simd, big_endian,
);
}
#[cfg(any(feature = "std", feature = "alloc"))]
#[cfg_attr(not(tarpaulin), inline(always))]
#[allow(clippy::too_many_arguments)]
pub fn yuv444p12_to_rgba_row_ictcp_endian(
y: &[u16],
u: &[u16],
v: &[u16],
rgba_out: &mut [u8],
width: usize,
matrix: KernelMatrix,
tag: &ColorMatrix,
full_range: bool,
transfer: &Transfer,
use_simd: bool,
big_endian: bool,
) {
if matches!(tag, ColorMatrix::Ictcp)
&& let Some(tf) = IctcpTransfer::for_transfer(transfer)
{
if big_endian {
ictcp::ictcp_444p_n_to_rgba_row::<12, true>(y, u, v, rgba_out, width, full_range, tf);
} else {
ictcp::ictcp_444p_n_to_rgba_row::<12, false>(y, u, v, rgba_out, width, full_range, tf);
}
return;
}
yuv444p12_to_rgba_row_endian(
y, u, v, rgba_out, width, matrix, full_range, use_simd, big_endian,
);
}
#[cfg(any(feature = "std", feature = "alloc"))]
#[cfg_attr(not(tarpaulin), inline(always))]
#[allow(clippy::too_many_arguments)]
pub fn yuv444p12_to_rgb_u16_row_ictcp_endian(
y: &[u16],
u: &[u16],
v: &[u16],
rgb_out: &mut [u16],
width: usize,
matrix: KernelMatrix,
tag: &ColorMatrix,
full_range: bool,
transfer: &Transfer,
use_simd: bool,
big_endian: bool,
) {
if matches!(tag, ColorMatrix::Ictcp)
&& let Some(tf) = IctcpTransfer::for_transfer(transfer)
{
if big_endian {
ictcp::ictcp_444p_n_to_rgb_u16_row::<12, true>(y, u, v, rgb_out, width, full_range, tf);
} else {
ictcp::ictcp_444p_n_to_rgb_u16_row::<12, false>(y, u, v, rgb_out, width, full_range, tf);
}
return;
}
yuv444p12_to_rgb_u16_row_endian(
y, u, v, rgb_out, width, matrix, full_range, use_simd, big_endian,
);
}
#[cfg(any(feature = "std", feature = "alloc"))]
#[cfg_attr(not(tarpaulin), inline(always))]
#[allow(clippy::too_many_arguments)]
pub fn yuv444p12_to_rgba_u16_row_ictcp_endian(
y: &[u16],
u: &[u16],
v: &[u16],
rgba_out: &mut [u16],
width: usize,
matrix: KernelMatrix,
tag: &ColorMatrix,
full_range: bool,
transfer: &Transfer,
use_simd: bool,
big_endian: bool,
) {
if matches!(tag, ColorMatrix::Ictcp)
&& let Some(tf) = IctcpTransfer::for_transfer(transfer)
{
if big_endian {
ictcp::ictcp_444p_n_to_rgba_u16_row::<12, true>(y, u, v, rgba_out, width, full_range, tf);
} else {
ictcp::ictcp_444p_n_to_rgba_u16_row::<12, false>(y, u, v, rgba_out, width, full_range, tf);
}
return;
}
yuv444p12_to_rgba_u16_row_endian(
y, u, v, rgba_out, width, matrix, full_range, use_simd, big_endian,
);
}
#[cfg(any(feature = "std", feature = "alloc"))]
use crate::Primaries;
#[cfg(any(feature = "std", feature = "alloc"))]
use scalar::cl::{self, ClSystem};
#[cfg(any(feature = "std", feature = "alloc"))]
#[cfg_attr(not(tarpaulin), inline(always))]
#[allow(clippy::too_many_arguments)]
pub fn yuv444p12_to_rgb_row_chroma_derived_cl_endian(
y: &[u16],
u: &[u16],
v: &[u16],
rgb_out: &mut [u8],
width: usize,
matrix: KernelMatrix,
tag: &ColorMatrix,
primaries: &Primaries,
full_range: bool,
transfer: &Transfer,
use_simd: bool,
big_endian: bool,
) {
if matches!(tag, ColorMatrix::ChromaDerivedCl)
&& let Some(system) = ClSystem::resolve(primaries, transfer)
{
if big_endian {
cl::cl_444p_n_to_rgb_row::<12, true>(y, u, v, rgb_out, width, full_range, system);
} else {
cl::cl_444p_n_to_rgb_row::<12, false>(y, u, v, rgb_out, width, full_range, system);
}
return;
}
yuv444p12_to_rgb_row_ictcp_endian(
y, u, v, rgb_out, width, matrix, tag, full_range, transfer, use_simd, big_endian,
);
}
#[cfg(any(feature = "std", feature = "alloc"))]
#[cfg_attr(not(tarpaulin), inline(always))]
#[allow(clippy::too_many_arguments)]
pub fn yuv444p12_to_rgba_row_chroma_derived_cl_endian(
y: &[u16],
u: &[u16],
v: &[u16],
rgba_out: &mut [u8],
width: usize,
matrix: KernelMatrix,
tag: &ColorMatrix,
primaries: &Primaries,
full_range: bool,
transfer: &Transfer,
use_simd: bool,
big_endian: bool,
) {
if matches!(tag, ColorMatrix::ChromaDerivedCl)
&& let Some(system) = ClSystem::resolve(primaries, transfer)
{
if big_endian {
cl::cl_444p_n_to_rgba_row::<12, true>(y, u, v, rgba_out, width, full_range, system);
} else {
cl::cl_444p_n_to_rgba_row::<12, false>(y, u, v, rgba_out, width, full_range, system);
}
return;
}
yuv444p12_to_rgba_row_ictcp_endian(
y, u, v, rgba_out, width, matrix, tag, full_range, transfer, use_simd, big_endian,
);
}
#[cfg(any(feature = "std", feature = "alloc"))]
#[cfg_attr(not(tarpaulin), inline(always))]
#[allow(clippy::too_many_arguments)]
pub fn yuv444p12_to_rgb_u16_row_chroma_derived_cl_endian(
y: &[u16],
u: &[u16],
v: &[u16],
rgb_out: &mut [u16],
width: usize,
matrix: KernelMatrix,
tag: &ColorMatrix,
primaries: &Primaries,
full_range: bool,
transfer: &Transfer,
use_simd: bool,
big_endian: bool,
) {
if matches!(tag, ColorMatrix::ChromaDerivedCl)
&& let Some(system) = ClSystem::resolve(primaries, transfer)
{
if big_endian {
cl::cl_444p_n_to_rgb_u16_row::<12, true>(y, u, v, rgb_out, width, full_range, system);
} else {
cl::cl_444p_n_to_rgb_u16_row::<12, false>(y, u, v, rgb_out, width, full_range, system);
}
return;
}
yuv444p12_to_rgb_u16_row_ictcp_endian(
y, u, v, rgb_out, width, matrix, tag, full_range, transfer, use_simd, big_endian,
);
}
#[cfg(any(feature = "std", feature = "alloc"))]
#[cfg_attr(not(tarpaulin), inline(always))]
#[allow(clippy::too_many_arguments)]
pub fn yuv444p12_to_rgba_u16_row_chroma_derived_cl_endian(
y: &[u16],
u: &[u16],
v: &[u16],
rgba_out: &mut [u16],
width: usize,
matrix: KernelMatrix,
tag: &ColorMatrix,
primaries: &Primaries,
full_range: bool,
transfer: &Transfer,
use_simd: bool,
big_endian: bool,
) {
if matches!(tag, ColorMatrix::ChromaDerivedCl)
&& let Some(system) = ClSystem::resolve(primaries, transfer)
{
if big_endian {
cl::cl_444p_n_to_rgba_u16_row::<12, true>(y, u, v, rgba_out, width, full_range, system);
} else {
cl::cl_444p_n_to_rgba_u16_row::<12, false>(y, u, v, rgba_out, width, full_range, system);
}
return;
}
yuv444p12_to_rgba_u16_row_ictcp_endian(
y, u, v, rgba_out, width, matrix, tag, full_range, transfer, use_simd, big_endian,
);
}
#[cfg(any(feature = "std", feature = "alloc"))]
use scalar::iptc2::{self, IptC2Transfer};
#[cfg(any(feature = "std", feature = "alloc"))]
#[cfg_attr(not(tarpaulin), inline(always))]
#[allow(clippy::too_many_arguments)]
pub fn yuv444p12_to_rgb_row_iptc2_endian(
y: &[u16],
u: &[u16],
v: &[u16],
rgb_out: &mut [u8],
width: usize,
matrix: KernelMatrix,
tag: &ColorMatrix,
primaries: &Primaries,
full_range: bool,
transfer: &Transfer,
use_simd: bool,
big_endian: bool,
) {
if matches!(tag, ColorMatrix::IptC2) && IptC2Transfer::for_transfer(transfer).is_some() {
if big_endian {
iptc2::iptc2_444p_n_to_rgb_row::<12, true>(y, u, v, rgb_out, width, full_range);
} else {
iptc2::iptc2_444p_n_to_rgb_row::<12, false>(y, u, v, rgb_out, width, full_range);
}
return;
}
yuv444p12_to_rgb_row_chroma_derived_cl_endian(
y, u, v, rgb_out, width, matrix, tag, primaries, full_range, transfer, use_simd, big_endian,
);
}
#[cfg(any(feature = "std", feature = "alloc"))]
#[cfg_attr(not(tarpaulin), inline(always))]
#[allow(clippy::too_many_arguments)]
pub fn yuv444p12_to_rgba_row_iptc2_endian(
y: &[u16],
u: &[u16],
v: &[u16],
rgba_out: &mut [u8],
width: usize,
matrix: KernelMatrix,
tag: &ColorMatrix,
primaries: &Primaries,
full_range: bool,
transfer: &Transfer,
use_simd: bool,
big_endian: bool,
) {
if matches!(tag, ColorMatrix::IptC2) && IptC2Transfer::for_transfer(transfer).is_some() {
if big_endian {
iptc2::iptc2_444p_n_to_rgba_row::<12, true>(y, u, v, rgba_out, width, full_range);
} else {
iptc2::iptc2_444p_n_to_rgba_row::<12, false>(y, u, v, rgba_out, width, full_range);
}
return;
}
yuv444p12_to_rgba_row_chroma_derived_cl_endian(
y, u, v, rgba_out, width, matrix, tag, primaries, full_range, transfer, use_simd, big_endian,
);
}
#[cfg(any(feature = "std", feature = "alloc"))]
#[cfg_attr(not(tarpaulin), inline(always))]
#[allow(clippy::too_many_arguments)]
pub fn yuv444p12_to_rgb_u16_row_iptc2_endian(
y: &[u16],
u: &[u16],
v: &[u16],
rgb_out: &mut [u16],
width: usize,
matrix: KernelMatrix,
tag: &ColorMatrix,
primaries: &Primaries,
full_range: bool,
transfer: &Transfer,
use_simd: bool,
big_endian: bool,
) {
if matches!(tag, ColorMatrix::IptC2) && IptC2Transfer::for_transfer(transfer).is_some() {
if big_endian {
iptc2::iptc2_444p_n_to_rgb_u16_row::<12, true>(y, u, v, rgb_out, width, full_range);
} else {
iptc2::iptc2_444p_n_to_rgb_u16_row::<12, false>(y, u, v, rgb_out, width, full_range);
}
return;
}
yuv444p12_to_rgb_u16_row_chroma_derived_cl_endian(
y, u, v, rgb_out, width, matrix, tag, primaries, full_range, transfer, use_simd, big_endian,
);
}
#[cfg(any(feature = "std", feature = "alloc"))]
#[cfg_attr(not(tarpaulin), inline(always))]
#[allow(clippy::too_many_arguments)]
pub fn yuv444p12_to_rgba_u16_row_iptc2_endian(
y: &[u16],
u: &[u16],
v: &[u16],
rgba_out: &mut [u16],
width: usize,
matrix: KernelMatrix,
tag: &ColorMatrix,
primaries: &Primaries,
full_range: bool,
transfer: &Transfer,
use_simd: bool,
big_endian: bool,
) {
if matches!(tag, ColorMatrix::IptC2) && IptC2Transfer::for_transfer(transfer).is_some() {
if big_endian {
iptc2::iptc2_444p_n_to_rgba_u16_row::<12, true>(y, u, v, rgba_out, width, full_range);
} else {
iptc2::iptc2_444p_n_to_rgba_u16_row::<12, false>(y, u, v, rgba_out, width, full_range);
}
return;
}
yuv444p12_to_rgba_u16_row_chroma_derived_cl_endian(
y, u, v, rgba_out, width, matrix, tag, primaries, full_range, transfer, use_simd, big_endian,
);
}
#[cfg(any(feature = "std", feature = "alloc"))]
use scalar::smpte2085::{self, Smpte2085Transfer};
#[cfg(any(feature = "std", feature = "alloc"))]
#[cfg_attr(not(tarpaulin), inline(always))]
#[allow(clippy::too_many_arguments)]
pub fn yuv444p12_to_rgb_row_smpte2085_endian(
y: &[u16],
u: &[u16],
v: &[u16],
rgb_out: &mut [u8],
width: usize,
matrix: KernelMatrix,
tag: &ColorMatrix,
primaries: &Primaries,
full_range: bool,
transfer: &Transfer,
use_simd: bool,
big_endian: bool,
) {
if matches!(tag, ColorMatrix::Smpte2085) && Smpte2085Transfer::for_transfer(transfer).is_some() {
let rgb_min = rgb_row_bytes(width);
assert!(y.len() >= width, "y row too short");
assert!(u.len() >= width, "u row too short");
assert!(v.len() >= width, "v row too short");
assert!(rgb_out.len() >= rgb_min, "rgb_out row too short");
if big_endian {
smpte2085::smpte2085_444p_n_to_rgb_row::<12, true>(y, u, v, rgb_out, width, full_range);
} else {
smpte2085::smpte2085_444p_n_to_rgb_row::<12, false>(y, u, v, rgb_out, width, full_range);
}
return;
}
yuv444p12_to_rgb_row_iptc2_endian(
y, u, v, rgb_out, width, matrix, tag, primaries, full_range, transfer, use_simd, big_endian,
);
}
#[cfg(any(feature = "std", feature = "alloc"))]
#[cfg_attr(not(tarpaulin), inline(always))]
#[allow(clippy::too_many_arguments)]
pub fn yuv444p12_to_rgba_row_smpte2085_endian(
y: &[u16],
u: &[u16],
v: &[u16],
rgba_out: &mut [u8],
width: usize,
matrix: KernelMatrix,
tag: &ColorMatrix,
primaries: &Primaries,
full_range: bool,
transfer: &Transfer,
use_simd: bool,
big_endian: bool,
) {
if matches!(tag, ColorMatrix::Smpte2085) && Smpte2085Transfer::for_transfer(transfer).is_some() {
let rgba_min = rgba_row_bytes(width);
assert!(y.len() >= width, "y row too short");
assert!(u.len() >= width, "u row too short");
assert!(v.len() >= width, "v row too short");
assert!(rgba_out.len() >= rgba_min, "rgba_out row too short");
if big_endian {
smpte2085::smpte2085_444p_n_to_rgba_row::<12, true>(y, u, v, rgba_out, width, full_range);
} else {
smpte2085::smpte2085_444p_n_to_rgba_row::<12, false>(y, u, v, rgba_out, width, full_range);
}
return;
}
yuv444p12_to_rgba_row_iptc2_endian(
y, u, v, rgba_out, width, matrix, tag, primaries, full_range, transfer, use_simd, big_endian,
);
}
#[cfg(any(feature = "std", feature = "alloc"))]
#[cfg_attr(not(tarpaulin), inline(always))]
#[allow(clippy::too_many_arguments)]
pub fn yuv444p12_to_rgb_u16_row_smpte2085_endian(
y: &[u16],
u: &[u16],
v: &[u16],
rgb_out: &mut [u16],
width: usize,
matrix: KernelMatrix,
tag: &ColorMatrix,
primaries: &Primaries,
full_range: bool,
transfer: &Transfer,
use_simd: bool,
big_endian: bool,
) {
if matches!(tag, ColorMatrix::Smpte2085) && Smpte2085Transfer::for_transfer(transfer).is_some() {
let rgb_min = rgb_row_elems(width);
assert!(y.len() >= width, "y row too short");
assert!(u.len() >= width, "u row too short");
assert!(v.len() >= width, "v row too short");
assert!(rgb_out.len() >= rgb_min, "rgb_out row too short");
if big_endian {
smpte2085::smpte2085_444p_n_to_rgb_u16_row::<12, true>(y, u, v, rgb_out, width, full_range);
} else {
smpte2085::smpte2085_444p_n_to_rgb_u16_row::<12, false>(y, u, v, rgb_out, width, full_range);
}
return;
}
yuv444p12_to_rgb_u16_row_iptc2_endian(
y, u, v, rgb_out, width, matrix, tag, primaries, full_range, transfer, use_simd, big_endian,
);
}
#[cfg(any(feature = "std", feature = "alloc"))]
#[cfg_attr(not(tarpaulin), inline(always))]
#[allow(clippy::too_many_arguments)]
pub fn yuv444p12_to_rgba_u16_row_smpte2085_endian(
y: &[u16],
u: &[u16],
v: &[u16],
rgba_out: &mut [u16],
width: usize,
matrix: KernelMatrix,
tag: &ColorMatrix,
primaries: &Primaries,
full_range: bool,
transfer: &Transfer,
use_simd: bool,
big_endian: bool,
) {
if matches!(tag, ColorMatrix::Smpte2085) && Smpte2085Transfer::for_transfer(transfer).is_some() {
let rgba_min = rgba_row_elems(width);
assert!(y.len() >= width, "y row too short");
assert!(u.len() >= width, "u row too short");
assert!(v.len() >= width, "v row too short");
assert!(rgba_out.len() >= rgba_min, "rgba_out row too short");
if big_endian {
smpte2085::smpte2085_444p_n_to_rgba_u16_row::<12, true>(y, u, v, rgba_out, width, full_range);
} else {
smpte2085::smpte2085_444p_n_to_rgba_u16_row::<12, false>(
y, u, v, rgba_out, width, full_range,
);
}
return;
}
yuv444p12_to_rgba_u16_row_iptc2_endian(
y, u, v, rgba_out, width, matrix, tag, primaries, full_range, transfer, use_simd, big_endian,
);
}