X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=stereocompressor.cpp;h=7a77d078426cb1e8cc3f219fe418dcb1d7e99f46;hb=8fe6a683cb5bc9f04555c8cb9257f33c4d356ded;hp=3c522cc5891301e8a36cb253e9eb9840e503d458;hpb=cabac1772677e5ac20d5a619b13d5d9f7f90160b;p=nageru diff --git a/stereocompressor.cpp b/stereocompressor.cpp index 3c522cc..7a77d07 100644 --- a/stereocompressor.cpp +++ b/stereocompressor.cpp @@ -4,6 +4,8 @@ #include "stereocompressor.h" +using namespace std; + namespace { // Implement a less accurate but faster pow(x, y). We use the standard identity @@ -99,9 +101,9 @@ void StereoCompressor::process(float *buf, size_t num_samples, float threshold, if (fabs(*right_ptr) > peak_level) peak_level = float(fabs(*right_ptr)); if (peak_level > compr_level) { - compr_level = std::min(compr_level * attack_increment, peak_level); + compr_level = min(compr_level * attack_increment, peak_level); } else { - compr_level = std::max(compr_level * release_increment, 0.0001f); + compr_level = max(compr_level * release_increment, 0.0001f); } float scalefactor_with_gain = compressor_knee(compr_level, threshold, inv_threshold, inv_ratio_minus_one, makeup_gain); @@ -112,7 +114,7 @@ void StereoCompressor::process(float *buf, size_t num_samples, float threshold, *right_ptr *= scalefactor_with_gain; right_ptr += 2; - peak_level = std::max(peak_level * peak_increment, 0.0001f); + peak_level = max(peak_level * peak_increment, 0.0001f); } // Store attenuation level for debug/visualization.