Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unnecessary parentheses warnings #117

Merged
merged 2 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/speexdsp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
6 changes: 3 additions & 3 deletions resampler/src/speex/avx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
Expand Down Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -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;
}
}

Expand Down
14 changes: 7 additions & 7 deletions resampler/src/speex/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)]
Expand All @@ -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;
}
6 changes: 3 additions & 3 deletions resampler/src/speex/sse3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
Expand Down Expand Up @@ -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));
}
}
Expand Down Expand Up @@ -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;
}
}

Expand Down
Loading