diff --git a/.github/workflows/speexdsp.yml b/.github/workflows/speexdsp.yml index 8affe0b..eaaef37 100644 --- a/.github/workflows/speexdsp.yml +++ b/.github/workflows/speexdsp.yml @@ -45,7 +45,7 @@ jobs: uses: actions-rs/clippy-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} - args: --all --all-targets --all-features --tests -- --verbose + args: --all --all-targets --all-features --tests -- tests: diff --git a/resampler/src/speex/avx.rs b/resampler/src/speex/avx.rs index e7ba304..abdbbe9 100644 --- a/resampler/src/speex/avx.rs +++ b/resampler/src/speex/avx.rs @@ -43,7 +43,7 @@ pub fn interpolate_step_single( let mut interp = _mm_setzero_ps(); cubic_coef(frac, &mut interp); let v = _mm_mul_ps(interp, accum); - out_slice[(out_stride * out_sample)] = + out_slice[out_stride * out_sample] = _mm_cvtss_f32(_mm_hadd_ps(_mm_hadd_ps(v, v), v)); } } @@ -75,7 +75,7 @@ pub fn interpolate_step_double( let accum = _mm256_mul_pd(accum, _mm256_cvtps_pd(interp)); - out_slice[(out_stride * out_sample)] = hsum_m256d(accum) as f32; + out_slice[out_stride * out_sample] = hsum_m256d(accum) as f32; } } @@ -134,7 +134,7 @@ pub fn direct_step_double( j += 4; } - out_slice[(out_stride * out_sample)] = hsum_m256d(accum) as f32; + out_slice[out_stride * out_sample] = hsum_m256d(accum) as f32; } } diff --git a/resampler/src/speex/native.rs b/resampler/src/speex/native.rs index 6f2d1d3..e566884 100644 --- a/resampler/src/speex/native.rs +++ b/resampler/src/speex/native.rs @@ -33,7 +33,7 @@ pub fn interpolate_step_single( }); let mut interp: [f32; 4] = [0.; 4]; cubic_coef(frac, &mut interp); - out_slice[(out_stride * out_sample)] = interp + out_slice[out_stride * out_sample] = interp .iter() .zip(accum.iter()) .map(|(&x, &y)| x * y) @@ -64,7 +64,7 @@ pub fn interpolate_step_double( }); let mut interp: [f32; 4] = [0.; 4]; cubic_coef(frac, &mut interp); - out_slice[(out_stride * out_sample)] = interp + out_slice[out_stride * out_sample] = interp .iter() .zip(accum.iter()) .map(|(&x, &y)| x * y as f32) @@ -86,7 +86,7 @@ pub fn direct_step_single( sum += sinc_table[j] * in_slice[j]; j += 1 } - out_slice[(out_stride * out_sample)] = sum; + out_slice[out_stride * out_sample] = sum; } #[inline(always)] @@ -103,12 +103,12 @@ pub fn direct_step_double( while j < n { accum[0usize] += f64::from(sinc_table[j] * in_slice[j]); - accum[1usize] += f64::from(sinc_table[(j + 1)] * in_slice[(j + 1)]); - accum[2usize] += f64::from(sinc_table[(j + 2)] * in_slice[(j + 2)]); - accum[3usize] += f64::from(sinc_table[(j + 3)] * in_slice[(j + 3)]); + accum[1usize] += f64::from(sinc_table[j + 1] * in_slice[j + 1]); + accum[2usize] += f64::from(sinc_table[j + 2] * in_slice[j + 2]); + accum[3usize] += f64::from(sinc_table[j + 3] * in_slice[j + 3]); j += 4 } let sum: f64 = accum[0usize] + accum[1usize] + accum[2usize] + accum[3usize]; - out_slice[(out_stride * out_sample)] = sum as f32; + out_slice[out_stride * out_sample] = sum as f32; } diff --git a/resampler/src/speex/sse3.rs b/resampler/src/speex/sse3.rs index 58a8588..39912a3 100644 --- a/resampler/src/speex/sse3.rs +++ b/resampler/src/speex/sse3.rs @@ -73,7 +73,7 @@ pub fn interpolate_step_single( let mut interp = _mm_setzero_ps(); cubic_coef(frac, &mut interp); let v = _mm_mul_ps(interp, accum); - out_slice[(out_stride * out_sample)] = + out_slice[out_stride * out_sample] = _mm_cvtss_f32(_mm_hadd_ps(_mm_hadd_ps(v, v), v)); } } @@ -112,7 +112,7 @@ pub fn interpolate_step_double( ); let v = _mm_mul_ps(accum32, interp); - out_slice[(out_stride * out_sample)] = + out_slice[out_stride * out_sample] = _mm_cvtss_f32(_mm_hadd_ps(_mm_hadd_ps(v, v), v)); } } @@ -175,7 +175,7 @@ pub fn direct_step_double( j += 2; } - out_slice[(out_stride * out_sample)] = hsum_m128d(accum) as f32; + out_slice[out_stride * out_sample] = hsum_m128d(accum) as f32; } }