зеркало из https://github.com/mozilla/gecko-dev.git
bug 1223520 avoid leaking NaNs to and from the otherwise unused imaginary frequency components r=padenot
The zeroth component is not removed from the BufferComplexMultiply() call so as not to disrupt alignment. The mOutputBuffer[halfSize].i assertions are removed because the code no longer uses these components, and so their values are irrelevant. --HG-- extra : rebase_source : 96014bdb66a86e1d764979f7b1a313c24196a60b extra : histedit_source : 59ef41301d48a7f80798d8dbecc43aa85703c26f
This commit is contained in:
Родитель
9c3d0ed0df
Коммит
bc68ee1302
|
@ -138,14 +138,15 @@ public:
|
|||
uint32_t halfSize = mFFTSize / 2;
|
||||
// DFTs are not packed.
|
||||
MOZ_ASSERT(mOutputBuffer[0].i == 0);
|
||||
MOZ_ASSERT(mOutputBuffer[halfSize].i == 0);
|
||||
MOZ_ASSERT(aFrame.mOutputBuffer[0].i == 0);
|
||||
MOZ_ASSERT(aFrame.mOutputBuffer[halfSize].i == 0);
|
||||
|
||||
BufferComplexMultiply(mOutputBuffer.Elements()->f,
|
||||
aFrame.mOutputBuffer.Elements()->f,
|
||||
mOutputBuffer.Elements()->f,
|
||||
halfSize + 1);
|
||||
halfSize);
|
||||
mOutputBuffer[halfSize].r *= aFrame.mOutputBuffer[halfSize].r;
|
||||
// This would have been set to NaN if either real component was NaN.
|
||||
mOutputBuffer[0].i = 0.0f;
|
||||
}
|
||||
|
||||
// Perform a forward FFT on |aData|, assuming zeros after dataSize samples,
|
||||
|
|
Загрузка…
Ссылка в новой задаче