Skip to content

Commit

Permalink
Clippy, bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
awxkee committed Sep 5, 2024
1 parent 10ce13e commit 5c837a4
Show file tree
Hide file tree
Showing 62 changed files with 295 additions and 313 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ workspace = { members = ["app"] }

[package]
name = "yuvutils-rs"
version = "0.4.5"
version = "0.4.6"
edition = "2021"
description = "High performance utilities for YUV format handling and conversion."
readme = "README.md"
keywords = ["yuv", "ycbcr", "yuv2rgb", "rgb2yuv"]
keywords = ["yuv", "ycbcr", "yuv2rgb", "rgb2yuv", "converter"]
license = "Apache-2.0 OR BSD-3-Clause"
authors = ["Radzivon Bartoshyk"]
documentation = "https://github.com/awxkee/yuvutils-rs"
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,10 @@ ycgco420_to_rgb(&y_plane, y_stride,
width, height,
YuvRange::TV);
```

This project is licensed under either of

- BSD-3-Clause License (see [LICENSE](LICENSE.md))
- Apache License, Version 2.0 (see [LICENSE](LICENSE-APACHE.md))

at your option.
6 changes: 2 additions & 4 deletions src/avx2/avx2_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ pub unsafe fn avx2_interleave_odd(x: __m256i) -> __m256i {
21, 21, 23, 23,
25, 25, 27, 27,
29, 29, 31, 31);
let new_lane = _mm256_shuffle_epi8(x, shuffle);
new_lane
_mm256_shuffle_epi8(x, shuffle)
}

#[inline]
Expand All @@ -144,8 +143,7 @@ pub unsafe fn avx2_interleave_even(x: __m256i) -> __m256i {
20, 20, 22, 22,
24, 24, 26, 26,
28, 28, 30, 30);
let new_lane = _mm256_shuffle_epi8(x, shuffle);
new_lane
_mm256_shuffle_epi8(x, shuffle)
}

#[inline]
Expand Down
2 changes: 1 addition & 1 deletion src/avx2/rgb_to_ycgco.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,5 @@ pub unsafe fn avx2_rgb_to_ycgco_row<const ORIGIN_CHANNELS: u8, const SAMPLING: u
cx += 32;
}

return ProcessedOffset { cx, ux: uv_x };
ProcessedOffset { cx, ux: uv_x }
}
2 changes: 1 addition & 1 deletion src/avx2/ycgco_to_rgb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,5 +197,5 @@ pub unsafe fn avx2_ycgco_to_rgb_row<const DESTINATION_CHANNELS: u8, const SAMPLI
}
}

return ProcessedOffset { cx, ux: uv_x };
ProcessedOffset { cx, ux: uv_x }
}
4 changes: 2 additions & 2 deletions src/avx2/yuv_nv_to_rgba.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ pub unsafe fn avx2_yuv_nv_to_rgba_row<
let v_cr_coeff = _mm256_set1_epi16(transform.cr_coef as i16);
let v_cb_coeff = _mm256_set1_epi16(transform.cb_coef as i16);
let v_min_values = _mm256_setzero_si256();
let v_g_coeff_1 = _mm256_set1_epi16(-1 * transform.g_coeff_1 as i16);
let v_g_coeff_2 = _mm256_set1_epi16(-1 * transform.g_coeff_2 as i16);
let v_g_coeff_1 = _mm256_set1_epi16(-(transform.g_coeff_1 as i16));
let v_g_coeff_2 = _mm256_set1_epi16(-(transform.g_coeff_2 as i16));
let v_alpha = _mm256_set1_epi8(255u8 as i8);
let rounding_const = _mm256_set1_epi16(1 << 5);

Expand Down
4 changes: 2 additions & 2 deletions src/avx2/yuv_to_rgba.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ pub unsafe fn avx2_yuv_to_rgba_row<const DESTINATION_CHANNELS: u8, const SAMPLIN
let v_cr_coeff = _mm256_set1_epi16(transform.cr_coef as i16);
let v_cb_coeff = _mm256_set1_epi16(transform.cb_coef as i16);
let v_min_values = _mm256_setzero_si256();
let v_g_coeff_1 = _mm256_set1_epi16(-1 * transform.g_coeff_1 as i16);
let v_g_coeff_2 = _mm256_set1_epi16(-1 * transform.g_coeff_2 as i16);
let v_g_coeff_1 = _mm256_set1_epi16(-(transform.g_coeff_1 as i16));
let v_g_coeff_2 = _mm256_set1_epi16(-(transform.g_coeff_2 as i16));
let v_alpha = _mm256_set1_epi8(255u8 as i8);
let rounding_const = _mm256_set1_epi16(1 << 5);

Expand Down
4 changes: 2 additions & 2 deletions src/avx2/yuv_to_rgba_alpha.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ pub unsafe fn avx2_yuv_to_rgba_alpha<const DESTINATION_CHANNELS: u8, const SAMPL
let v_cr_coeff = _mm256_set1_epi16(transform.cr_coef as i16);
let v_cb_coeff = _mm256_set1_epi16(transform.cb_coef as i16);
let v_min_values = _mm256_setzero_si256();
let v_g_coeff_1 = _mm256_set1_epi16(-1 * transform.g_coeff_1 as i16);
let v_g_coeff_2 = _mm256_set1_epi16(-1 * transform.g_coeff_2 as i16);
let v_g_coeff_1 = _mm256_set1_epi16(-(transform.g_coeff_1 as i16));
let v_g_coeff_2 = _mm256_set1_epi16(-(transform.g_coeff_2 as i16));
let rounding_const = _mm256_set1_epi16(1 << 5);

while cx + 32 < width {
Expand Down
24 changes: 7 additions & 17 deletions src/avx2/yuv_to_yuv2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ pub unsafe fn yuv_to_yuy2_avx2_row<const SAMPLING: u8, const YUY2_TARGET: usize>

let u_pixels;
let v_pixels;
let y_pixels;

let y_ptr = y_plane.as_ptr().add(y_pos);
y_pixels = (
let y_pixels = (
_mm256_loadu_si256(y_ptr as *const __m256i),
_mm256_loadu_si256(y_ptr.add(32) as *const __m256i),
);
Expand All @@ -70,21 +69,12 @@ pub unsafe fn yuv_to_yuy2_avx2_row<const SAMPLING: u8, const YUY2_TARGET: usize>

let (low_y, high_y) = _mm256_deinterleave_x2_epi8(y_pixels.0, y_pixels.1);

let storage;
match yuy2_target {
Yuy2Description::YUYV => {
storage = (low_y, u_pixels, high_y, v_pixels);
}
Yuy2Description::UYVY => {
storage = (u_pixels, low_y, v_pixels, high_y);
}
Yuy2Description::YVYU => {
storage = (low_y, v_pixels, high_y, u_pixels);
}
Yuy2Description::VYUY => {
storage = (v_pixels, low_y, u_pixels, high_y);
}
}
let storage = match yuy2_target {
Yuy2Description::YUYV => (low_y, u_pixels, high_y, v_pixels),
Yuy2Description::UYVY => (u_pixels, low_y, v_pixels, high_y),
Yuy2Description::YVYU => (low_y, v_pixels, high_y, u_pixels),
Yuy2Description::VYUY => (v_pixels, low_y, u_pixels, high_y),
};

let dst_offset = yuy2_offset + x * 4;

Expand Down
4 changes: 2 additions & 2 deletions src/avx2/yuy2_to_rgb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ pub fn yuy2_to_rgb_avx<const DST_CHANNELS: u8, const YUY2_TARGET: usize>(
let v_luma_coeff = _mm256_set1_epi16(transform.y_coef as i16);
let v_cr_coeff = _mm256_set1_epi16(transform.cr_coef as i16);
let v_cb_coeff = _mm256_set1_epi16(transform.cb_coef as i16);
let v_g_coeff_1 = _mm256_set1_epi16(-1i16 * transform.g_coeff_1 as i16);
let v_g_coeff_2 = _mm256_set1_epi16(-1i16 * transform.g_coeff_2 as i16);
let v_g_coeff_1 = _mm256_set1_epi16(-(transform.g_coeff_1 as i16));
let v_g_coeff_2 = _mm256_set1_epi16(-(transform.g_coeff_2 as i16));
let v_alpha = _mm256_set1_epi8(255u8 as i8);
let zeros = _mm256_setzero_si256();
let rounding_const = _mm256_set1_epi16(1 << 5);
Expand Down
2 changes: 1 addition & 1 deletion src/avx512bw/avx512_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ pub unsafe fn avx512_div_by255(v: __m512i) -> __m512i {
let x = _mm512_adds_epi16(v, rounding);
let multiplier = _mm512_set1_epi16(-32640);
let r = _mm512_mulhi_epu16(x, multiplier);
return _mm512_srli_epi16::<7>(r);
_mm512_srli_epi16::<7>(r)
}

#[inline]
Expand Down
2 changes: 1 addition & 1 deletion src/avx512bw/ycgco_to_rgb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,5 +201,5 @@ pub unsafe fn avx512_ycgco_to_rgb_row<const DESTINATION_CHANNELS: u8, const SAMP
}
}

return ProcessedOffset { cx, ux: uv_x };
ProcessedOffset { cx, ux: uv_x }
}
4 changes: 2 additions & 2 deletions src/avx512bw/yuv_nv_to_rgba.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ pub unsafe fn avx512_yuv_nv_to_rgba<
let v_cr_coeff = _mm512_set1_epi16(transform.cr_coef as i16);
let v_cb_coeff = _mm512_set1_epi16(transform.cb_coef as i16);
let v_min_values = _mm512_setzero_si512();
let v_g_coeff_1 = _mm512_set1_epi16(-1 * transform.g_coeff_1 as i16);
let v_g_coeff_2 = _mm512_set1_epi16(-1 * transform.g_coeff_2 as i16);
let v_g_coeff_1 = _mm512_set1_epi16(-(transform.g_coeff_1 as i16));
let v_g_coeff_2 = _mm512_set1_epi16(-(transform.g_coeff_2 as i16));
let v_alpha = _mm512_set1_epi8(255u8 as i8);
let rounding_const = _mm512_set1_epi16(1 << 5);

Expand Down
4 changes: 2 additions & 2 deletions src/avx512bw/yuv_to_rgba.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ pub unsafe fn avx512_yuv_to_rgba<const DESTINATION_CHANNELS: u8, const SAMPLING:
let v_cr_coeff = _mm512_set1_epi16(transform.cr_coef as i16);
let v_cb_coeff = _mm512_set1_epi16(transform.cb_coef as i16);
let v_min_values = _mm512_setzero_si512();
let v_g_coeff_1 = _mm512_set1_epi16(-1 * transform.g_coeff_1 as i16);
let v_g_coeff_2 = _mm512_set1_epi16(-1 * transform.g_coeff_2 as i16);
let v_g_coeff_1 = _mm512_set1_epi16(-(transform.g_coeff_1 as i16));
let v_g_coeff_2 = _mm512_set1_epi16(-(transform.g_coeff_2 as i16));
let v_alpha = _mm512_set1_epi8(255u8 as i8);
let rounding_const = _mm512_set1_epi16(1 << 5);

Expand Down
4 changes: 2 additions & 2 deletions src/avx512bw/yuv_to_rgba_alpha.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ pub unsafe fn avx512_yuv_to_rgba_alpha<const DESTINATION_CHANNELS: u8, const SAM
let v_cr_coeff = _mm512_set1_epi16(transform.cr_coef as i16);
let v_cb_coeff = _mm512_set1_epi16(transform.cb_coef as i16);
let v_min_values = _mm512_setzero_si512();
let v_g_coeff_1 = _mm512_set1_epi16(-1 * transform.g_coeff_1 as i16);
let v_g_coeff_2 = _mm512_set1_epi16(-1 * transform.g_coeff_2 as i16);
let v_g_coeff_1 = _mm512_set1_epi16(-(transform.g_coeff_1 as i16));
let v_g_coeff_2 = _mm512_set1_epi16(-(transform.g_coeff_2 as i16));
let rounding_const = _mm512_set1_epi16(1 << 5);

while cx + 64 < width {
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* // Use of this source code is governed by a BSD-style
* // license that can be found in the LICENSE file.
*/
#![allow(clippy::too_many_arguments)]
#![allow(clippy::manual_clamp)]
#![cfg_attr(feature = "nightly_avx512", feature(cfg_version))]
#![cfg_attr(feature = "nightly_avx512", feature(avx512_target_feature))]
#![cfg_attr(feature = "nightly_avx512", feature(stdarch_x86_avx512))]
Expand Down
2 changes: 1 addition & 1 deletion src/neon/from_identity_p16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub unsafe fn gbr_to_image_neon_p16<const DESTINATION_CHANNELS: u8>(
let mut gbr_start_ptr = gbr.add(3 * _cx);
let mut rgb_start_ptr = rgb.add(channels * _cx);

let v_max_colors = vdupq_n_u16(1 << bit_depth - 1);
let v_max_colors = vdupq_n_u16((1 << bit_depth) - 1);

let rgb_part_size = channels * 8;

Expand Down
2 changes: 1 addition & 1 deletion src/neon/rgb_to_y.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,5 @@ pub unsafe fn neon_rgb_to_y_row<const ORIGIN_CHANNELS: u8>(
cx += 16;
}

return cx;
cx
}
2 changes: 1 addition & 1 deletion src/neon/rgb_to_ycgco.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,5 @@ pub unsafe fn neon_rgb_to_ycgco_row<const ORIGIN_CHANNELS: u8, const SAMPLING: u
cx += 16;
}

return ProcessedOffset { cx, ux: uv_x };
ProcessedOffset { cx, ux: uv_x }
}
2 changes: 1 addition & 1 deletion src/neon/rgb_to_ycgco_r.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,5 +139,5 @@ pub unsafe fn neon_rgb_to_ycgcor_row<const ORIGIN_CHANNELS: u8, const SAMPLING:
cx += 16;
}

return ProcessedOffset { cx, ux: uv_x };
ProcessedOffset { cx, ux: uv_x }
}
2 changes: 1 addition & 1 deletion src/neon/y_to_rgb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub unsafe fn neon_y_to_rgb_row<const DESTINATION_CHANNELS: u8>(

let mut cx = start_cx;

while cx + 16 < width as usize {
while cx + 16 < width {
let y_values = vsubq_u8(vld1q_u8(y_ptr.add(y_offset + cx)), y_corr);

let y_high = vreinterpretq_s16_u16(vmull_high_u8(y_values, v_luma_coeff));
Expand Down
2 changes: 1 addition & 1 deletion src/neon/ycgco_to_rgb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,5 @@ pub unsafe fn neon_ycgco_to_rgb_row<const DESTINATION_CHANNELS: u8, const SAMPLI
}
}

return ProcessedOffset { cx, ux: uv_x };
ProcessedOffset { cx, ux: uv_x }
}
2 changes: 1 addition & 1 deletion src/neon/ycgco_to_rgb_alpha.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,5 +164,5 @@ pub unsafe fn neon_ycgco_to_rgb_alpha_row<const DESTINATION_CHANNELS: u8, const
}
}

return ProcessedOffset { cx, ux: uv_x };
ProcessedOffset { cx, ux: uv_x }
}
2 changes: 1 addition & 1 deletion src/neon/ycgcor_to_rgb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,5 @@ pub unsafe fn neon_ycgcor_to_rgb_row<const DESTINATION_CHANNELS: u8, const SAMPL
}
}

return ProcessedOffset { cx, ux: uv_x };
ProcessedOffset { cx, ux: uv_x }
}
8 changes: 3 additions & 5 deletions src/neon/yuv_nv_p10_to_rgba.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,15 @@ pub unsafe fn neon_yuv_nv12_p10_to_rgba_row<
let v_cr_coeff = vdup_n_s16(cr_coef as i16);
let v_cb_coeff = vdup_n_s16(cb_coef as i16);
let v_min_values = vdupq_n_s16(0i16);
let v_g_coeff_1 = vdup_n_s16(-1i16 * (g_coef_1 as i16));
let v_g_coeff_2 = vdup_n_s16(-1i16 * (g_coef_2 as i16));
let v_g_coeff_1 = vdup_n_s16(-(g_coef_1 as i16));
let v_g_coeff_2 = vdup_n_s16(-(g_coef_2 as i16));
let v_alpha = vdup_n_u8(255u8);
let rounding_const = vdupq_n_s32(1 << 5);

let mut cx = start_cx;
let mut ux = start_ux;

while cx + 8 < width as usize {
let y_values: int16x8_t;

let u_high: int16x4_t;
let v_high: int16x4_t;
let u_low: int16x4_t;
Expand All @@ -77,7 +75,7 @@ pub unsafe fn neon_yuv_nv12_p10_to_rgba_row<
if bytes_position == YuvBytesPacking::MostSignificantBytes {
y_vl = vshrq_n_u16::<6>(y_vl);
}
y_values = vsubq_s16(vreinterpretq_s16_u16(y_vl), y_corr);
let y_values: int16x8_t = vsubq_s16(vreinterpretq_s16_u16(y_vl), y_corr);

match chroma_subsampling {
YuvChromaSample::YUV420 | YuvChromaSample::YUV422 => {
Expand Down
8 changes: 3 additions & 5 deletions src/neon/yuv_nv_p16_to_rgb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,15 @@ pub unsafe fn neon_yuv_nv_p16_to_rgba_row<
let v_cr_coeff = vdup_n_s16(cr_coef as i16);
let v_cb_coeff = vdup_n_s16(cb_coef as i16);
let v_min_values = vdupq_n_s16(0i16);
let v_g_coeff_1 = vdup_n_s16(-1i16 * (g_coef_1 as i16));
let v_g_coeff_2 = vdup_n_s16(-1i16 * (g_coef_2 as i16));
let v_g_coeff_1 = vdup_n_s16(-(g_coef_1 as i16));
let v_g_coeff_2 = vdup_n_s16(-(g_coef_2 as i16));

let mut cx = start_cx;
let mut ux = start_ux;

let v_big_shift_count = vdupq_n_s16(-(16i16 - BIT_DEPTH as i16));

while cx + 8 < width as usize {
let y_values: int16x8_t;

let u_high: int16x4_t;
let v_high: int16x4_t;
let u_low: int16x4_t;
Expand All @@ -79,7 +77,7 @@ pub unsafe fn neon_yuv_nv_p16_to_rgba_row<
if bytes_position == YuvBytesPacking::MostSignificantBytes {
y_vl = vshlq_u16(y_vl, v_big_shift_count);
}
y_values = vsubq_s16(vreinterpretq_s16_u16(y_vl), y_corr);
let y_values: int16x8_t = vsubq_s16(vreinterpretq_s16_u16(y_vl), y_corr);

match chroma_subsampling {
YuvChromaSample::YUV420 | YuvChromaSample::YUV422 => {
Expand Down
5 changes: 3 additions & 2 deletions src/neon/yuv_nv_to_rgba.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ pub unsafe fn neon_yuv_nv_to_rgba_row<
let v_cr_coeff = vdupq_n_s16(transform.cr_coef as i16);
let v_cb_coeff = vdupq_n_s16(transform.cb_coef as i16);
let v_min_values = vdupq_n_s16(0i16);
let v_g_coeff_1 = vdupq_n_s16(-1i16 * (transform.g_coeff_1 as i16));
let v_g_coeff_2 = vdupq_n_s16(-1i16 * (transform.g_coeff_2 as i16));
let v_g_coeff_1 = vdupq_n_s16(-(transform.g_coeff_1 as i16));
let v_g_coeff_2 = vdupq_n_s16(-(transform.g_coeff_2 as i16));
let v_alpha = vdupq_n_u8(255u8);

let mut cx = start_cx;
Expand Down Expand Up @@ -179,6 +179,7 @@ pub unsafe fn neon_yuv_nv_to_rgba_row<
u_low_u8 = vtbl1_u8(uv_values, shuffle_u);
v_low_u8 = vtbl1_u8(uv_values, shuffle_v);

#[allow(clippy::manual_swap)]
if order == YuvNVOrder::VU {
let new_v = u_low_u8;
u_low_u8 = v_low_u8;
Expand Down
4 changes: 2 additions & 2 deletions src/neon/yuv_p10_to_rgba.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ pub unsafe fn neon_yuv_p10_to_rgba_row<
let v_cr_coeff = vdup_n_s16(transform.cr_coef as i16);
let v_cb_coeff = vdup_n_s16(transform.cb_coef as i16);
let v_min_values = vdupq_n_s16(0i16);
let v_g_coeff_1 = vdup_n_s16(-1i16 * (transform.g_coeff_1 as i16));
let v_g_coeff_2 = vdup_n_s16(-1i16 * (transform.g_coeff_2 as i16));
let v_g_coeff_1 = vdup_n_s16(-(transform.g_coeff_1 as i16));
let v_g_coeff_2 = vdup_n_s16(-(transform.g_coeff_2 as i16));
let v_alpha = vdup_n_u8(255u8);
let rounding_const = vdupq_n_s32(1 << 5);

Expand Down
4 changes: 2 additions & 2 deletions src/neon/yuv_to_rgba.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ pub unsafe fn neon_yuv_to_rgba_row<const DESTINATION_CHANNELS: u8, const SAMPLIN
let v_cr_coeff = vdupq_n_s16(transform.cr_coef as i16);
let v_cb_coeff = vdupq_n_s16(transform.cb_coef as i16);
let v_min_values = vdupq_n_s16(0i16);
let v_g_coeff_1 = vdupq_n_s16(-1i16 * transform.g_coeff_1 as i16);
let v_g_coeff_2 = vdupq_n_s16(-1i16 * transform.g_coeff_2 as i16);
let v_g_coeff_1 = vdupq_n_s16(-(transform.g_coeff_1 as i16));
let v_g_coeff_2 = vdupq_n_s16(-(transform.g_coeff_2 as i16));
let v_alpha = vdupq_n_u8(255u8);

while cx + 16 < width {
Expand Down
4 changes: 2 additions & 2 deletions src/neon/yuv_to_rgba_alpha.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ pub unsafe fn neon_yuv_to_rgba_alpha<const DESTINATION_CHANNELS: u8, const SAMPL
let v_cr_coeff = vdupq_n_s16(transform.cr_coef as i16);
let v_cb_coeff = vdupq_n_s16(transform.cb_coef as i16);
let v_min_values = vdupq_n_s16(0i16);
let v_g_coeff_1 = vdupq_n_s16(-1i16 * transform.g_coeff_1 as i16);
let v_g_coeff_2 = vdupq_n_s16(-1i16 * transform.g_coeff_2 as i16);
let v_g_coeff_1 = vdupq_n_s16(-(transform.g_coeff_1 as i16));
let v_g_coeff_2 = vdupq_n_s16(-(transform.g_coeff_2 as i16));

while cx + 16 < width {
let y_values = vqsubq_u8(vld1q_u8(y_ptr.add(y_offset + cx)), y_corr);
Expand Down
Loading

0 comments on commit 5c837a4

Please sign in to comment.