From b10fb43644ae417860eb2c06297737ccd4dc9a05 Mon Sep 17 00:00:00 2001 From: Ralph Tandetzky Date: Thu, 21 Apr 2016 12:11:45 +0200 Subject: [PATCH] Removed macro-like looking private methods of kissfft class. All uses of these function were replaced by their implementation (which is mostly easier to read than the functions themselves). --- kissfft.hh | 83 ++++++++++++++++++++++-------------------------------- 1 file changed, 33 insertions(+), 50 deletions(-) diff --git a/kissfft.hh b/kissfft.hh index a38ed73..9fdded3 100644 --- a/kissfft.hh +++ b/kissfft.hh @@ -14,7 +14,7 @@ struct traits std::size_t nfft, bool inverse ) { - T_scalar phinc = (inverse?2:-2)* acos( (T_scalar) -1) / nfft; + const T_scalar phinc = (inverse?2:-2)* acos( (T_scalar) -1) / nfft; for (std::size_t i=0;ireal() - HALF_OF(scratch[3].real() ) , Fout->imag() - HALF_OF(scratch[3].imag() ) ); + Fout[m] = Fout[0] - scratch[3]*scalar_type(0.5); + scratch[0] *= epi3.imag(); - C_MULBYSCALAR( scratch[0] , epi3.imag() ); - - C_ADDTO(*Fout,scratch[3]); + Fout[0] += scratch[3]; Fout[m2] = cpx_type( Fout[m].real() + scratch[0].imag() , Fout[m].imag() - scratch[0].real() ); - C_ADDTO( Fout[m] , cpx_type( -scratch[0].imag(),scratch[0].real() ) ); + Fout[m] += cpx_type( -scratch[0].imag(),scratch[0].real() ); ++Fout; }while(--k); } @@ -206,48 +193,47 @@ class kissfft Fout4=Fout0+4*m; for ( std::size_t u=0; u=_nfft) twidx-=_nfft; - cpx_type t; - C_MUL(t,scratchbuf[q] , twiddles[twidx] ); - C_ADDTO( Fout[ k ] ,t); + Fout[ k ] += scratchbuf[q] * twiddles[twidx]; } k += m; }