Kraken Info: Difference between revisions

Line 23: Line 23:


== audio-fft ==
== audio-fft ==
'''Description.'''
A ''kernel''.  Computes a Fast Fourier Transform.
'''Key features.'''
A big chunk of run-time is in this loop:
  while ( i < bufferSize ) {
    off = i + halfSize;
    tr = (currentPhaseShiftReal * real[off]) - (currentPhaseShiftImag * imag
[off]);
    ti = (currentPhaseShiftReal * imag[off]) + (currentPhaseShiftImag * real
[off]);
    real[off] = real[i] - tr;
    imag[off] = imag[i] - ti;
    real[i] += tr;
    imag[i] += ti;
    i += halfSize << 1;
  }
Array gets and sets dominate.
'''Mozilla-specific things.'''
In the above loop, 'i' and 'off' are loaded as doubles and have to be converted to integers using a combination of inline code and calls to js_DoubleToInt32().  This should be avoided ([https://bugzilla.mozilla.org/show_bug.cgi?id=606879 bug 606879]).


== audio-oscillator ==
== audio-oscillator ==
Confirmed users
1,345

edits