Merge branch 'wip/dxpsk' of http://gnuradio.org/git/jblum
[debian/gnuradio] / gnuradio-core / src / lib / general / gr_conjugate_cc.cc
index 0a5b3790eeab7a0a9375db12aff091401136d861..f25ce1a5773b0f566e44c585048f63e680d6a8dd 100644 (file)
@@ -6,7 +6,7 @@
  * 
  * GNU Radio is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
+ * the Free Software Foundation; either version 3, or (at your option)
  * any later version.
  * 
  * GNU Radio is distributed in the hope that it will be useful,
@@ -53,19 +53,24 @@ gr_conjugate_cc::work (int noutput_items,
   int  size = noutput_items;
 
   while (size >= 8){
-    *optr++ = gr_complex(real(*iptr),-imag(*iptr));iptr++;
-    *optr++ = gr_complex(real(*iptr),-imag(*iptr));iptr++;
-    *optr++ = gr_complex(real(*iptr),-imag(*iptr));iptr++;
-    *optr++ = gr_complex(real(*iptr),-imag(*iptr));iptr++;
-    *optr++ = gr_complex(real(*iptr),-imag(*iptr));iptr++;
-    *optr++ = gr_complex(real(*iptr),-imag(*iptr));iptr++;
-    *optr++ = gr_complex(real(*iptr),-imag(*iptr));iptr++;
-    *optr++ = gr_complex(real(*iptr),-imag(*iptr));iptr++;
+    optr[0] = conj(iptr[0]);
+    optr[1] = conj(iptr[1]);
+    optr[2] = conj(iptr[2]);
+    optr[3] = conj(iptr[3]);
+    optr[4] = conj(iptr[4]);
+    optr[5] = conj(iptr[5]);
+    optr[6] = conj(iptr[6]);
+    optr[7] = conj(iptr[7]);
     size -= 8;
+    optr += 8;
+    iptr += 8;
+  }
+
+  while (size-- > 0) {
+    *optr = conj(*iptr);
+    iptr++;
+    optr++;
   }
 
-  while (size-- > 0)
-    *optr++ = gr_complex(real(*iptr),-imag(*iptr));iptr++;
-  
   return noutput_items;
 }