bw_src, removed useless casts

This commit is contained in:
Stefano D'Angelo 2023-04-04 15:24:33 +02:00
parent 388ece962a
commit 721dc3da27

View File

@ -120,8 +120,8 @@ struct _bw_src_state {
static inline void bw_src_init(bw_src_coeffs *BW_RESTRICT coeffs, float ratio) {
coeffs->k = ratio >= 1.f ? 1.f / ratio : -1.f / ratio;
// 4th-degree Butterworth with cutoff at ratio * Nyquist, using bilinear transform w/ prewarping
const float fc = bw_minf((float)(ratio >= 1.f ? 1.f / ratio : ratio), 0.9f);
const float T = bw_tanf_3(1.570796326794896f * (float)fc);
const float fc = bw_minf(ratio >= 1.f ? 1.f / ratio : ratio, 0.9f);
const float T = bw_tanf_3(1.570796326794896f * fc);
const float T2 = T * T;
const float k = 1.f / (T * (T * (T * (T + 2.613125929752753f) + 3.414213562373095f) + 2.613125929752753f) + 1.f);
coeffs->b0 = k * T2 * T2;