diff --git a/include/bw_bd_reduce.h b/include/bw_bd_reduce.h index c3ec583..66ada52 100644 --- a/include/bw_bd_reduce.h +++ b/include/bw_bd_reduce.h @@ -164,7 +164,7 @@ static inline void bw_bd_reduce_reset_coeffs(bw_bd_reduce_coeffs *BW_RESTRICT co static inline void bw_bd_reduce_update_coeffs_ctrl(bw_bd_reduce_coeffs *BW_RESTRICT coeffs) { if (coeffs->bit_depth_prev != coeffs->bit_depth) { coeffs->k = bw_pow2f_3(coeffs->bit_depth - 1); - coeffs->ki = bw_rcpf_2(coeffs->k); + coeffs->ki = bw_rcpf(coeffs->k); coeffs->max = 1.f - 0.5f * coeffs->ki; coeffs->bit_depth_prev = coeffs->bit_depth; } diff --git a/include/bw_clip.h b/include/bw_clip.h index c737eec..55d0a29 100644 --- a/include/bw_clip.h +++ b/include/bw_clip.h @@ -225,7 +225,7 @@ static inline void _bw_clip_do_update_coeffs(bw_clip_coeffs *BW_RESTRICT coeffs, float gain_cur = bw_one_pole_get_y_z1(&coeffs->smooth_gain_state); if (force || coeffs->gain != gain_cur) { gain_cur = bw_one_pole_process1_sticky_rel(&coeffs->smooth_coeffs, &coeffs->smooth_gain_state, coeffs->gain); - coeffs->inv_gain = bw_rcpf_2(gain_cur); + coeffs->inv_gain = bw_rcpf(gain_cur); } } diff --git a/include/bw_comp.h b/include/bw_comp.h index 42207ac..feb5447 100644 --- a/include/bw_comp.h +++ b/include/bw_comp.h @@ -275,7 +275,7 @@ static inline void bw_comp_update_coeffs_audio(bw_comp_coeffs *BW_RESTRICT coeff static inline float bw_comp_process1(const bw_comp_coeffs *BW_RESTRICT coeffs, bw_comp_state *BW_RESTRICT state, float x, float x_sc) { const float env = bw_env_follow_process1(&coeffs->env_follow_coeffs, &state->env_follow_state, x_sc); const float thresh = bw_one_pole_get_y_z1(&coeffs->smooth_thresh_state); - const float y = env > thresh ? bw_pow2f_3(coeffs->kc * bw_log2f_3(thresh * bw_rcpf_2(env))) * x : x; + const float y = env > thresh ? bw_pow2f_3(coeffs->kc * bw_log2f_3(thresh * bw_rcpf(env))) * x : x; return bw_gain_process1(&coeffs->gain_coeffs, y); } diff --git a/include/bw_env_gen.h b/include/bw_env_gen.h index 8d291c3..81b9192 100644 --- a/include/bw_env_gen.h +++ b/include/bw_env_gen.h @@ -315,11 +315,11 @@ static inline void bw_env_gen_update_coeffs_ctrl(bw_env_gen_coeffs *BW_RESTRICT if (coeffs->param_changed) { // 1 ns considered instantaneous if (coeffs->param_changed & _BW_ENV_GEN_PARAM_ATTACK) - coeffs->attack_inc = coeffs->attack > 1e-9f ? coeffs->T * bw_rcpf_2(coeffs->attack) : INFINITY; + coeffs->attack_inc = coeffs->attack > 1e-9f ? coeffs->T * bw_rcpf(coeffs->attack) : INFINITY; if (coeffs->param_changed & (_BW_ENV_GEN_PARAM_DECAY | _BW_ENV_GEN_PARAM_SUSTAIN)) - coeffs->decay_inc = coeffs->decay > 1e-9f ? (coeffs->sustain - 1.f) * coeffs->T * bw_rcpf_2(coeffs->decay) : -INFINITY; + coeffs->decay_inc = coeffs->decay > 1e-9f ? (coeffs->sustain - 1.f) * coeffs->T * bw_rcpf(coeffs->decay) : -INFINITY; if (coeffs->param_changed & (_BW_ENV_GEN_PARAM_SUSTAIN | _BW_ENV_GEN_PARAM_RELEASE)) - coeffs->release_inc = coeffs->release > 1e-9f ? -coeffs->sustain * coeffs->T * bw_rcpf_2(coeffs->release) : -INFINITY; + coeffs->release_inc = coeffs->release > 1e-9f ? -coeffs->sustain * coeffs->T * bw_rcpf(coeffs->release) : -INFINITY; } } diff --git a/include/bw_lp1.h b/include/bw_lp1.h index 7b3a515..40da230 100644 --- a/include/bw_lp1.h +++ b/include/bw_lp1.h @@ -235,9 +235,9 @@ static inline void _bw_lp1_do_update_coeffs(bw_lp1_coeffs *BW_RESTRICT coeffs, c } if (cutoff_changed) { cutoff_cur = bw_one_pole_process1_sticky_rel(&coeffs->smooth_coeffs, &coeffs->smooth_cutoff_state, coeffs->cutoff); - coeffs->y_X = bw_rcpf_2(cutoff_cur); + coeffs->y_X = bw_rcpf(cutoff_cur); } - const float k = cutoff_cur * bw_rcpf_2(cutoff_cur * coeffs->t + prewarp_freq_cur); + const float k = cutoff_cur * bw_rcpf(cutoff_cur * coeffs->t + prewarp_freq_cur); coeffs->X_x = k * prewarp_freq_cur; coeffs->X_X_z1 = k * coeffs->t; } diff --git a/include/bw_ls1.h b/include/bw_ls1.h index bb04b40..9c6116c 100644 --- a/include/bw_ls1.h +++ b/include/bw_ls1.h @@ -205,7 +205,7 @@ static inline void bw_ls1_set_sample_rate(bw_ls1_coeffs *BW_RESTRICT coeffs, flo static inline void _bw_ls1_update_mm1_params(bw_ls1_coeffs *BW_RESTRICT coeffs) { if (coeffs->update) { - bw_mm1_set_cutoff(&coeffs->mm1_coeffs, coeffs->cutoff * bw_rcpf_2(bw_sqrtf_2(coeffs->dc_gain))); + bw_mm1_set_cutoff(&coeffs->mm1_coeffs, coeffs->cutoff * bw_rcpf(bw_sqrtf_2(coeffs->dc_gain))); bw_mm1_set_coeff_lp(&coeffs->mm1_coeffs, coeffs->dc_gain - 1.f); bw_mm1_set_prewarp_freq(&coeffs->mm1_coeffs, coeffs->cutoff); coeffs->update = 0; diff --git a/include/bw_ls2.h b/include/bw_ls2.h index 8bd869f..fdc7aa8 100644 --- a/include/bw_ls2.h +++ b/include/bw_ls2.h @@ -222,7 +222,7 @@ static inline void _bw_ls2_update_mm2_params(bw_ls2_coeffs *BW_RESTRICT coeffs) if (coeffs->param_changed) { if (coeffs->param_changed & _BW_LS2_PARAM_DC_GAIN) { coeffs->sg = bw_sqrtf_2(coeffs->dc_gain); - coeffs->issg = bw_sqrtf_2(bw_rcpf_2(coeffs->sg)); + coeffs->issg = bw_sqrtf_2(bw_rcpf(coeffs->sg)); bw_mm2_set_coeff_x(&coeffs->mm2_coeffs, coeffs->sg); bw_mm2_set_coeff_lp(&coeffs->mm2_coeffs, coeffs->dc_gain - coeffs->sg); bw_mm2_set_coeff_hp(&coeffs->mm2_coeffs, 1.f - coeffs->sg); diff --git a/include/bw_math.h b/include/bw_math.h index e97e7b4..2214ce1 100644 --- a/include/bw_math.h +++ b/include/bw_math.h @@ -48,6 +48,7 @@ *