more of the same

This commit is contained in:
Stefano D'Angelo 2024-07-02 10:27:05 +02:00
parent f04fcac4ea
commit e5cc92c72f
8 changed files with 125 additions and 0 deletions

View File

@ -29,6 +29,8 @@
* <ul>
* <li>Version <strong>1.1.1</strong>:
* <ul>
* <li>Added debugging checks from <code>bw_noise_gate_process()</code>
* to <code>bw_noise_gate_process_multi()</code>.</li>
* <li>Added debugging checks in
* <code>bw_noise_gate_process_multi()</code> to ensure that
* buffers used for both input and output appear at the same
@ -616,6 +618,10 @@ static inline void bw_noise_gate_process_multi(
BW_ASSERT_DEEP(coeffs->state >= bw_noise_gate_coeffs_state_reset_coeffs);
BW_ASSERT(state != BW_NULL);
#ifndef BW_NO_DEBUG
for (size_t i = 0; i < n_channels; i++) {
BW_ASSERT(state[i] != BW_NULL);
BW_ASSERT_DEEP(bw_noise_gate_state_is_valid(coeffs, state[i]));
}
for (size_t i = 0; i < n_channels; i++)
for (size_t j = i + 1; j < n_channels; j++)
BW_ASSERT(state[i] != state[j]);
@ -623,6 +629,12 @@ static inline void bw_noise_gate_process_multi(
BW_ASSERT(x != BW_NULL);
BW_ASSERT(y != BW_NULL);
#ifndef BW_NO_DEBUG
for (size_t i = 0; i < n_channels; i++) {
BW_ASSERT(x[i] != BW_NULL);
BW_ASSERT_DEEP(bw_has_only_finite(x[i], n_samples));
BW_ASSERT_DEEP(x_sc != BW_NULL && x_sc[i] != BW_NULL ? bw_has_only_finite(x_sc[i], n_samples) : 1);
BW_ASSERT(y[i] != BW_NULL);
}
for (size_t i = 0; i < n_channels; i++)
for (size_t j = i + 1; j < n_channels; j++)
BW_ASSERT(y[i] != y[j]);
@ -651,6 +663,12 @@ static inline void bw_noise_gate_process_multi(
BW_ASSERT_DEEP(bw_noise_gate_coeffs_is_valid(coeffs));
BW_ASSERT_DEEP(coeffs->state >= bw_noise_gate_coeffs_state_reset_coeffs);
#ifndef BW_NO_DEBUG
for (size_t i = 0; i < n_channels; i++) {
BW_ASSERT_DEEP(bw_noise_gate_state_is_valid(coeffs, state[i]));
BW_ASSERT_DEEP(bw_has_only_finite(y[i], n_samples));
}
#endif
}
static inline void bw_noise_gate_set_thresh_lin(

View File

@ -30,6 +30,8 @@
* <ul>
* <li>Version <strong>1.1.1</strong>:
* <ul>
* <li>Added debugging checks from <code>bw_notch_process()</code> to
* <code>bw_notch_process_multi()</code>.</li>
* <li>Added debugging checks in <code>bw_notch_process_multi()</code>
* to ensure that buffers used for both input and output appear at
* the same channel indices.</li>
@ -526,6 +528,10 @@ static inline void bw_notch_process_multi(
BW_ASSERT_DEEP(coeffs->state >= bw_notch_coeffs_state_reset_coeffs);
BW_ASSERT(state != BW_NULL);
#ifndef BW_NO_DEBUG
for (size_t i = 0; i < n_channels; i++) {
BW_ASSERT(state[i] != BW_NULL);
BW_ASSERT_DEEP(bw_notch_state_is_valid(coeffs, state[i]));
}
for (size_t i = 0; i < n_channels; i++)
for (size_t j = i + 1; j < n_channels; j++)
BW_ASSERT(state[i] != state[j]);
@ -533,6 +539,11 @@ static inline void bw_notch_process_multi(
BW_ASSERT(x != BW_NULL);
BW_ASSERT(y != BW_NULL);
#ifndef BW_NO_DEBUG
for (size_t i = 0; i < n_channels; i++) {
BW_ASSERT(x[i] != BW_NULL);
BW_ASSERT_DEEP(bw_has_only_finite(x[i], n_samples));
BW_ASSERT(y[i] != BW_NULL);
}
for (size_t i = 0; i < n_channels; i++)
for (size_t j = i + 1; j < n_channels; j++)
BW_ASSERT(y[i] != y[j]);
@ -550,6 +561,12 @@ static inline void bw_notch_process_multi(
BW_ASSERT_DEEP(bw_notch_coeffs_is_valid(coeffs));
BW_ASSERT_DEEP(coeffs->state >= bw_notch_coeffs_state_reset_coeffs);
#ifndef BW_NO_DEBUG
for (size_t i = 0; i < n_channels; i++) {
BW_ASSERT_DEEP(bw_notch_state_is_valid(coeffs, state[i]));
BW_ASSERT_DEEP(bw_has_only_finite(y[i], n_samples));
}
#endif
}
static inline void bw_notch_set_cutoff(

View File

@ -32,6 +32,8 @@
* <ul>
* <li>Version <strong>1.1.1</strong>:
* <ul>
* <li>Added debugging checks from <code>bw_one_pole_process()</code>
* to <code>bw_one_pole_process_multi()</code>.</li>
* <li>Added debugging checks in
* <code>bw_one_pole_process_multi()</code> to ensure that buffers
* used for both input and output appear at the same channel
@ -903,12 +905,20 @@ static inline void bw_one_pole_process_multi(
BW_ASSERT_DEEP(coeffs->state >= bw_one_pole_coeffs_state_reset_coeffs);
BW_ASSERT(state != BW_NULL);
#ifndef BW_NO_DEBUG
for (size_t i = 0; i < n_channels; i++) {
BW_ASSERT(state[i] != BW_NULL);
BW_ASSERT_DEEP(bw_one_pole_state_is_valid(coeffs, state[i]));
}
for (size_t i = 0; i < n_channels; i++)
for (size_t j = i + 1; j < n_channels; j++)
BW_ASSERT(state[i] != state[j]);
#endif
BW_ASSERT(x != BW_NULL);
#ifndef BW_NO_DEBUG
for (size_t i = 0; i < n_channels; i++) {
BW_ASSERT(x[i] != BW_NULL);
BW_ASSERT_DEEP(bw_has_only_finite(x[i], n_samples));
}
if (y != BW_NULL) {
for (size_t i = 0; i < n_channels; i++)
for (size_t j = i + 1; j < n_channels; j++)
@ -1019,6 +1029,12 @@ static inline void bw_one_pole_process_multi(
BW_ASSERT_DEEP(bw_one_pole_coeffs_is_valid(coeffs));
BW_ASSERT_DEEP(coeffs->state >= bw_one_pole_coeffs_state_reset_coeffs);
#ifndef BW_NO_DEBUG
for (size_t i = 0; i < n_channels; i++) {
BW_ASSERT_DEEP(bw_one_pole_state_is_valid(coeffs, state[i]));
BW_ASSERT_DEEP(y != BW_NULL && y[i] != BW_NULL ? bw_has_only_finite(y[i], n_samples) : 1);
}
#endif
}
static inline void bw_one_pole_set_cutoff(

View File

@ -39,6 +39,8 @@
* <ul>
* <li>Version <strong>1.1.1</strong>:
* <ul>
* <li>Added debugging checks from <code>bw_osc_pulse_process()</code>
* to <code>bw_osc_pulse_process_multi()</code>.</li>
* <li>Added debugging checks in
* <code>bw_osc_pulse_process_multi()</code> to ensure that
* <code>x_inc</code> is not <code>BW_NULL</code> when antialiasing
@ -482,6 +484,13 @@ static inline void bw_osc_pulse_process_multi(
BW_ASSERT(coeffs->antialiasing ? x_inc != BW_NULL : 1);
BW_ASSERT(y != BW_NULL);
#ifndef BW_NO_DEBUG
for (size_t i = 0; i < n_channels; i++) {
BW_ASSERT(x[i] != BW_NULL);
BW_ASSERT_DEEP(bw_has_only_finite(x[i], n_samples));
BW_ASSERT(coeffs->antialiasing ? x_inc[i] != BW_NULL : 1);
BW_ASSERT_DEEP(coeffs->antialiasing ? bw_has_only_finite(x_inc[i], n_samples) : 1);
BW_ASSERT(y[i] != BW_NULL);
}
for (size_t i = 0; i < n_channels; i++)
for (size_t j = i + 1; j < n_channels; j++)
BW_ASSERT(y[i] != y[j]);
@ -509,6 +518,10 @@ static inline void bw_osc_pulse_process_multi(
BW_ASSERT_DEEP(bw_osc_pulse_coeffs_is_valid(coeffs));
BW_ASSERT_DEEP(coeffs->state >= bw_osc_pulse_coeffs_state_reset_coeffs);
#ifndef BW_NO_DEBUG
for (size_t i = 0; i < n_channels; i++)
BW_ASSERT_DEEP(bw_has_only_finite(y[i], n_samples));
#endif
}
static inline void bw_osc_pulse_set_antialiasing(

View File

@ -39,6 +39,8 @@
* <ul>
* <li>Version <strong>1.1.1</strong>:
* <ul>
* <li>Added debugging checks from <code>bw_osc_tri_process()</code> to
* <code>bw_osc_tri_process_multi()</code>.</li>
* <li>Added debugging checks in
* <code>bw_osc_tri_process_multi()</code> to ensure that
* <code>x_inc</code> is not <code>BW_NULL</code> when antialiasing
@ -489,6 +491,13 @@ static inline void bw_osc_tri_process_multi(
BW_ASSERT(coeffs->antialiasing ? x_inc != BW_NULL : 1);
BW_ASSERT(y != BW_NULL);
#ifndef BW_NO_DEBUG
for (size_t i = 0; i < n_channels; i++) {
BW_ASSERT(x[i] != BW_NULL);
BW_ASSERT_DEEP(bw_has_only_finite(x[i], n_samples));
BW_ASSERT(coeffs->antialiasing ? x_inc[i] != BW_NULL : 1);
BW_ASSERT_DEEP(coeffs->antialiasing ? bw_has_only_finite(x_inc[i], n_samples) : 1);
BW_ASSERT(y[i] != BW_NULL);
}
for (size_t i = 0; i < n_channels; i++)
for (size_t j = i + 1; j < n_channels; j++)
BW_ASSERT(y[i] != y[j]);
@ -516,6 +525,10 @@ static inline void bw_osc_tri_process_multi(
BW_ASSERT_DEEP(bw_osc_tri_coeffs_is_valid(coeffs));
BW_ASSERT_DEEP(coeffs->state >= bw_osc_tri_coeffs_state_reset_coeffs);
#ifndef BW_NO_DEBUG
for (size_t i = 0; i < n_channels; i++)
BW_ASSERT_DEEP(bw_has_only_finite(y[i], n_samples));
#endif
}
static inline void bw_osc_tri_set_antialiasing(

View File

@ -29,6 +29,8 @@
* <ul>
* <li>Version <strong>1.1.1</strong>:
* <ul>
* <li>Added debugging checks from <code>bw_pan_process()</code> to
* <code>bw_pan_process_multi()</code>.</li>
* <li>Added debugging checks in <code>bw_pan_process_multi()</code> to
* ensure that buffers used for both input and output appear at the
* same channel indices.</li>
@ -389,6 +391,13 @@ static inline void bw_pan_process_multi(
BW_ASSERT(y_r != BW_NULL);
BW_ASSERT(y_l != y_r);
#ifndef BW_NO_DEBUG
for (size_t i = 0; i < n_channels; i++) {
BW_ASSERT(x[i] != BW_NULL);
BW_ASSERT_DEEP(bw_has_only_finite(x[i], n_samples));
BW_ASSERT(y_l[i] != BW_NULL);
BW_ASSERT(y_r[i] != BW_NULL);
BW_ASSERT(y_l[i] != y_r[i]);
}
for (size_t i = 0; i < n_channels; i++)
for (size_t j = i + 1; j < n_channels; j++) {
BW_ASSERT(y_l[i] != y_l[j]);
@ -413,6 +422,12 @@ static inline void bw_pan_process_multi(
BW_ASSERT_DEEP(bw_pan_coeffs_is_valid(coeffs));
BW_ASSERT_DEEP(coeffs->state >= bw_pan_coeffs_state_reset_coeffs);
#ifndef BW_NO_DEBUG
for (size_t i = 0; i < n_channels; i++) {
BW_ASSERT_DEEP(bw_has_only_finite(y_l[i], n_samples));
BW_ASSERT_DEEP(bw_has_only_finite(y_r[i], n_samples));
}
#endif
}
static inline void bw_pan_set_pan(

View File

@ -37,6 +37,8 @@
* <ul>
* <li>Version <strong>1.1.1</strong>:
* <ul>
* <li>Added debugging checks from <code>bw_peak_process()</code> to
* <code>bw_peak_process_multi()</code>.</li>
* <li>Added debugging checks in <code>bw_peak_process_multi()</code>
* to ensure that buffers used for both input and output appear at
* the same channel indices.</li>
@ -675,6 +677,10 @@ static inline void bw_peak_process_multi(
: 1);
BW_ASSERT(state != BW_NULL);
#ifndef BW_NO_DEBUG
for (size_t i = 0; i < n_channels; i++) {
BW_ASSERT(state[i] != BW_NULL);
BW_ASSERT_DEEP(bw_peak_state_is_valid(coeffs, state[i]));
}
for (size_t i = 0; i < n_channels; i++)
for (size_t j = i + 1; j < n_channels; j++)
BW_ASSERT(state[i] != state[j]);
@ -682,6 +688,11 @@ static inline void bw_peak_process_multi(
BW_ASSERT(x != BW_NULL);
BW_ASSERT(y != BW_NULL);
#ifndef BW_NO_DEBUG
for (size_t i = 0; i < n_channels; i++) {
BW_ASSERT(x[i] != BW_NULL);
BW_ASSERT_DEEP(bw_has_only_finite(x[i], n_samples));
BW_ASSERT(y[i] != BW_NULL);
}
for (size_t i = 0; i < n_channels; i++)
for (size_t j = i + 1; j < n_channels; j++)
BW_ASSERT(y[i] != y[j]);
@ -699,6 +710,12 @@ static inline void bw_peak_process_multi(
BW_ASSERT_DEEP(bw_peak_coeffs_is_valid(coeffs));
BW_ASSERT_DEEP(coeffs->state >= bw_peak_coeffs_state_reset_coeffs);
#ifndef BW_NO_DEBUG
for (size_t i = 0; i < n_channels; i++) {
BW_ASSERT_DEEP(bw_peak_state_is_valid(coeffs, state[i]));
BW_ASSERT_DEEP(bw_has_only_finite(y[i], n_samples));
}
#endif
}
static inline void bw_peak_set_cutoff(

View File

@ -33,6 +33,8 @@
* <ul>
* <li>Added phase_inc_min and phase_inc_max parameters.</li>
* <li>Fixed rounding bug when frequency is tiny (again).</li>
* <li>Added debugging checks from <code>bw_phase_gen_process()</code>
* to <code>bw_phase_gen_process_multi()</code>.</li>
* <li>Added debugging check in <code>bw_phase_reset_state()</code> to
* ensure that <code>phase_0</code> is in [<code>0.f</code>,
* <code>1.f</code>) and indicated such range in the
@ -756,9 +758,16 @@ static inline void bw_phase_gen_process_multi(
BW_ASSERT_DEEP(coeffs->phase_inc_min < coeffs->phase_inc_max);
BW_ASSERT(state != BW_NULL);
#ifndef BW_NO_DEBUG
for (size_t i = 0; i < n_channels; i++) {
BW_ASSERT(state[i] != BW_NULL);
BW_ASSERT_DEEP(bw_phase_gen_state_is_valid(coeffs, state[i]));
}
for (size_t i = 0; i < n_channels; i++)
for (size_t j = i + 1; j < n_channels; j++)
BW_ASSERT(state[i] != state[j]);
if (x_mod != BW_NULL)
for (size_t i = 0; i < n_channels; i++)
BW_ASSERT_DEEP(x_mod[i] != BW_NULL ? bw_has_only_finite(x_mod[i], n_samples) : 1);
if (y != BW_NULL)
for (size_t i = 0; i < n_channels; i++)
for (size_t j = i + 1; j < n_channels; j++)
@ -888,6 +897,13 @@ static inline void bw_phase_gen_process_multi(
BW_ASSERT_DEEP(bw_phase_gen_coeffs_is_valid(coeffs));
BW_ASSERT_DEEP(coeffs->state >= bw_phase_gen_coeffs_state_reset_coeffs);
#ifndef BW_NO_DEBUG
for (size_t i = 0; i < n_channels; i++) {
BW_ASSERT_DEEP(bw_phase_gen_state_is_valid(coeffs, state[i]));
BW_ASSERT_DEEP(y != BW_NULL && y[i] != BW_NULL ? bw_has_only_finite(y[i], n_samples) : 1);
BW_ASSERT_DEEP(y_inc != BW_NULL && y_inc[i] != BW_NULL ? bw_has_only_finite(y_inc[i], n_samples) : 1);
}
#endif
}
static inline void bw_phase_gen_set_frequency(