Advertisement
Guest User

Untitled

a guest
May 4th, 2013
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.63 KB | None | 0 0
  1. void complex_fir(float _Complex * restrict in, float _Complex * restrict out, unsigned int n, float * restrict coeff, unsigned int coeff_len)
  2. {
  3.     unsigned int i;
  4.     float _Complex s;
  5.     float _Complex * restrict in_p;
  6.     float * restrict coeff_p;
  7.  
  8. #ifdef LOL
  9.     in  = __builtin_assume_aligned(in, 8);
  10.     out = __builtin_assume_aligned(out, 8);
  11.     in_p = __builtin_assume_aligned(in_p, 8);
  12. #endif
  13.  
  14.     do {
  15.         s = 0;
  16.         in_p = in++;
  17.         coeff_p = coeff;
  18.  
  19.         i = coeff_len;
  20.         do {
  21.             s += *in_p++ * *coeff_p++;
  22.         } while (--i);
  23.  
  24.         *out++ = s;
  25.     } while (--n);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement