bug 1188704 combine scaling with copying r=rillian
authorKarl Tomlinson <karlt+@karlt.net>
Tue, 28 Jul 2015 15:58:06 +1200
changeset 287451 2bf6f07f8060e6c99c880b0981d46180287da2ce
parent 287450 d647fe2abdc96aad4ef861ddd8067ea50b8fdf37
child 287452 b70aa71884d90b5fe7fa11270dd762db0fc23372
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrillian
bugs1188704
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1188704 combine scaling with copying r=rillian
dom/media/webaudio/blink/PeriodicWave.cpp
--- a/dom/media/webaudio/blink/PeriodicWave.cpp
+++ b/dom/media/webaudio/blink/PeriodicWave.cpp
@@ -198,22 +198,19 @@ void PeriodicWave::createBandLimitedTabl
         // frequencies to band-limit the waveform.
         unsigned numberOfPartials = numberOfPartialsForRange(rangeIndex);
         // Also clear bins where components are not provided.
         numberOfPartials = std::min(numberOfPartials, numberOfComponents - 1);
 
         // Copy from loaded frequency data and scale.
         float scale = fftSize;
         AudioBufferCopyWithScale(realData, scale, realP, numberOfPartials + 1);
-        AudioBufferCopyWithScale(imagData, scale, imagP, numberOfPartials + 1);
-
         // Generate complex conjugate because of the way the
         // inverse FFT is defined.
-        float minusOne = -1;
-        AudioBufferInPlaceScale(imagP, minusOne, numberOfPartials + 1);
+        AudioBufferCopyWithScale(imagData, -scale, imagP, numberOfPartials + 1);
 
         // Clear the remaining bins.
         for (i = numberOfPartials + 1; i < halfSize + 1; ++i) {
             realP[i] = 0;
             imagP[i] = 0;
         }
 
         // Clear any DC-offset.