diff options
author | David Fioramonti | 2018-08-16 06:49:01 -0700 |
---|---|---|
committer | Eugene Sandulenko | 2018-08-18 16:30:57 +0200 |
commit | da57cef0c34162789100ea25eb0f4f3f7a1e90bf (patch) | |
tree | 7e5e998212adc2944f425311e679bd28e3c81110 /common | |
parent | e859a6f13e97a72407d031c60554550d5adb64d7 (diff) | |
download | scummvm-rg350-da57cef0c34162789100ea25eb0f4f3f7a1e90bf.tar.gz scummvm-rg350-da57cef0c34162789100ea25eb0f4f3f7a1e90bf.tar.bz2 scummvm-rg350-da57cef0c34162789100ea25eb0f4f3f7a1e90bf.zip |
COMMON: FFT update cos/sin table constructor change
They now take in the size rather than the power of 2 exponent.
Diffstat (limited to 'common')
-rw-r--r-- | common/fft.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/common/fft.cpp b/common/fft.cpp index a750792047..30e5449ef4 100644 --- a/common/fft.cpp +++ b/common/fft.cpp @@ -37,6 +37,7 @@ FFT::FFT(int bits, int inverse) : _bits(bits), _inverse(inverse) { assert((_bits >= 2) && (_bits <= 16)); int n = 1 << bits; + int nPoints; _tmpBuf = new Complex[n]; _expTab = new Complex[n / 2]; @@ -48,8 +49,10 @@ FFT::FFT(int bits, int inverse) : _bits(bits), _inverse(inverse) { _revTab[-splitRadixPermutation(i, n, _inverse) & (n - 1)] = i; for (int i = 0; i < ARRAYSIZE(_cosTables); i++) { - if (i+4 <= _bits) - _cosTables[i] = new Common::CosineTable(i+4); + if (i + 4 <= _bits) { + nPoints = 1 << (i + 4); + _cosTables[i] = new Common::CosineTable(nPoints); + } else _cosTables[i] = nullptr; } |