summaryrefslogtreecommitdiff
path: root/Source/Core/AudioCommon/DPL2Decoder.cpp
diff options
context:
space:
mode:
authorMerryMage <MerryMage@users.noreply.github.com>2017-04-22 09:49:46 +0100
committerMerryMage <MerryMage@users.noreply.github.com>2017-04-23 09:18:29 +0100
commit751351fd20443d855f4d7d50754ec0d1001f6a97 (patch)
tree0904ec0acf2aade735ce0092143e16d2bddff12a /Source/Core/AudioCommon/DPL2Decoder.cpp
parent24027c1d4adc230121fea67d201265eca9e109a1 (diff)
DPL2Decoder: Simplify cut-off frequency logic in DesignFIR
Diffstat (limited to 'Source/Core/AudioCommon/DPL2Decoder.cpp')
-rw-r--r--Source/Core/AudioCommon/DPL2Decoder.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/Source/Core/AudioCommon/DPL2Decoder.cpp b/Source/Core/AudioCommon/DPL2Decoder.cpp
index a6b301fc5a..6c8be523bf 100644
--- a/Source/Core/AudioCommon/DPL2Decoder.cpp
+++ b/Source/Core/AudioCommon/DPL2Decoder.cpp
@@ -134,16 +134,13 @@ static float* DesignFIR(unsigned int n, float fc, float opt)
if (n == 0)
return nullptr;
- fc = MathUtil::Clamp(fc, 0.001f, 1.0f);
-
float* w = (float*)calloc(sizeof(float), n);
// Get window coefficients
Hamming(n, w);
- fc1 = fc;
// Cutoff frequency must be < 0.5 where 0.5 <=> Fs/2
- fc1 = ((fc1 <= 1.0) && (fc1 > 0.0)) ? fc1 / 2 : 0.25f;
+ fc1 = MathUtil::Clamp(fc, 0.001f, 1.0f) / 2;
k1 *= fc1;
// Low pass filter