Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
magnetophon committed Jan 4, 2025
1 parent 120c4bf commit 4d15611
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/delay_tap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub struct DelayTap {
}

impl DelayTap {
pub fn new(filter_params: Arc<FilterParams>) -> Self {
pub fn new(filter_params: &Arc<FilterParams>) -> Self {
Self {
filter_params: filter_params.clone(),
// ladders: LadderFilter::new(filter_params),
Expand Down
27 changes: 12 additions & 15 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ impl Default for Del2 {
learned_notes.clone(),
)),

delay_taps: array_init(|_| DelayTap::new(Arc::new(FilterParams::new()))),
delay_taps: array_init(|_| DelayTap::new(&Arc::new(FilterParams::new()))),
next_internal_id: 0,

delay_buffer: [
Expand Down Expand Up @@ -1065,7 +1065,6 @@ impl Plugin for Del2 {
let mut post_gain = [0.0f32; 32];

for i in block_start..block_end {
// Fill arrays
for j in 0..32 {
let idx = i + block_len * j;
audio[j] = self.delayed_audio[idx];
Expand All @@ -1075,22 +1074,19 @@ impl Plugin for Del2 {
post_gain[j] = self.post_gains[idx];
}

// Call the new SIMD processing function
self.process_simd_block(
&mut audio,
&mut cutoff,
&mut res,
&mut eq_gain,
&mut post_gain,
&audio,
&cutoff,
&res,
&eq_gain,
&post_gain,
block_len,
i,
output,
update_filter,
);
}

// }
// TODO tap_counter
for tap_index in 0..tap_counter {
let mut amplitude = 0.0;

Expand Down Expand Up @@ -1901,14 +1897,15 @@ impl Del2 {
let lanes_needed = active_taps * 2; // stereo, so *2
lanes_needed.next_power_of_two().min(32)
}

#[inline(always)]
fn process_simd_block(
&mut self,
audio: &mut [f32; 32],
cutoff: &mut [f32; 32],
res: &mut [f32; 32],
eq_gain: &mut [f32; 32],
post_gain: &mut [f32; 32],
audio: &[f32; 32],
cutoff: &[f32; 32],
res: &[f32; 32],
eq_gain: &[f32; 32],
post_gain: &[f32; 32],
block_len: usize,
i: usize,
output: &mut [&mut [f32]],
Expand Down

0 comments on commit 4d15611

Please sign in to comment.