1
0
Fork 0

Fix debug assertions in oversampling

These were leftover from before the addition of delays.
This commit is contained in:
Robbert van der Helm 2023-04-05 16:15:09 +02:00
parent 1711efa11e
commit 40db21277e

View file

@ -347,19 +347,16 @@ impl Lanzcos3Stage {
// NOTE: 'Even samples' is considered from the perspective of a zero latency filter. In // NOTE: 'Even samples' is considered from the perspective of a zero latency filter. In
// this case the evenness of the filter's latency also needs to be considered. If // this case the evenness of the filter's latency also needs to be considered. If
// it's odd then the direct reading should also happen for odd indexed samples. // it's odd then the direct reading should also happen for odd indexed samples.
self.scratch_buffer[output_sample_idx] = if output_sample_idx % 2 self.scratch_buffer[output_sample_idx] =
== (LANZCOS3_KERNEL_LATENCY % 2) if output_sample_idx % 2 == (LANZCOS3_KERNEL_LATENCY % 2) {
{ nih_debug_assert_eq!(
nih_debug_assert!( self.upsampling_rb[(direct_read_pos + self.upsampling_rb.len() - 1)
self.upsampling_rb[(direct_read_pos + LANCZOS3_UPSAMPLING_KERNEL.len() - 1) % self.upsampling_rb.len()],
% LANCZOS3_UPSAMPLING_KERNEL.len()] 0.0
.abs()
== 0.0
); );
nih_debug_assert!( nih_debug_assert_eq!(
self.upsampling_rb[(direct_read_pos + 1) % LANCZOS3_UPSAMPLING_KERNEL.len()] self.upsampling_rb[(direct_read_pos + 1) % self.upsampling_rb.len()],
.abs() 0.0
== 0.0
); );
self.upsampling_rb[direct_read_pos] self.upsampling_rb[direct_read_pos]