summaryrefslogtreecommitdiffstats
path: root/dom/media/webaudio/FFTBlock.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/media/webaudio/FFTBlock.cpp')
-rw-r--r--dom/media/webaudio/FFTBlock.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/dom/media/webaudio/FFTBlock.cpp b/dom/media/webaudio/FFTBlock.cpp
index 6789ca0264..79fb934a00 100644
--- a/dom/media/webaudio/FFTBlock.cpp
+++ b/dom/media/webaudio/FFTBlock.cpp
@@ -30,15 +30,14 @@
#include "FFTBlock.h"
+#include "FFVPXRuntimeLinker.h"
#include <complex>
namespace mozilla {
-typedef std::complex<double> Complex;
+FFmpegFFTFuncs FFTBlock::sFFTFuncs = {};
-#ifdef MOZ_LIBAV_FFT
-FFmpegRDFTFuncs FFTBlock::sRDFTFuncs;
-#endif
+using Complex = std::complex<double>;
static double fdlibm_cabs(const Complex& z) {
return fdlibm_hypot(real(z), imag(z));
@@ -51,16 +50,15 @@ static double fdlibm_carg(const Complex& z) {
FFTBlock* FFTBlock::CreateInterpolatedBlock(const FFTBlock& block0,
const FFTBlock& block1,
double interp) {
- FFTBlock* newBlock = new FFTBlock(block0.FFTSize());
+ uint32_t fftSize = block0.FFTSize();
+ FFTBlock* newBlock = new FFTBlock(fftSize, 1.0f / AssertedCast<float>(fftSize));
newBlock->InterpolateFrequencyComponents(block0, block1, interp);
// In the time-domain, the 2nd half of the response must be zero, to avoid
// circular convolution aliasing...
- int fftSize = newBlock->FFTSize();
AlignedTArray<float> buffer(fftSize);
- newBlock->GetInverseWithoutScaling(buffer.Elements());
- AudioBufferInPlaceScale(buffer.Elements(), 1.0f / fftSize, fftSize / 2);
+ newBlock->GetInverse(buffer.Elements());
PodZero(buffer.Elements() + fftSize / 2, fftSize / 2);
// Put back into frequency domain.