diff options
Diffstat (limited to 'common/polyphase_resampler.cpp')
-rw-r--r-- | common/polyphase_resampler.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/common/polyphase_resampler.cpp b/common/polyphase_resampler.cpp index 76723915..5475cff8 100644 --- a/common/polyphase_resampler.cpp +++ b/common/polyphase_resampler.cpp @@ -21,7 +21,7 @@ using uint = unsigned int; */ double Sinc(const double x) { - if(std::abs(x) < Epsilon) [[alunlikely]] + if(std::abs(x) < Epsilon) [[unlikely]] return 1.0; return std::sin(al::numbers::pi*x) / (al::numbers::pi*x); } @@ -96,7 +96,7 @@ constexpr uint Gcd(uint x, uint y) constexpr uint CalcKaiserOrder(const double rejection, const double transition) { const double w_t{2.0 * al::numbers::pi * transition}; - if(rejection > 21.0) [[allikely]] + if(rejection > 21.0) [[likely]] return static_cast<uint>(std::ceil((rejection - 7.95) / (2.285 * w_t))); return static_cast<uint>(std::ceil(5.79 / w_t)); } @@ -104,7 +104,7 @@ constexpr uint CalcKaiserOrder(const double rejection, const double transition) // Calculates the beta value of the Kaiser window. Rejection is in dB. constexpr double CalcKaiserBeta(const double rejection) { - if(rejection > 50.0) [[allikely]] + if(rejection > 50.0) [[likely]] return 0.1102 * (rejection - 8.7); if(rejection >= 21.0) return (0.5842 * std::pow(rejection - 21.0, 0.4)) + @@ -171,13 +171,13 @@ void PPhaseResampler::init(const uint srcRate, const uint dstRate) // polyphase filter implementation. void PPhaseResampler::process(const uint inN, const double *in, const uint outN, double *out) { - if(outN == 0) [[alunlikely]] + if(outN == 0) [[unlikely]] return; // Handle in-place operation. std::vector<double> workspace; double *work{out}; - if(work == in) [[alunlikely]] + if(work == in) [[unlikely]] { workspace.resize(outN); work = workspace.data(); @@ -195,17 +195,17 @@ void PPhaseResampler::process(const uint inN, const double *in, const uint outN, // Only take input when 0 <= j_s < inN. double r{0.0}; - if(j_f < m) [[allikely]] + if(j_f < m) [[likely]] { size_t filt_len{(m-j_f+p-1) / p}; - if(j_s+1 > inN) [[allikely]] + if(j_s+1 > inN) [[likely]] { size_t skip{std::min<size_t>(j_s+1 - inN, filt_len)}; j_f += p*skip; j_s -= skip; filt_len -= skip; } - if(size_t todo{std::min<size_t>(j_s+1, filt_len)}) [[allikely]] + if(size_t todo{std::min<size_t>(j_s+1, filt_len)}) [[likely]] { do { r += f[j_f] * in[j_s]; |