bug 1220041 scale when copying for inverse FFT to avoid iterating twice r=padenot

--HG--
extra : rebase_source : ed8826cac68bc28c5b019547a7da5451a87a2c29
This commit is contained in:
Karl Tomlinson 2015-10-30 15:24:23 +13:00
Родитель a8b0ab9f02
Коммит bcb7e273a6
1 изменённых файлов: 4 добавлений и 7 удалений

Просмотреть файл

@ -110,16 +110,13 @@ public:
EnsureIFFT();
#if defined(MOZ_LIBAV_FFT)
{
PodCopy(aDataOut, (float*)mOutputBuffer.Elements(), mFFTSize);
aDataOut[1] = mOutputBuffer[mFFTSize/2].r; // Packed Nyquist
av_rdft_calc(mAvIRDFT, aDataOut);
// TODO: Once bug 877662 lands, change this to use SSE.
// Even though this function doesn't scale, the libav forward transform
// gives a value that needs scaling by 2 in order for things to turn out
// similar to how we expect from kissfft/openmax.
for (uint32_t i = 0; i < mFFTSize; ++i) {
aDataOut[i] *= 2.0;
}
AudioBufferCopyWithScale(mOutputBuffer.Elements()->f, 2.0f,
aDataOut, mFFTSize);
aDataOut[1] = 2.0f * mOutputBuffer[mFFTSize/2].r; // Packed Nyquist
av_rdft_calc(mAvIRDFT, aDataOut);
}
#else
#ifdef BUILD_ARM_NEON