mirror of
https://github.com/mborgerding/kissfft.git
synced 2025-06-04 01:28:23 -04:00
slightly faster
This commit is contained in:
parent
3a5791f203
commit
ae305ca400
22
kiss_fft.c
22
kiss_fft.c
@ -287,12 +287,12 @@ void bfly_generic(
|
||||
int p
|
||||
)
|
||||
{
|
||||
int u,q,d,fsm,halfp,mp;
|
||||
int u,q,d,fsm,halfp,mp,uf;
|
||||
kiss_fft_cpx * scratch = st->scratch;
|
||||
kiss_fft_cpx * scratch2 = scratch + p;
|
||||
kiss_fft_cpx * tw = st->twiddles;
|
||||
kiss_fft_cpx tlo,t3,t4;
|
||||
kiss_fft_cpx *Foutlo,*Fouthi;
|
||||
kiss_fft_cpx *Foutlo,*Fouthi,*tw2;
|
||||
|
||||
fsm = fstride*m;
|
||||
halfp=p/2;
|
||||
@ -313,31 +313,33 @@ void bfly_generic(
|
||||
for ( u=0; u<m; ++u ) {
|
||||
scratch[0] = Fout[0];
|
||||
scratch2 = scratch + p;
|
||||
uf=u*fstride;
|
||||
|
||||
/* d==0 */
|
||||
Foutlo=Fout;
|
||||
for ( q=1 ; q<p ; ++q ) {
|
||||
C_MUL( scratch[q] , Fout[ m*q ] , tw[u*fstride*q] );
|
||||
Fout[ m*q ] = scratch[0];
|
||||
Foutlo += m;
|
||||
C_MUL( scratch[q] , *Foutlo , tw[uf*q] );
|
||||
*Foutlo = scratch[0];
|
||||
}
|
||||
|
||||
for ( q=1; q<p ; ++q ) {
|
||||
|
||||
|
||||
C_ADDTO(*Fout , scratch[q] );
|
||||
Foutlo=Fout;
|
||||
Fouthi=Fout + mp;
|
||||
|
||||
|
||||
for ( d=1; d<=halfp;++d) {
|
||||
Foutlo += m;
|
||||
Fouthi -= m;
|
||||
|
||||
tlo = *scratch2++;
|
||||
|
||||
Foutlo += m;
|
||||
|
||||
t3.r = scratch[q].r * tlo.r;
|
||||
t3.i = scratch[q].r * tlo.i;
|
||||
t4.r = scratch[q].i * tlo.i;
|
||||
t4.i = - scratch[q].i * tlo.r;
|
||||
|
||||
Fouthi -= m;
|
||||
|
||||
Foutlo->r += t3.r - t4.r;
|
||||
Fouthi->r += t3.r + t4.r;
|
||||
Foutlo->i += t3.i - t4.i;
|
||||
|
Loading…
x
Reference in New Issue
Block a user