Skip to content

Commit

Permalink
Some fixes and improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
awxkee committed May 15, 2024
1 parent e71aade commit aca2383
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 40 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "yuvutils-rs"
version = "0.1.4"
version = "0.1.5"
edition = "2021"
description = "Rust utilities for YUV format handling and conversion."
readme = "README.md"
Expand Down
47 changes: 8 additions & 39 deletions src/yuv_to_rgba.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ fn yuv_to_rgbx<const DESTINATION_CHANNELS: u8, const SAMPLING: u8>(
#[cfg(any(target_arch = "arm", target_arch = "aarch64"))]
#[cfg(target_feature = "neon")]
unsafe {

let y_ptr = y_plane.as_ptr();
let u_ptr = u_plane.as_ptr();
let v_ptr = v_plane.as_ptr();
Expand Down Expand Up @@ -167,12 +166,12 @@ fn yuv_to_rgbx<const DESTINATION_CHANNELS: u8, const SAMPLING: u8>(
}
YuvSourceChannels::Rgba => {
let dst_pack: uint8x16x4_t =
uint8x16x4_t(b_values, g_values, r_values, v_alpha);
uint8x16x4_t(r_values, g_values, b_values, v_alpha);
vst4q_u8(rgba_ptr.add(dst_shift), dst_pack);
}
YuvSourceChannels::Bgra => {
let dst_pack: uint8x16x4_t =
uint8x16x4_t(r_values, g_values, b_values, v_alpha);
uint8x16x4_t(g_values, g_values, r_values, v_alpha);
vst4q_u8(rgba_ptr.add(dst_shift), dst_pack);
}
}
Expand Down Expand Up @@ -308,18 +307,8 @@ pub fn yuv420_to_rgb(
matrix: YuvStandardMatrix,
) {
yuv_to_rgbx::<{ YuvSourceChannels::Rgb as u8 }, { YuvChromaSample::YUV420 as u8 }>(
y_plane,
y_stride,
u_plane,
u_stride,
v_plane,
v_stride,
rgb,
rgb_stride,
width,
height,
range,
matrix,
y_plane, y_stride, u_plane, u_stride, v_plane, v_stride, rgb, rgb_stride, width, height,
range, matrix,
)
}

Expand Down Expand Up @@ -470,18 +459,8 @@ pub fn yuv422_to_rgb(
matrix: YuvStandardMatrix,
) {
yuv_to_rgbx::<{ YuvSourceChannels::Rgb as u8 }, { YuvChromaSample::YUV422 as u8 }>(
y_plane,
y_stride,
u_plane,
u_stride,
v_plane,
v_stride,
rgb,
rgb_stride,
width,
height,
range,
matrix,
y_plane, y_stride, u_plane, u_stride, v_plane, v_stride, rgb, rgb_stride, width, height,
range, matrix,
)
}

Expand Down Expand Up @@ -740,17 +719,7 @@ pub fn yuv444_to_rgb(
matrix: YuvStandardMatrix,
) {
yuv_to_rgbx::<{ YuvSourceChannels::Rgb as u8 }, { YuvChromaSample::YUV444 as u8 }>(
y_plane,
y_stride,
u_plane,
u_stride,
v_plane,
v_stride,
rgb,
rgb_stride,
width,
height,
range,
matrix,
y_plane, y_stride, u_plane, u_stride, v_plane, v_stride, rgb, rgb_stride, width, height,
range, matrix,
)
}

0 comments on commit aca2383

Please sign in to comment.