summaryrefslogtreecommitdiffstats
path: root/dom/media/webaudio/FFTBlock.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
commit086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch)
treea4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /dom/media/webaudio/FFTBlock.cpp
parentAdding debian version 124.0.1-1. (diff)
downloadfirefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz
firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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.