SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
decimators.h
Go to the documentation of this file.
1 // Copyright (C) 2015 Edouard Griffiths, F4EXB //
3 // //
4 // This program is free software; you can redistribute it and/or modify //
5 // it under the terms of the GNU General Public License as published by //
6 // the Free Software Foundation as version 3 of the License, or //
7 // (at your option) any later version. //
8 // //
9 // This program is distributed in the hope that it will be useful, //
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
12 // GNU General Public License V3 for more details. //
13 // //
14 // You should have received a copy of the GNU General Public License //
15 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
17 
18 #ifndef INCLUDE_GPL_DSP_DECIMATORS_H_
19 #define INCLUDE_GPL_DSP_DECIMATORS_H_
20 
21 #include "dsp/dsptypes.h"
23 
24 #define DECIMATORS_HB_FILTER_ORDER 64
25 
26 template<uint SdrBits, uint InputBits>
28 {
29  static const uint pre1 = 0;
30  static const uint pre2 = 0;
31  static const uint post2 = 0;
32  static const uint pre4 = 0;
33  static const uint post4 = 0;
34  static const uint pre8 = 0;
35  static const uint post8 = 0;
36  static const uint pre16 = 0;
37  static const uint post16 = 0;
38  static const uint pre32 = 0;
39  static const uint post32 = 0;
40  static const uint pre64 = 0;
41  static const uint post64 = 0;
42 };
43 
44 template<>
45 struct decimation_shifts<16, 24>
46 {
47  static const uint pre1 = 0;
48  static const uint pre2 = 0;
49  static const uint post2 = 9;
50  static const uint pre4 = 0;
51  static const uint post4 = 10;
52  static const uint pre8 = 0;
53  static const uint post8 = 11;
54  static const uint pre16 = 0;
55  static const uint post16 = 12;
56  static const uint pre32 = 0;
57  static const uint post32 = 13;
58  static const uint pre64 = 0;
59  static const uint post64 = 14;
60 };
61 
62 template<>
63 struct decimation_shifts<24, 24>
64 {
65  static const uint pre1 = 0;
66  static const uint pre2 = 0;
67  static const uint post2 = 1;
68  static const uint pre4 = 0;
69  static const uint post4 = 2;
70  static const uint pre8 = 0;
71  static const uint post8 = 3;
72  static const uint pre16 = 0;
73  static const uint post16 = 4;
74  static const uint pre32 = 0;
75  static const uint post32 = 5;
76  static const uint pre64 = 0;
77  static const uint post64 = 6;
78 };
79 
80 template<>
81 struct decimation_shifts<16, 16>
82 {
83  static const uint pre1 = 0;
84  static const uint pre2 = 0;
85  static const uint post2 = 1;
86  static const uint pre4 = 0;
87  static const uint post4 = 2;
88  static const uint pre8 = 0;
89  static const uint post8 = 3;
90  static const uint pre16 = 0;
91  static const uint post16 = 4;
92  static const uint pre32 = 0;
93  static const uint post32 = 5;
94  static const uint pre64 = 0;
95  static const uint post64 = 6;
96 };
97 
98 template<>
99 struct decimation_shifts<24, 16>
100 {
101  static const uint pre1 = 8;
102  static const uint pre2 = 7;
103  static const uint post2 = 0;
104  static const uint pre4 = 6;
105  static const uint post4 = 0;
106  static const uint pre8 = 5;
107  static const uint post8 = 0;
108  static const uint pre16 = 4;
109  static const uint post16 = 0;
110  static const uint pre32 = 3;
111  static const uint post32 = 0;
112  static const uint pre64 = 2;
113  static const uint post64 = 0;
114 };
115 
116 template<>
117 struct decimation_shifts<16, 12>
118 {
119  static const uint pre1 = 4;
120  static const uint pre2 = 3;
121  static const uint post2 = 0;
122  static const uint pre4 = 2;
123  static const uint post4 = 0;
124  static const uint pre8 = 1;
125  static const uint post8 = 0;
126  static const uint pre16 = 0;
127  static const uint post16 = 0;
128  static const uint pre32 = 0;
129  static const uint post32 = 1;
130  static const uint pre64 = 0;
131  static const uint post64 = 2;
132 };
133 
134 template<>
135 struct decimation_shifts<24, 12>
136 {
137  static const uint pre1 = 12;
138  static const uint pre2 = 11;
139  static const uint post2 = 0;
140  static const uint pre4 = 10;
141  static const uint post4 = 0;
142  static const uint pre8 = 9;
143  static const uint post8 = 0;
144  static const uint pre16 = 8;
145  static const uint post16 = 0;
146  static const uint pre32 = 7;
147  static const uint post32 = 0;
148  static const uint pre64 = 6;
149  static const uint post64 = 0;
150 };
151 
152 template<>
153 struct decimation_shifts<16, 8>
154 {
155  static const uint pre1 = 8;
156  static const uint pre2 = 7;
157  static const uint post2 = 0;
158  static const uint pre4 = 6;
159  static const uint post4 = 0;
160  static const uint pre8 = 5;
161  static const uint post8 = 0;
162  static const uint pre16 = 4;
163  static const uint post16 = 0;
164  static const uint pre32 = 3;
165  static const uint post32 = 0;
166  static const uint pre64 = 2;
167  static const uint post64 = 0;
168 };
169 
170 template<>
171 struct decimation_shifts<24, 8>
172 {
173  static const uint pre1 = 16;
174  static const uint pre2 = 15;
175  static const uint post2 = 0;
176  static const uint pre4 = 14;
177  static const uint post4 = 0;
178  static const uint pre8 = 13;
179  static const uint post8 = 0;
180  static const uint pre16 = 12;
181  static const uint post16 = 0;
182  static const uint pre32 = 11;
183  static const uint post32 = 0;
184  static const uint pre64 = 10;
185  static const uint post64 = 0;
186 };
187 
188 #ifdef _MSC_VER
189 #pragma pack(push,1)
190 template<typename T>
191 struct TripleByteLE
192 {
193  uint8_t b0;
194  uint8_t b1;
195  uint8_t b2;
196 
197  typedef union {
198 #pragma pack(push,1)
199  struct {
200  int32_t i;
201  };
202 #pragma pack(pop)
203 #pragma pack(push, 1)
204  struct {
205  uint8_t i0;
206  uint8_t i1;
207  uint8_t i2;
208  uint8_t i3;
209  };
210 #pragma pack(pop)
211  } isample;
212 
213  operator T() const {
214  isample s;
215  s.i0 = 0;
216  s.i1 = b0;
217  s.i2 = b1;
218  s.i3 = b2;
219  return s.i;
220  }
221 };
222 #pragma pack(pop)
223 #else
224 template<typename T>
226 {
230 
231  typedef union {
232  struct {
234  } __attribute__((__packed__));
235  struct {
240  } __attribute__((__packed__));
241  } isample;
242 
243  operator T() const {
245  s.i0 = 0;
246  s.i1 = b0;
247  s.i2 = b1;
248  s.i3 = b2;
249  return s.i;
250  }
251 } __attribute__((__packed__));
252 #endif
253 
254 #ifdef _MSC_VER
255 #pragma pack(push, 1)
256 template<>
257 struct TripleByteLE<qint32>
258 {
259  uint8_t b0;
260  uint8_t b1;
261  uint8_t b2;
262 
263  typedef union {
264 #pragma pack(push, 1)
265  struct {
266  qint32 i;
267  };
268 #pragma pack(pop)
269 #pragma pack(push, 1)
270  struct {
271  uint8_t i0;
272  uint8_t i1;
273  uint8_t i2;
274  uint8_t i3;
275  };
276 #pragma pack(pop)
277  } isample;
278 
279  operator qint32() const {
280  isample s;
281  s.i0 = 0;
282  s.i1 = b0;
283  s.i2 = b1;
284  s.i3 = b2;
285  return s.i >> 8;
286  }
287 };
288 #pragma pack(pop)
289 #else
290 template<>
291 struct TripleByteLE<qint32>
292 {
296 
297  typedef union {
298  struct {
299  qint32 i;
300  } __attribute__((__packed__));
301  struct {
306  } __attribute__((__packed__));
307  } isample;
308 
309  operator qint32() const {
310  isample s;
311  s.i0 = 0;
312  s.i1 = b0;
313  s.i2 = b1;
314  s.i3 = b2;
315  return s.i >> 8;
316  }
317 } __attribute__((__packed__));
318 #endif
319 
320 #ifdef _MSC_VER
321 #pragma pack(push, 1)
322 template<>
323 struct TripleByteLE<qint64>
324 {
325  uint8_t b0;
326  uint8_t b1;
327  uint8_t b2;
328 
329  typedef union {
330 #pragma pack(push, 1)
331  struct {
332  qint64 i;
333  };
334 #pragma pack(pop)
335 #pragma pack(push, 1)
336  struct {
337  uint32_t ia;
338  uint8_t i0;
339  uint8_t i1;
340  uint8_t i2;
341  uint8_t i3;
342  };
343 #pragma pack(pop)
344  } isample;
345 
346  operator qint64() const {
347  isample s;
348  s.ia = 0;
349  s.i0 = 0;
350  s.i1 = b0;
351  s.i2 = b1;
352  s.i3 = b2;
353  return s.i >> 40;
354  }
355 };
356 #pragma pack(pop)
357 #else
358 template<>
359 struct TripleByteLE<qint64>
360 {
364 
365  typedef union {
366  struct {
367  qint64 i;
368  } __attribute__((__packed__));
369  struct {
375  } __attribute__((__packed__));
376  } isample;
377 
378  operator qint64() const {
380  s.ia = 0;
381  s.i0 = 0;
382  s.i1 = b0;
383  s.i2 = b1;
384  s.i3 = b2;
385  return s.i >> 40;
386  }
387 } __attribute__((__packed__));
388 #endif
389 
391 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
393 {
394 public:
395  // interleaved I/Q input buffer
396  void decimate1(SampleVector::iterator* it, const T* buf, qint32 len);
397 
398  void decimate2_u(SampleVector::iterator* it, const T* buf, qint32 len);
399  void decimate2_inf(SampleVector::iterator* it, const T* buf, qint32 len);
400  void decimate2_sup(SampleVector::iterator* it, const T* buf, qint32 len);
401  void decimate2_cen(SampleVector::iterator* it, const T* buf, qint32 len);
402 
403  void decimate4_inf(SampleVector::iterator* it, const T* buf, qint32 len);
404  void decimate4_inf_txsync(SampleVector::iterator* it, const T* buf, qint32 len);
405  void decimate4_sup(SampleVector::iterator* it, const T* buf, qint32 len);
406  void decimate4_sup_txsync(SampleVector::iterator* it, const T* buf, qint32 len);
407  void decimate4_cen(SampleVector::iterator* it, const T* buf, qint32 len);
408 
409  void decimate8_inf(SampleVector::iterator* it, const T* buf, qint32 len);
410  void decimate8_inf_txsync(SampleVector::iterator* it, const T* buf, qint32 len);
411  void decimate8_sup(SampleVector::iterator* it, const T* buf, qint32 len);
412  void decimate8_sup_txsync(SampleVector::iterator* it, const T* buf, qint32 len);
413  void decimate8_cen(SampleVector::iterator* it, const T* buf, qint32 len);
414 
415  void decimate16_inf(SampleVector::iterator* it, const T* buf, qint32 len);
416  void decimate16_inf_txsync(SampleVector::iterator* it, const T* buf, qint32 len);
417  void decimate16_sup(SampleVector::iterator* it, const T* buf, qint32 len);
418  void decimate16_sup_txsync(SampleVector::iterator* it, const T* buf, qint32 len);
419  void decimate16_cen(SampleVector::iterator* it, const T* buf, qint32 len);
420 
421  void decimate32_inf(SampleVector::iterator* it, const T* buf, qint32 len);
422  void decimate32_inf_txsync(SampleVector::iterator* it, const T* buf, qint32 len);
423  void decimate32_sup(SampleVector::iterator* it, const T* buf, qint32 len);
424  void decimate32_sup_txsync(SampleVector::iterator* it, const T* buf, qint32 len);
425  void decimate32_cen(SampleVector::iterator* it, const T* buf, qint32 len);
426 
427  void decimate64_inf(SampleVector::iterator* it, const T* buf, qint32 len);
428  void decimate64_inf_txsync(SampleVector::iterator* it, const T* buf, qint32 len);
429  void decimate64_sup(SampleVector::iterator* it, const T* buf, qint32 len);
430  void decimate64_sup_txsync(SampleVector::iterator* it, const T* buf, qint32 len);
431  void decimate64_cen(SampleVector::iterator* it, const T* buf, qint32 len);
432 
433  // separate I and Q input buffers
434  void decimate1(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len);
435  void decimate2_u(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len);
436  void decimate2_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len);
437  void decimate4_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len);
438  void decimate8_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len);
439  void decimate16_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len);
440  void decimate32_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len);
441  void decimate64_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len);
442 
443 private:
444 #ifdef SDR_RX_SAMPLE_24BIT
451 #else
458 #endif
459 };
460 
461 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
462 void Decimators<StorageType, T, SdrBits, InputBits>::decimate1(SampleVector::iterator* it, const T* buf, qint32 len)
463 {
464  qint32 xreal, yimag;
465 
466  for (int pos = 0; pos < len - 1; pos += 2)
467  {
468  xreal = buf[pos+0];
469  yimag = buf[pos+1];
470  (**it).setReal(xreal << decimation_shifts<SdrBits, InputBits>::pre1); // Valgrind optim (2 - comment not repeated)
471  (**it).setImag(yimag << decimation_shifts<SdrBits, InputBits>::pre1);
472  ++(*it); // Valgrind optim (comment not repeated)
473  }
474 }
475 
476 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
477 void Decimators<StorageType, T, SdrBits, InputBits>::decimate2_u(SampleVector::iterator* it, const T* buf, qint32 len)
478 {
479  StorageType xreal, yimag;
480 
481  for (int pos = 0; pos < len - 7; pos += 8)
482  {
483  xreal = (buf[pos+0] - buf[pos+3]) << decimation_shifts<SdrBits, InputBits>::pre2;
484  yimag = (buf[pos+1] + buf[pos+2] - 255) << decimation_shifts<SdrBits, InputBits>::pre2;
485  (**it).setReal(xreal >> decimation_shifts<SdrBits, InputBits>::post2);
486  (**it).setImag(yimag >> decimation_shifts<SdrBits, InputBits>::post2);
487  ++(*it);
488 
489  xreal = (buf[pos+7] - buf[pos+4]) << decimation_shifts<SdrBits, InputBits>::pre2;
490  yimag = (255 - buf[pos+5] - buf[pos+6]) << decimation_shifts<SdrBits, InputBits>::pre2;
491  (**it).setReal(xreal >> decimation_shifts<SdrBits, InputBits>::post2);
492  (**it).setImag(yimag >> decimation_shifts<SdrBits, InputBits>::post2);
493  ++(*it);
494  }
495 }
496 
497 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
498 void Decimators<StorageType, T, SdrBits, InputBits>::decimate2_inf(SampleVector::iterator* it, const T* buf, qint32 len)
499 {
500  StorageType buf2[4];
501 
502  for (int pos = 0; pos < len - 7; pos += 8)
503  {
504  m_decimator2.myDecimateInf(
513  &buf2[0]);
514 
515  (**it).setReal(buf2[0] >> decimation_shifts<SdrBits, InputBits>::post2);
516  (**it).setImag(buf2[1] >> decimation_shifts<SdrBits, InputBits>::post2);
517  ++(*it);
518 
519  (**it).setReal(buf2[2] >> decimation_shifts<SdrBits, InputBits>::post2);
520  (**it).setImag(buf2[3] >> decimation_shifts<SdrBits, InputBits>::post2);
521  ++(*it);
522  }
523 }
524 
525 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
526 void Decimators<StorageType, T, SdrBits, InputBits>::decimate2_sup(SampleVector::iterator* it, const T* buf, qint32 len)
527 {
528  StorageType buf2[4];
529 
530  for (int pos = 0; pos < len - 7; pos += 8)
531  {
532  m_decimator2.myDecimateSup(
541  &buf2[0]);
542 
543  (**it).setReal(buf2[0] >> decimation_shifts<SdrBits, InputBits>::post2);
544  (**it).setImag(buf2[1] >> decimation_shifts<SdrBits, InputBits>::post2);
545  ++(*it);
546 
547  (**it).setReal(buf2[2] >> decimation_shifts<SdrBits, InputBits>::post2);
548  (**it).setImag(buf2[3] >> decimation_shifts<SdrBits, InputBits>::post2);
549  ++(*it);
550  }
551 }
552 
553 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
554 void Decimators<StorageType, T, SdrBits, InputBits>::decimate2_cen(SampleVector::iterator* it, const T* buf, qint32 len)
555 {
556  StorageType buf2[4];
557 
558  for (int pos = 0; pos < len - 7; pos += 8)
559  {
560  m_decimator2.myDecimateCen(
569  &buf2[0]);
570 
571  (**it).setReal(buf2[0] >> decimation_shifts<SdrBits, InputBits>::post2);
572  (**it).setImag(buf2[1] >> decimation_shifts<SdrBits, InputBits>::post2);
573  ++(*it);
574 
575  (**it).setReal(buf2[2] >> decimation_shifts<SdrBits, InputBits>::post2);
576  (**it).setImag(buf2[3] >> decimation_shifts<SdrBits, InputBits>::post2);
577  ++(*it);
578  }
579 }
580 
581 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
582 void Decimators<StorageType, T, SdrBits, InputBits>::decimate4_inf(SampleVector::iterator* it, const T* buf, qint32 len)
583 {
584  StorageType buf2[8], buf4[4];
585 
586  for (int pos = 0; pos < len - 15; pos += 16)
587  {
588  m_decimator2.myDecimateInf(
597  &buf2[0]);
598 
599  m_decimator2.myDecimateInf(
608  &buf2[4]);
609 
610  m_decimator4.myDecimateSup(
611  buf2[0],
612  buf2[1],
613  buf2[2],
614  buf2[3],
615  buf2[4],
616  buf2[5],
617  buf2[6],
618  buf2[7],
619  &buf4[0]);
620 
621  (**it).setReal(buf4[0] >> decimation_shifts<SdrBits, InputBits>::post4);
622  (**it).setImag(buf4[1] >> decimation_shifts<SdrBits, InputBits>::post4);
623  ++(*it);
624 
625  (**it).setReal(buf4[2] >> decimation_shifts<SdrBits, InputBits>::post4);
626  (**it).setImag(buf4[3] >> decimation_shifts<SdrBits, InputBits>::post4);
627  ++(*it);
628  }
629 }
630 
631 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
632 void Decimators<StorageType, T, SdrBits, InputBits>::decimate4_inf_txsync(SampleVector::iterator* it, const T* buf, qint32 len)
633 {
634  StorageType buf2[8], buf4[4];
635 
636  for (int pos = 0; pos < len - 15; pos += 16)
637  {
638  m_decimator2.myDecimateInf(
647  &buf2[0]);
648 
649  m_decimator2.myDecimateInf(
658  &buf2[4]);
659 
660  m_decimator4.myDecimateInf(
661  buf2[0],
662  buf2[1],
663  buf2[2],
664  buf2[3],
665  buf2[4],
666  buf2[5],
667  buf2[6],
668  buf2[7],
669  &buf4[0]);
670 
671  (**it).setReal(buf4[0] >> decimation_shifts<SdrBits, InputBits>::post4);
672  (**it).setImag(buf4[1] >> decimation_shifts<SdrBits, InputBits>::post4);
673  ++(*it);
674 
675  (**it).setReal(buf4[2] >> decimation_shifts<SdrBits, InputBits>::post4);
676  (**it).setImag(buf4[3] >> decimation_shifts<SdrBits, InputBits>::post4);
677  ++(*it);
678  }
679 }
680 
681 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
682 void Decimators<StorageType, T, SdrBits, InputBits>::decimate4_sup(SampleVector::iterator* it, const T* buf, qint32 len)
683 {
684  StorageType buf2[8], buf4[4];
685 
686  for (int pos = 0; pos < len - 15; pos += 16)
687  {
688  m_decimator2.myDecimateSup(
697  &buf2[0]);
698 
699  m_decimator2.myDecimateSup(
708  &buf2[4]);
709 
710  m_decimator4.myDecimateInf(
711  buf2[0],
712  buf2[1],
713  buf2[2],
714  buf2[3],
715  buf2[4],
716  buf2[5],
717  buf2[6],
718  buf2[7],
719  &buf4[0]);
720 
721  (**it).setReal(buf4[0] >> decimation_shifts<SdrBits, InputBits>::post4);
722  (**it).setImag(buf4[1] >> decimation_shifts<SdrBits, InputBits>::post4);
723  ++(*it);
724 
725  (**it).setReal(buf4[2] >> decimation_shifts<SdrBits, InputBits>::post4);
726  (**it).setImag(buf4[3] >> decimation_shifts<SdrBits, InputBits>::post4);
727  ++(*it);
728  }
729 }
730 
731 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
732 void Decimators<StorageType, T, SdrBits, InputBits>::decimate4_sup_txsync(SampleVector::iterator* it, const T* buf, qint32 len)
733 {
734  StorageType buf2[8], buf4[4];
735 
736  for (int pos = 0; pos < len - 15; pos += 16)
737  {
738  m_decimator2.myDecimateSup(
747  &buf2[0]);
748 
749  m_decimator2.myDecimateSup(
758  &buf2[4]);
759 
760  m_decimator4.myDecimateSup(
761  buf2[0],
762  buf2[1],
763  buf2[2],
764  buf2[3],
765  buf2[4],
766  buf2[5],
767  buf2[6],
768  buf2[7],
769  &buf4[0]);
770 
771  (**it).setReal(buf4[0] >> decimation_shifts<SdrBits, InputBits>::post4);
772  (**it).setImag(buf4[1] >> decimation_shifts<SdrBits, InputBits>::post4);
773  ++(*it);
774 
775  (**it).setReal(buf4[2] >> decimation_shifts<SdrBits, InputBits>::post4);
776  (**it).setImag(buf4[3] >> decimation_shifts<SdrBits, InputBits>::post4);
777  ++(*it);
778  }
779 }
780 
781 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
782 void Decimators<StorageType, T, SdrBits, InputBits>::decimate4_cen(SampleVector::iterator* it, const T* buf, qint32 len)
783 {
784  StorageType buf2[8], buf4[4];
785 
786  for (int pos = 0; pos < len - 15; pos += 16)
787  {
788  m_decimator2.myDecimateCen(
797  &buf2[0]);
798 
799  m_decimator2.myDecimateCen(
808  &buf2[4]);
809 
810  m_decimator4.myDecimateCen(
811  &buf2[0],
812  &buf4[0]);
813 
814  (**it).setReal(buf4[0] >> decimation_shifts<SdrBits, InputBits>::post4);
815  (**it).setImag(buf4[1] >> decimation_shifts<SdrBits, InputBits>::post4);
816  ++(*it);
817 
818  (**it).setReal(buf4[2] >> decimation_shifts<SdrBits, InputBits>::post4);
819  (**it).setImag(buf4[3] >> decimation_shifts<SdrBits, InputBits>::post4);
820  ++(*it);
821  }
822 }
823 
824 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
825 void Decimators<StorageType, T, SdrBits, InputBits>::decimate8_inf(SampleVector::iterator* it, const T* buf, qint32 len)
826 {
827  StorageType buf2[16], buf4[8], buf8[4];
828 
829  for (int pos = 0; pos < len - 31; pos += 32)
830  {
831  m_decimator2.myDecimateInf(
840  &buf2[0]);
841 
842  m_decimator2.myDecimateInf(
851  &buf2[4]);
852 
853  m_decimator2.myDecimateInf(
862  &buf2[8]);
863 
864  m_decimator2.myDecimateInf(
873  &buf2[12]);
874 
875  m_decimator4.myDecimateSup(
876  &buf2[0],
877  &buf4[0]);
878 
879  m_decimator4.myDecimateSup(
880  &buf2[8],
881  &buf4[4]);
882 
883  m_decimator8.myDecimateCen(
884  &buf4[0],
885  &buf8[0]);
886 
887  (**it).setReal(buf8[0] >> decimation_shifts<SdrBits, InputBits>::post8);
888  (**it).setImag(buf8[1] >> decimation_shifts<SdrBits, InputBits>::post8);
889  ++(*it);
890 
891  (**it).setReal(buf8[2] >> decimation_shifts<SdrBits, InputBits>::post8);
892  (**it).setImag(buf8[3] >> decimation_shifts<SdrBits, InputBits>::post8);
893  ++(*it);
894  }
895 }
896 
897 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
898 void Decimators<StorageType, T, SdrBits, InputBits>::decimate8_inf_txsync(SampleVector::iterator* it, const T* buf, qint32 len)
899 {
900  StorageType buf2[16], buf4[8], buf8[4];
901 
902  for (int pos = 0; pos < len - 31; pos += 32)
903  {
904  for (int i = 0; i < 4; i++)
905  {
906  m_decimator2.myDecimateInf(
915  &buf2[4*i]);
916  }
917 
918  m_decimator4.myDecimateInf(
919  &buf2[0],
920  &buf4[0]);
921 
922  m_decimator4.myDecimateInf(
923  &buf2[8],
924  &buf4[4]);
925 
926  m_decimator8.myDecimateSup(
927  &buf4[0],
928  &buf8[0]);
929 
930  (**it).setReal(buf8[0] >> decimation_shifts<SdrBits, InputBits>::post8);
931  (**it).setImag(buf8[1] >> decimation_shifts<SdrBits, InputBits>::post8);
932  ++(*it);
933 
934  (**it).setReal(buf8[2] >> decimation_shifts<SdrBits, InputBits>::post8);
935  (**it).setImag(buf8[3] >> decimation_shifts<SdrBits, InputBits>::post8);
936  ++(*it);
937  }
938 }
939 
940 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
941 void Decimators<StorageType, T, SdrBits, InputBits>::decimate8_sup(SampleVector::iterator* it, const T* buf, qint32 len)
942 {
943  StorageType buf2[16], buf4[8], buf8[4];
944 
945  for (int pos = 0; pos < len - 31; pos += 32)
946  {
947  m_decimator2.myDecimateSup(
956  &buf2[0]);
957 
958  m_decimator2.myDecimateSup(
967  &buf2[4]);
968 
969  m_decimator2.myDecimateSup(
978  &buf2[8]);
979 
980  m_decimator2.myDecimateSup(
989  &buf2[12]);
990 
991  m_decimator4.myDecimateInf(
992  &buf2[0],
993  &buf4[0]);
994 
995  m_decimator4.myDecimateInf(
996  &buf2[8],
997  &buf4[4]);
998 
999  m_decimator8.myDecimateCen(
1000  &buf4[0],
1001  &buf8[0]);
1002 
1003  (**it).setReal(buf8[0] >> decimation_shifts<SdrBits, InputBits>::post8);
1004  (**it).setImag(buf8[1] >> decimation_shifts<SdrBits, InputBits>::post8);
1005  ++(*it);
1006 
1007  (**it).setReal(buf8[2] >> decimation_shifts<SdrBits, InputBits>::post8);
1008  (**it).setImag(buf8[3] >> decimation_shifts<SdrBits, InputBits>::post8);
1009  ++(*it);
1010  }
1011 }
1012 
1013 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
1014 void Decimators<StorageType, T, SdrBits, InputBits>::decimate8_sup_txsync(SampleVector::iterator* it, const T* buf, qint32 len)
1015 {
1016  StorageType buf2[16], buf4[8], buf8[4];
1017 
1018  for (int pos = 0; pos < len - 31; pos += 32)
1019  {
1020  for (int i = 0; i < 4; i++)
1021  {
1022  m_decimator2.myDecimateSup(
1031  &buf2[4*i]);
1032  }
1033 
1034  m_decimator4.myDecimateSup(
1035  &buf2[0],
1036  &buf4[0]);
1037 
1038  m_decimator4.myDecimateSup(
1039  &buf2[8],
1040  &buf4[4]);
1041 
1042  m_decimator8.myDecimateInf(
1043  &buf4[0],
1044  &buf8[0]);
1045 
1046  (**it).setReal(buf8[0] >> decimation_shifts<SdrBits, InputBits>::post8);
1047  (**it).setImag(buf8[1] >> decimation_shifts<SdrBits, InputBits>::post8);
1048  ++(*it);
1049 
1050  (**it).setReal(buf8[2] >> decimation_shifts<SdrBits, InputBits>::post8);
1051  (**it).setImag(buf8[3] >> decimation_shifts<SdrBits, InputBits>::post8);
1052  ++(*it);
1053  }
1054 }
1055 
1056 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
1057 void Decimators<StorageType, T, SdrBits, InputBits>::decimate8_cen(SampleVector::iterator* it, const T* buf, qint32 len)
1058 {
1059  StorageType intbuf[8];
1060 
1061  for (int pos = 0; pos < len - 15; pos += 16)
1062  {
1063  intbuf[0] = buf[pos+2] << decimation_shifts<SdrBits, InputBits>::pre8;
1064  intbuf[1] = buf[pos+3] << decimation_shifts<SdrBits, InputBits>::pre8;
1065  intbuf[2] = buf[pos+6] << decimation_shifts<SdrBits, InputBits>::pre8;
1066  intbuf[3] = buf[pos+7] << decimation_shifts<SdrBits, InputBits>::pre8;
1067  intbuf[4] = buf[pos+10] << decimation_shifts<SdrBits, InputBits>::pre8;
1068  intbuf[5] = buf[pos+11] << decimation_shifts<SdrBits, InputBits>::pre8;
1069  intbuf[6] = buf[pos+14] << decimation_shifts<SdrBits, InputBits>::pre8;
1070  intbuf[7] = buf[pos+15] << decimation_shifts<SdrBits, InputBits>::pre8;
1071 
1072  m_decimator2.myDecimate(
1073  buf[pos+0] << decimation_shifts<SdrBits, InputBits>::pre8,
1074  buf[pos+1] << decimation_shifts<SdrBits, InputBits>::pre8,
1075  &intbuf[0],
1076  &intbuf[1]);
1077  m_decimator2.myDecimate(
1078  buf[pos+4] << decimation_shifts<SdrBits, InputBits>::pre8,
1079  buf[pos+5] << decimation_shifts<SdrBits, InputBits>::pre8,
1080  &intbuf[2],
1081  &intbuf[3]);
1082  m_decimator2.myDecimate(
1083  buf[pos+8] << decimation_shifts<SdrBits, InputBits>::pre8,
1084  buf[pos+9] << decimation_shifts<SdrBits, InputBits>::pre8,
1085  &intbuf[4],
1086  &intbuf[5]);
1087  m_decimator2.myDecimate(
1088  buf[pos+12] << decimation_shifts<SdrBits, InputBits>::pre8,
1089  buf[pos+13] << decimation_shifts<SdrBits, InputBits>::pre8,
1090  &intbuf[6],
1091  &intbuf[7]);
1092 
1093  m_decimator4.myDecimate(
1094  intbuf[0],
1095  intbuf[1],
1096  &intbuf[2],
1097  &intbuf[3]);
1098  m_decimator4.myDecimate(
1099  intbuf[4],
1100  intbuf[5],
1101  &intbuf[6],
1102  &intbuf[7]);
1103 
1104  m_decimator8.myDecimate(
1105  intbuf[2],
1106  intbuf[3],
1107  &intbuf[6],
1108  &intbuf[7]);
1109 
1110  (**it).setReal(intbuf[6] >> decimation_shifts<SdrBits, InputBits>::post8);
1111  (**it).setImag(intbuf[7] >> decimation_shifts<SdrBits, InputBits>::post8);
1112  ++(*it);
1113  }
1114 }
1115 
1116 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
1117 void Decimators<StorageType, T, SdrBits, InputBits>::decimate16_inf(SampleVector::iterator* it, const T* buf, qint32 len)
1118 {
1119  StorageType buf2[32], buf4[16], buf8[8], buf16[4];
1120 
1121  for (int pos = 0; pos < len - 63; pos += 64)
1122  {
1123  m_decimator2.myDecimateInf(
1132  &buf2[0]);
1133 
1134  m_decimator2.myDecimateInf(
1143  &buf2[4]);
1144 
1145  m_decimator2.myDecimateInf(
1154  &buf2[8]);
1155 
1156  m_decimator2.myDecimateInf(
1165  &buf2[12]);
1166 
1167  m_decimator2.myDecimateInf(
1176  &buf2[16]);
1177 
1178  m_decimator2.myDecimateInf(
1187  &buf2[20]);
1188 
1189  m_decimator2.myDecimateInf(
1198  &buf2[24]);
1199 
1200  m_decimator2.myDecimateInf(
1209  &buf2[28]);
1210 
1211  m_decimator4.myDecimateSup(
1212  &buf2[0],
1213  &buf4[0]);
1214 
1215  m_decimator4.myDecimateSup(
1216  &buf2[8],
1217  &buf4[4]);
1218 
1219  m_decimator4.myDecimateSup(
1220  &buf2[16],
1221  &buf4[8]);
1222 
1223  m_decimator4.myDecimateSup(
1224  &buf2[24],
1225  &buf4[12]);
1226 
1227  m_decimator8.myDecimateSup(
1228  &buf4[0],
1229  &buf8[0]);
1230 
1231  m_decimator8.myDecimateSup(
1232  &buf4[8],
1233  &buf8[4]);
1234 
1235  m_decimator16.myDecimateCen(
1236  &buf8[0],
1237  &buf16[0]);
1238 
1239  (**it).setReal(buf16[0] >> decimation_shifts<SdrBits, InputBits>::post16);
1240  (**it).setImag(buf16[1] >> decimation_shifts<SdrBits, InputBits>::post16);
1241  ++(*it);
1242 
1243  (**it).setReal(buf16[2] >> decimation_shifts<SdrBits, InputBits>::post16);
1244  (**it).setImag(buf16[3] >> decimation_shifts<SdrBits, InputBits>::post16);
1245  ++(*it);
1246  }
1247 }
1248 
1249 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
1250 void Decimators<StorageType, T, SdrBits, InputBits>::decimate16_inf_txsync(SampleVector::iterator* it, const T* buf, qint32 len)
1251 {
1252  StorageType buf2[32], buf4[16], buf8[8], buf16[4];
1253 
1254  for (int pos = 0; pos < len - 63; pos += 64)
1255  {
1256  for (int i = 0; i < 8; i++)
1257  {
1258  m_decimator2.myDecimateInf(
1267  &buf2[4*i]);
1268  }
1269 
1270  for (int i = 0; i < 4; i++)
1271  {
1272  m_decimator4.myDecimateInf(
1273  &buf2[8*i],
1274  &buf4[4*i]);
1275  }
1276 
1277  m_decimator8.myDecimateSup(
1278  &buf4[0],
1279  &buf8[0]);
1280 
1281  m_decimator8.myDecimateSup(
1282  &buf4[8],
1283  &buf8[4]);
1284 
1285  m_decimator16.myDecimateInf(
1286  &buf8[0],
1287  &buf16[0]);
1288 
1289  (**it).setReal(buf16[0] >> decimation_shifts<SdrBits, InputBits>::post16);
1290  (**it).setImag(buf16[1] >> decimation_shifts<SdrBits, InputBits>::post16);
1291  ++(*it);
1292 
1293  (**it).setReal(buf16[2] >> decimation_shifts<SdrBits, InputBits>::post16);
1294  (**it).setImag(buf16[3] >> decimation_shifts<SdrBits, InputBits>::post16);
1295  ++(*it);
1296  }
1297 }
1298 
1299 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
1300 void Decimators<StorageType, T, SdrBits, InputBits>::decimate16_sup(SampleVector::iterator* it, const T* buf, qint32 len)
1301 {
1302  StorageType buf2[32], buf4[16], buf8[8], buf16[4];
1303 
1304  for (int pos = 0; pos < len - 63; pos += 64)
1305  {
1306  m_decimator2.myDecimateSup(
1315  &buf2[0]);
1316 
1317  m_decimator2.myDecimateSup(
1326  &buf2[4]);
1327 
1328  m_decimator2.myDecimateSup(
1337  &buf2[8]);
1338 
1339  m_decimator2.myDecimateSup(
1348  &buf2[12]);
1349 
1350  m_decimator2.myDecimateSup(
1359  &buf2[16]);
1360 
1361  m_decimator2.myDecimateSup(
1370  &buf2[20]);
1371 
1372  m_decimator2.myDecimateSup(
1381  &buf2[24]);
1382 
1383  m_decimator2.myDecimateSup(
1392  &buf2[28]);
1393 
1394  m_decimator4.myDecimateInf(
1395  &buf2[0],
1396  &buf4[0]);
1397 
1398  m_decimator4.myDecimateInf(
1399  &buf2[8],
1400  &buf4[4]);
1401 
1402  m_decimator4.myDecimateInf(
1403  &buf2[16],
1404  &buf4[8]);
1405 
1406  m_decimator4.myDecimateInf(
1407  &buf2[24],
1408  &buf4[12]);
1409 
1410  m_decimator8.myDecimateInf(
1411  &buf4[0],
1412  &buf8[0]);
1413 
1414  m_decimator8.myDecimateInf(
1415  &buf4[8],
1416  &buf8[4]);
1417 
1418  m_decimator16.myDecimateCen(
1419  &buf8[0],
1420  &buf16[0]);
1421 
1422  (**it).setReal(buf16[0] >> decimation_shifts<SdrBits, InputBits>::post16);
1423  (**it).setImag(buf16[1] >> decimation_shifts<SdrBits, InputBits>::post16);
1424  ++(*it);
1425 
1426  (**it).setReal(buf16[2] >> decimation_shifts<SdrBits, InputBits>::post16);
1427  (**it).setImag(buf16[3] >> decimation_shifts<SdrBits, InputBits>::post16);
1428  ++(*it);
1429  }
1430 }
1431 
1432 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
1433 void Decimators<StorageType, T, SdrBits, InputBits>::decimate16_sup_txsync(SampleVector::iterator* it, const T* buf, qint32 len)
1434 {
1435  StorageType buf2[32], buf4[16], buf8[8], buf16[4];
1436 
1437  for (int pos = 0; pos < len - 63; pos += 64)
1438  {
1439  for (int i = 0; i < 8; i++)
1440  {
1441  m_decimator2.myDecimateSup(
1450  &buf2[4*i]);
1451  }
1452 
1453  for (int i = 0; i < 4; i++)
1454  {
1455  m_decimator4.myDecimateSup(
1456  &buf2[8*i],
1457  &buf4[4*i]);
1458  }
1459 
1460  m_decimator8.myDecimateInf(
1461  &buf4[0],
1462  &buf8[0]);
1463 
1464  m_decimator8.myDecimateInf(
1465  &buf4[8],
1466  &buf8[4]);
1467 
1468  m_decimator16.myDecimateSup(
1469  &buf8[0],
1470  &buf16[0]);
1471 
1472  (**it).setReal(buf16[0] >> decimation_shifts<SdrBits, InputBits>::post16);
1473  (**it).setImag(buf16[1] >> decimation_shifts<SdrBits, InputBits>::post16);
1474  ++(*it);
1475 
1476  (**it).setReal(buf16[2] >> decimation_shifts<SdrBits, InputBits>::post16);
1477  (**it).setImag(buf16[3] >> decimation_shifts<SdrBits, InputBits>::post16);
1478  ++(*it);
1479  }
1480 }
1481 
1482 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
1483 void Decimators<StorageType, T, SdrBits, InputBits>::decimate16_cen(SampleVector::iterator* it, const T* buf, qint32 len)
1484 {
1485  StorageType intbuf[16];
1486 
1487  for (int pos = 0; pos < len - 31; pos += 32)
1488  {
1489  intbuf[0] = buf[pos+2] << decimation_shifts<SdrBits, InputBits>::pre16;
1490  intbuf[1] = buf[pos+3] << decimation_shifts<SdrBits, InputBits>::pre16;
1491  intbuf[2] = buf[pos+6] << decimation_shifts<SdrBits, InputBits>::pre16;
1492  intbuf[3] = buf[pos+7] << decimation_shifts<SdrBits, InputBits>::pre16;
1493  intbuf[4] = buf[pos+10] << decimation_shifts<SdrBits, InputBits>::pre16;
1494  intbuf[5] = buf[pos+11] << decimation_shifts<SdrBits, InputBits>::pre16;
1495  intbuf[6] = buf[pos+14] << decimation_shifts<SdrBits, InputBits>::pre16;
1496  intbuf[7] = buf[pos+15] << decimation_shifts<SdrBits, InputBits>::pre16;
1497  intbuf[8] = buf[pos+18] << decimation_shifts<SdrBits, InputBits>::pre16;
1498  intbuf[9] = buf[pos+19] << decimation_shifts<SdrBits, InputBits>::pre16;
1499  intbuf[10] = buf[pos+22] << decimation_shifts<SdrBits, InputBits>::pre16;
1500  intbuf[11] = buf[pos+23] << decimation_shifts<SdrBits, InputBits>::pre16;
1501  intbuf[12] = buf[pos+26] << decimation_shifts<SdrBits, InputBits>::pre16;
1502  intbuf[13] = buf[pos+27] << decimation_shifts<SdrBits, InputBits>::pre16;
1503  intbuf[14] = buf[pos+30] << decimation_shifts<SdrBits, InputBits>::pre16;
1504  intbuf[15] = buf[pos+31] << decimation_shifts<SdrBits, InputBits>::pre16;
1505 
1506  m_decimator2.myDecimate(
1507  buf[pos+0] << decimation_shifts<SdrBits, InputBits>::pre16,
1508  buf[pos+1] << decimation_shifts<SdrBits, InputBits>::pre16,
1509  &intbuf[0],
1510  &intbuf[1]);
1511  m_decimator2.myDecimate(
1512  buf[pos+4] << decimation_shifts<SdrBits, InputBits>::pre16,
1513  buf[pos+5] << decimation_shifts<SdrBits, InputBits>::pre16,
1514  &intbuf[2],
1515  &intbuf[3]);
1516  m_decimator2.myDecimate(
1517  buf[pos+8] << decimation_shifts<SdrBits, InputBits>::pre16,
1518  buf[pos+9] << decimation_shifts<SdrBits, InputBits>::pre16,
1519  &intbuf[4],
1520  &intbuf[5]);
1521  m_decimator2.myDecimate(
1522  buf[pos+12] << decimation_shifts<SdrBits, InputBits>::pre16,
1523  buf[pos+13] << decimation_shifts<SdrBits, InputBits>::pre16,
1524  &intbuf[6],
1525  &intbuf[7]);
1526  m_decimator2.myDecimate(
1527  buf[pos+16] << decimation_shifts<SdrBits, InputBits>::pre16,
1528  buf[pos+17] << decimation_shifts<SdrBits, InputBits>::pre16,
1529  &intbuf[8],
1530  &intbuf[9]);
1531  m_decimator2.myDecimate(
1532  buf[pos+20] << decimation_shifts<SdrBits, InputBits>::pre16,
1533  buf[pos+21] << decimation_shifts<SdrBits, InputBits>::pre16,
1534  &intbuf[10],
1535  &intbuf[11]);
1536  m_decimator2.myDecimate(
1537  buf[pos+24] << decimation_shifts<SdrBits, InputBits>::pre16,
1538  buf[pos+25] << decimation_shifts<SdrBits, InputBits>::pre16,
1539  &intbuf[12],
1540  &intbuf[13]);
1541  m_decimator2.myDecimate(
1542  buf[pos+28] << decimation_shifts<SdrBits, InputBits>::pre16,
1543  buf[pos+29] << decimation_shifts<SdrBits, InputBits>::pre16,
1544  &intbuf[14],
1545  &intbuf[15]);
1546 
1547  m_decimator4.myDecimate(
1548  intbuf[0],
1549  intbuf[1],
1550  &intbuf[2],
1551  &intbuf[3]);
1552  m_decimator4.myDecimate(
1553  intbuf[4],
1554  intbuf[5],
1555  &intbuf[6],
1556  &intbuf[7]);
1557  m_decimator4.myDecimate(
1558  intbuf[8],
1559  intbuf[9],
1560  &intbuf[10],
1561  &intbuf[11]);
1562  m_decimator4.myDecimate(
1563  intbuf[12],
1564  intbuf[13],
1565  &intbuf[14],
1566  &intbuf[15]);
1567 
1568  m_decimator8.myDecimate(
1569  intbuf[2],
1570  intbuf[3],
1571  &intbuf[6],
1572  &intbuf[7]);
1573  m_decimator8.myDecimate(
1574  intbuf[10],
1575  intbuf[11],
1576  &intbuf[14],
1577  &intbuf[15]);
1578 
1579  m_decimator16.myDecimate(
1580  intbuf[6],
1581  intbuf[7],
1582  &intbuf[14],
1583  &intbuf[15]);
1584 
1585  (**it).setReal(intbuf[14] >> decimation_shifts<SdrBits, InputBits>::post16);
1586  (**it).setImag(intbuf[15] >> decimation_shifts<SdrBits, InputBits>::post16);
1587  ++(*it);
1588  }
1589 }
1590 
1591 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
1592 void Decimators<StorageType, T, SdrBits, InputBits>::decimate32_inf(SampleVector::iterator* it, const T* buf, qint32 len)
1593 {
1594  StorageType buf2[64], buf4[32], buf8[16], buf16[8], buf32[4];
1595 
1596  for (int pos = 0; pos < len - 127; pos += 128)
1597  {
1598  m_decimator2.myDecimateInf(
1607  &buf2[0]);
1608 
1609  m_decimator2.myDecimateInf(
1618  &buf2[4]);
1619 
1620  m_decimator2.myDecimateInf(
1629  &buf2[8]);
1630 
1631  m_decimator2.myDecimateInf(
1640  &buf2[12]);
1641 
1642  m_decimator2.myDecimateInf(
1651  &buf2[16]);
1652 
1653  m_decimator2.myDecimateInf(
1662  &buf2[20]);
1663 
1664  m_decimator2.myDecimateInf(
1673  &buf2[24]);
1674 
1675  m_decimator2.myDecimateInf(
1684  &buf2[28]);
1685 
1686  m_decimator2.myDecimateInf(
1695  &buf2[32]);
1696 
1697  m_decimator2.myDecimateInf(
1706  &buf2[36]);
1707 
1708  m_decimator2.myDecimateInf(
1717  &buf2[40]);
1718 
1719  m_decimator2.myDecimateInf(
1728  &buf2[44]);
1729 
1730  m_decimator2.myDecimateInf(
1739  &buf2[48]);
1740 
1741  m_decimator2.myDecimateInf(
1750  &buf2[52]);
1751 
1752  m_decimator2.myDecimateInf(
1761  &buf2[56]);
1762 
1763  m_decimator2.myDecimateInf(
1772  &buf2[60]);
1773 
1774  m_decimator4.myDecimateSup(
1775  &buf2[0],
1776  &buf4[0]);
1777 
1778  m_decimator4.myDecimateSup(
1779  &buf2[8],
1780  &buf4[4]);
1781 
1782  m_decimator4.myDecimateSup(
1783  &buf2[16],
1784  &buf4[8]);
1785 
1786  m_decimator4.myDecimateSup(
1787  &buf2[24],
1788  &buf4[12]);
1789 
1790  m_decimator4.myDecimateSup(
1791  &buf2[32],
1792  &buf4[16]);
1793 
1794  m_decimator4.myDecimateSup(
1795  &buf2[40],
1796  &buf4[20]);
1797 
1798  m_decimator4.myDecimateSup(
1799  &buf2[48],
1800  &buf4[24]);
1801 
1802  m_decimator4.myDecimateSup(
1803  &buf2[56],
1804  &buf4[28]);
1805 
1806  m_decimator8.myDecimateSup(
1807  &buf4[0],
1808  &buf8[0]);
1809 
1810  m_decimator8.myDecimateSup(
1811  &buf4[8],
1812  &buf8[4]);
1813 
1814  m_decimator8.myDecimateSup(
1815  &buf4[16],
1816  &buf8[8]);
1817 
1818  m_decimator8.myDecimateSup(
1819  &buf4[24],
1820  &buf8[12]);
1821 
1822  m_decimator16.myDecimateSup(
1823  &buf8[0],
1824  &buf16[0]);
1825 
1826  m_decimator16.myDecimateSup(
1827  &buf8[8],
1828  &buf16[4]);
1829 
1830  m_decimator32.myDecimateCen(
1831  &buf16[0],
1832  &buf32[0]);
1833 
1834  (**it).setReal(buf32[0] >> decimation_shifts<SdrBits, InputBits>::post32);
1835  (**it).setImag(buf32[1] >> decimation_shifts<SdrBits, InputBits>::post32);
1836  ++(*it);
1837 
1838  (**it).setReal(buf32[2] >> decimation_shifts<SdrBits, InputBits>::post32);
1839  (**it).setImag(buf32[3] >> decimation_shifts<SdrBits, InputBits>::post32);
1840  ++(*it);
1841  }
1842 }
1843 
1844 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
1845 void Decimators<StorageType, T, SdrBits, InputBits>::decimate32_inf_txsync(SampleVector::iterator* it, const T* buf, qint32 len)
1846 {
1847  StorageType buf2[64], buf4[32], buf8[16], buf16[8], buf32[4];
1848 
1849  for (int pos = 0; pos < len - 127; pos += 128)
1850  {
1851  for (int i = 0; i < 16; i++)
1852  {
1853  m_decimator2.myDecimateInf(
1862  &buf2[4*i]);
1863  }
1864 
1865  for (int i = 0; i < 8; i++)
1866  {
1867  m_decimator4.myDecimateInf(
1868  &buf2[8*i],
1869  &buf4[4*i]);
1870  }
1871 
1872  for (int i = 0; i < 4; i++)
1873  {
1874  m_decimator8.myDecimateSup(
1875  &buf4[8*i],
1876  &buf8[4*i]);
1877  }
1878 
1879  m_decimator16.myDecimateInf(
1880  &buf8[0],
1881  &buf16[0]);
1882 
1883  m_decimator16.myDecimateInf(
1884  &buf8[8],
1885  &buf16[4]);
1886 
1887  m_decimator32.myDecimateSup(
1888  &buf16[0],
1889  &buf32[0]);
1890 
1891  (**it).setReal(buf32[0] >> decimation_shifts<SdrBits, InputBits>::post32);
1892  (**it).setImag(buf32[1] >> decimation_shifts<SdrBits, InputBits>::post32);
1893  ++(*it);
1894 
1895  (**it).setReal(buf32[2] >> decimation_shifts<SdrBits, InputBits>::post32);
1896  (**it).setImag(buf32[3] >> decimation_shifts<SdrBits, InputBits>::post32);
1897  ++(*it);
1898  }
1899 }
1900 
1901 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
1902 void Decimators<StorageType, T, SdrBits, InputBits>::decimate32_sup(SampleVector::iterator* it, const T* buf, qint32 len)
1903 {
1904  StorageType buf2[64], buf4[32], buf8[16], buf16[8], buf32[4];
1905 
1906  for (int pos = 0; pos < len - 127; pos += 128)
1907  {
1908  m_decimator2.myDecimateSup(
1917  &buf2[0]);
1918 
1919  m_decimator2.myDecimateSup(
1928  &buf2[4]);
1929 
1930  m_decimator2.myDecimateSup(
1939  &buf2[8]);
1940 
1941  m_decimator2.myDecimateSup(
1950  &buf2[12]);
1951 
1952  m_decimator2.myDecimateSup(
1961  &buf2[16]);
1962 
1963  m_decimator2.myDecimateSup(
1972  &buf2[20]);
1973 
1974  m_decimator2.myDecimateSup(
1983  &buf2[24]);
1984 
1985  m_decimator2.myDecimateSup(
1994  &buf2[28]);
1995 
1996  m_decimator2.myDecimateSup(
2005  &buf2[32]);
2006 
2007  m_decimator2.myDecimateSup(
2016  &buf2[36]);
2017 
2018  m_decimator2.myDecimateSup(
2027  &buf2[40]);
2028 
2029  m_decimator2.myDecimateSup(
2038  &buf2[44]);
2039 
2040  m_decimator2.myDecimateSup(
2049  &buf2[48]);
2050 
2051  m_decimator2.myDecimateSup(
2060  &buf2[52]);
2061 
2062  m_decimator2.myDecimateSup(
2071  &buf2[56]);
2072 
2073  m_decimator2.myDecimateSup(
2082  &buf2[60]);
2083 
2084  m_decimator4.myDecimateInf(
2085  &buf2[0],
2086  &buf4[0]);
2087 
2088  m_decimator4.myDecimateInf(
2089  &buf2[8],
2090  &buf4[4]);
2091 
2092  m_decimator4.myDecimateInf(
2093  &buf2[16],
2094  &buf4[8]);
2095 
2096  m_decimator4.myDecimateInf(
2097  &buf2[24],
2098  &buf4[12]);
2099 
2100  m_decimator4.myDecimateInf(
2101  &buf2[32],
2102  &buf4[16]);
2103 
2104  m_decimator4.myDecimateInf(
2105  &buf2[40],
2106  &buf4[20]);
2107 
2108  m_decimator4.myDecimateInf(
2109  &buf2[48],
2110  &buf4[24]);
2111 
2112  m_decimator4.myDecimateInf(
2113  &buf2[56],
2114  &buf4[28]);
2115 
2116  m_decimator8.myDecimateInf(
2117  &buf4[0],
2118  &buf8[0]);
2119 
2120  m_decimator8.myDecimateInf(
2121  &buf4[8],
2122  &buf8[4]);
2123 
2124  m_decimator8.myDecimateInf(
2125  &buf4[16],
2126  &buf8[8]);
2127 
2128  m_decimator8.myDecimateInf(
2129  &buf4[24],
2130  &buf8[12]);
2131 
2132  m_decimator16.myDecimateInf(
2133  &buf8[0],
2134  &buf16[0]);
2135 
2136  m_decimator16.myDecimateInf(
2137  &buf8[8],
2138  &buf16[4]);
2139 
2140  m_decimator32.myDecimateCen(
2141  &buf16[0],
2142  &buf32[0]);
2143 
2144  (**it).setReal(buf32[0] >> decimation_shifts<SdrBits, InputBits>::post32);
2145  (**it).setImag(buf32[1] >> decimation_shifts<SdrBits, InputBits>::post32);
2146  ++(*it);
2147 
2148  (**it).setReal(buf32[2] >> decimation_shifts<SdrBits, InputBits>::post32);
2149  (**it).setImag(buf32[3] >> decimation_shifts<SdrBits, InputBits>::post32);
2150  ++(*it);
2151  }
2152 }
2153 
2154 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
2155 void Decimators<StorageType, T, SdrBits, InputBits>::decimate32_sup_txsync(SampleVector::iterator* it, const T* buf, qint32 len)
2156 {
2157  StorageType buf2[64], buf4[32], buf8[16], buf16[8], buf32[4];
2158 
2159  for (int pos = 0; pos < len - 127; pos += 128)
2160  {
2161  for (int i = 0; i < 16; i++)
2162  {
2163  m_decimator2.myDecimateSup(
2172  &buf2[4*i]);
2173  }
2174 
2175  for (int i = 0; i < 8; i++)
2176  {
2177  m_decimator4.myDecimateSup(
2178  &buf2[8*i],
2179  &buf4[4*i]);
2180  }
2181 
2182  for (int i = 0; i < 4; i++)
2183  {
2184  m_decimator8.myDecimateInf(
2185  &buf4[8*i],
2186  &buf8[4*i]);
2187  }
2188 
2189  m_decimator16.myDecimateSup(
2190  &buf8[0],
2191  &buf16[0]);
2192 
2193  m_decimator16.myDecimateSup(
2194  &buf8[8],
2195  &buf16[4]);
2196 
2197  m_decimator32.myDecimateInf(
2198  &buf16[0],
2199  &buf32[0]);
2200 
2201  (**it).setReal(buf32[0] >> decimation_shifts<SdrBits, InputBits>::post32);
2202  (**it).setImag(buf32[1] >> decimation_shifts<SdrBits, InputBits>::post32);
2203  ++(*it);
2204 
2205  (**it).setReal(buf32[2] >> decimation_shifts<SdrBits, InputBits>::post32);
2206  (**it).setImag(buf32[3] >> decimation_shifts<SdrBits, InputBits>::post32);
2207  ++(*it);
2208  }
2209 }
2210 
2211 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
2212 void Decimators<StorageType, T, SdrBits, InputBits>::decimate32_cen(SampleVector::iterator* it, const T* buf, qint32 len)
2213 {
2214  StorageType intbuf[32];
2215 
2216  for (int pos = 0; pos < len - 63; pos += 64)
2217  {
2218  intbuf[0] = buf[pos+2] << decimation_shifts<SdrBits, InputBits>::pre32;
2219  intbuf[1] = buf[pos+3] << decimation_shifts<SdrBits, InputBits>::pre32;
2220  intbuf[2] = buf[pos+6] << decimation_shifts<SdrBits, InputBits>::pre32;
2221  intbuf[3] = buf[pos+7] << decimation_shifts<SdrBits, InputBits>::pre32;
2222  intbuf[4] = buf[pos+10] << decimation_shifts<SdrBits, InputBits>::pre32;
2223  intbuf[5] = buf[pos+11] << decimation_shifts<SdrBits, InputBits>::pre32;
2224  intbuf[6] = buf[pos+14] << decimation_shifts<SdrBits, InputBits>::pre32;
2225  intbuf[7] = buf[pos+15] << decimation_shifts<SdrBits, InputBits>::pre32;
2226  intbuf[8] = buf[pos+18] << decimation_shifts<SdrBits, InputBits>::pre32;
2227  intbuf[9] = buf[pos+19] << decimation_shifts<SdrBits, InputBits>::pre32;
2228  intbuf[10] = buf[pos+22] << decimation_shifts<SdrBits, InputBits>::pre32;
2229  intbuf[11] = buf[pos+23] << decimation_shifts<SdrBits, InputBits>::pre32;
2230  intbuf[12] = buf[pos+26] << decimation_shifts<SdrBits, InputBits>::pre32;
2231  intbuf[13] = buf[pos+27] << decimation_shifts<SdrBits, InputBits>::pre32;
2232  intbuf[14] = buf[pos+30] << decimation_shifts<SdrBits, InputBits>::pre32;
2233  intbuf[15] = buf[pos+31] << decimation_shifts<SdrBits, InputBits>::pre32;
2234  intbuf[16] = buf[pos+34] << decimation_shifts<SdrBits, InputBits>::pre32;
2235  intbuf[17] = buf[pos+35] << decimation_shifts<SdrBits, InputBits>::pre32;
2236  intbuf[18] = buf[pos+38] << decimation_shifts<SdrBits, InputBits>::pre32;
2237  intbuf[19] = buf[pos+39] << decimation_shifts<SdrBits, InputBits>::pre32;
2238  intbuf[20] = buf[pos+42] << decimation_shifts<SdrBits, InputBits>::pre32;
2239  intbuf[21] = buf[pos+43] << decimation_shifts<SdrBits, InputBits>::pre32;
2240  intbuf[22] = buf[pos+46] << decimation_shifts<SdrBits, InputBits>::pre32;
2241  intbuf[23] = buf[pos+47] << decimation_shifts<SdrBits, InputBits>::pre32;
2242  intbuf[24] = buf[pos+50] << decimation_shifts<SdrBits, InputBits>::pre32;
2243  intbuf[25] = buf[pos+51] << decimation_shifts<SdrBits, InputBits>::pre32;
2244  intbuf[26] = buf[pos+54] << decimation_shifts<SdrBits, InputBits>::pre32;
2245  intbuf[27] = buf[pos+55] << decimation_shifts<SdrBits, InputBits>::pre32;
2246  intbuf[28] = buf[pos+58] << decimation_shifts<SdrBits, InputBits>::pre32;
2247  intbuf[29] = buf[pos+59] << decimation_shifts<SdrBits, InputBits>::pre32;
2248  intbuf[30] = buf[pos+62] << decimation_shifts<SdrBits, InputBits>::pre32;
2249  intbuf[31] = buf[pos+63] << decimation_shifts<SdrBits, InputBits>::pre32;
2250 
2251  m_decimator2.myDecimate(
2252  buf[pos+0] << decimation_shifts<SdrBits, InputBits>::pre32,
2253  buf[pos+1] << decimation_shifts<SdrBits, InputBits>::pre32,
2254  &intbuf[0],
2255  &intbuf[1]);
2256  m_decimator2.myDecimate(
2257  buf[pos+4] << decimation_shifts<SdrBits, InputBits>::pre32,
2258  buf[pos+5] << decimation_shifts<SdrBits, InputBits>::pre32,
2259  &intbuf[2],
2260  &intbuf[3]);
2261  m_decimator2.myDecimate(
2262  buf[pos+8] << decimation_shifts<SdrBits, InputBits>::pre32,
2263  buf[pos+9] << decimation_shifts<SdrBits, InputBits>::pre32,
2264  &intbuf[4],
2265  &intbuf[5]);
2266  m_decimator2.myDecimate(
2267  buf[pos+12] << decimation_shifts<SdrBits, InputBits>::pre32,
2268  buf[pos+13] << decimation_shifts<SdrBits, InputBits>::pre32,
2269  &intbuf[6],
2270  &intbuf[7]);
2271  m_decimator2.myDecimate(
2272  buf[pos+16] << decimation_shifts<SdrBits, InputBits>::pre32,
2273  buf[pos+17] << decimation_shifts<SdrBits, InputBits>::pre32,
2274  &intbuf[8],
2275  &intbuf[9]);
2276  m_decimator2.myDecimate(
2277  buf[pos+20] << decimation_shifts<SdrBits, InputBits>::pre32,
2278  buf[pos+21] << decimation_shifts<SdrBits, InputBits>::pre32,
2279  &intbuf[10],
2280  &intbuf[11]);
2281  m_decimator2.myDecimate(
2282  buf[pos+24] << decimation_shifts<SdrBits, InputBits>::pre32,
2283  buf[pos+25] << decimation_shifts<SdrBits, InputBits>::pre32,
2284  &intbuf[12],
2285  &intbuf[13]);
2286  m_decimator2.myDecimate(
2287  buf[pos+28] << decimation_shifts<SdrBits, InputBits>::pre32,
2288  buf[pos+29] << decimation_shifts<SdrBits, InputBits>::pre32,
2289  &intbuf[14],
2290  &intbuf[15]);
2291  m_decimator2.myDecimate(
2292  buf[pos+32] << decimation_shifts<SdrBits, InputBits>::pre32,
2293  buf[pos+33] << decimation_shifts<SdrBits, InputBits>::pre32,
2294  &intbuf[16],
2295  &intbuf[17]);
2296  m_decimator2.myDecimate(
2297  buf[pos+36] << decimation_shifts<SdrBits, InputBits>::pre32,
2298  buf[pos+37] << decimation_shifts<SdrBits, InputBits>::pre32,
2299  &intbuf[18],
2300  &intbuf[19]);
2301  m_decimator2.myDecimate(
2302  buf[pos+40] << decimation_shifts<SdrBits, InputBits>::pre32,
2303  buf[pos+41] << decimation_shifts<SdrBits, InputBits>::pre32,
2304  &intbuf[20],
2305  &intbuf[21]);
2306  m_decimator2.myDecimate(
2307  buf[pos+44] << decimation_shifts<SdrBits, InputBits>::pre32,
2308  buf[pos+45] << decimation_shifts<SdrBits, InputBits>::pre32,
2309  &intbuf[22],
2310  &intbuf[23]);
2311  m_decimator2.myDecimate(
2312  buf[pos+48] << decimation_shifts<SdrBits, InputBits>::pre32,
2313  buf[pos+49] << decimation_shifts<SdrBits, InputBits>::pre32,
2314  &intbuf[24],
2315  &intbuf[25]);
2316  m_decimator2.myDecimate(
2317  buf[pos+52] << decimation_shifts<SdrBits, InputBits>::pre32,
2318  buf[pos+53] << decimation_shifts<SdrBits, InputBits>::pre32,
2319  &intbuf[26],
2320  &intbuf[27]);
2321  m_decimator2.myDecimate(
2322  buf[pos+56] << decimation_shifts<SdrBits, InputBits>::pre32,
2323  buf[pos+57] << decimation_shifts<SdrBits, InputBits>::pre32,
2324  &intbuf[28],
2325  &intbuf[29]);
2326  m_decimator2.myDecimate(
2327  buf[pos+60] << decimation_shifts<SdrBits, InputBits>::pre32,
2328  buf[pos+61] << decimation_shifts<SdrBits, InputBits>::pre32,
2329  &intbuf[30],
2330  &intbuf[31]);
2331 
2332  m_decimator4.myDecimate(
2333  intbuf[0],
2334  intbuf[1],
2335  &intbuf[2],
2336  &intbuf[3]);
2337  m_decimator4.myDecimate(
2338  intbuf[4],
2339  intbuf[5],
2340  &intbuf[6],
2341  &intbuf[7]);
2342  m_decimator4.myDecimate(
2343  intbuf[8],
2344  intbuf[9],
2345  &intbuf[10],
2346  &intbuf[11]);
2347  m_decimator4.myDecimate(
2348  intbuf[12],
2349  intbuf[13],
2350  &intbuf[14],
2351  &intbuf[15]);
2352  m_decimator4.myDecimate(
2353  intbuf[16],
2354  intbuf[17],
2355  &intbuf[18],
2356  &intbuf[19]);
2357  m_decimator4.myDecimate(
2358  intbuf[20],
2359  intbuf[21],
2360  &intbuf[22],
2361  &intbuf[23]);
2362  m_decimator4.myDecimate(
2363  intbuf[24],
2364  intbuf[25],
2365  &intbuf[26],
2366  &intbuf[27]);
2367  m_decimator4.myDecimate(
2368  intbuf[28],
2369  intbuf[29],
2370  &intbuf[30],
2371  &intbuf[31]);
2372 
2373  m_decimator8.myDecimate(
2374  intbuf[2],
2375  intbuf[3],
2376  &intbuf[6],
2377  &intbuf[7]);
2378  m_decimator8.myDecimate(
2379  intbuf[10],
2380  intbuf[11],
2381  &intbuf[14],
2382  &intbuf[15]);
2383  m_decimator8.myDecimate(
2384  intbuf[18],
2385  intbuf[19],
2386  &intbuf[22],
2387  &intbuf[23]);
2388  m_decimator8.myDecimate(
2389  intbuf[26],
2390  intbuf[27],
2391  &intbuf[30],
2392  &intbuf[31]);
2393 
2394  m_decimator16.myDecimate(
2395  intbuf[6],
2396  intbuf[7],
2397  &intbuf[14],
2398  &intbuf[15]);
2399  m_decimator16.myDecimate(
2400  intbuf[22],
2401  intbuf[23],
2402  &intbuf[30],
2403  &intbuf[31]);
2404 
2405  m_decimator32.myDecimate(
2406  intbuf[14],
2407  intbuf[15],
2408  &intbuf[30],
2409  &intbuf[31]);
2410 
2411  (**it).setReal(intbuf[30] >> decimation_shifts<SdrBits, InputBits>::post32);
2412  (**it).setImag(intbuf[31] >> decimation_shifts<SdrBits, InputBits>::post32);
2413  ++(*it);
2414  }
2415 }
2416 
2417 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
2418 void Decimators<StorageType, T, SdrBits, InputBits>::decimate64_inf(SampleVector::iterator* it, const T* buf, qint32 len)
2419 {
2420  StorageType buf2[128], buf4[64], buf8[32], buf16[16], buf32[8], buf64[4];
2421 
2422  for (int pos = 0; pos < len - 255; pos += 256)
2423  {
2424  m_decimator2.myDecimateInf(
2433  &buf2[0]);
2434 
2435  m_decimator2.myDecimateInf(
2444  &buf2[4]);
2445 
2446  m_decimator2.myDecimateInf(
2455  &buf2[8]);
2456 
2457  m_decimator2.myDecimateInf(
2466  &buf2[12]);
2467 
2468  m_decimator2.myDecimateInf(
2477  &buf2[16]);
2478 
2479  m_decimator2.myDecimateInf(
2488  &buf2[20]);
2489 
2490  m_decimator2.myDecimateInf(
2499  &buf2[24]);
2500 
2501  m_decimator2.myDecimateInf(
2510  &buf2[28]);
2511 
2512  m_decimator2.myDecimateInf(
2521  &buf2[32]);
2522 
2523  m_decimator2.myDecimateInf(
2532  &buf2[36]);
2533 
2534  m_decimator2.myDecimateInf(
2543  &buf2[40]);
2544 
2545  m_decimator2.myDecimateInf(
2554  &buf2[44]);
2555 
2556  m_decimator2.myDecimateInf(
2565  &buf2[48]);
2566 
2567  m_decimator2.myDecimateInf(
2576  &buf2[52]);
2577 
2578  m_decimator2.myDecimateInf(
2587  &buf2[56]);
2588 
2589  m_decimator2.myDecimateInf(
2598  &buf2[60]);
2599 
2600  m_decimator2.myDecimateInf(
2609  &buf2[64]);
2610 
2611  m_decimator2.myDecimateInf(
2620  &buf2[68]);
2621 
2622  m_decimator2.myDecimateInf(
2631  &buf2[72]);
2632 
2633  m_decimator2.myDecimateInf(
2642  &buf2[76]);
2643 
2644  m_decimator2.myDecimateInf(
2653  &buf2[80]);
2654 
2655  m_decimator2.myDecimateInf(
2664  &buf2[84]);
2665 
2666  m_decimator2.myDecimateInf(
2675  &buf2[88]);
2676 
2677  m_decimator2.myDecimateInf(
2686  &buf2[92]);
2687 
2688  m_decimator2.myDecimateInf(
2697  &buf2[96]);
2698 
2699  m_decimator2.myDecimateInf(
2708  &buf2[100]);
2709 
2710  m_decimator2.myDecimateInf(
2719  &buf2[104]);
2720 
2721  m_decimator2.myDecimateInf(
2730  &buf2[108]);
2731 
2732  m_decimator2.myDecimateInf(
2741  &buf2[112]);
2742 
2743  m_decimator2.myDecimateInf(
2752  &buf2[116]);
2753 
2754  m_decimator2.myDecimateInf(
2763  &buf2[120]);
2764 
2765  m_decimator2.myDecimateInf(
2774  &buf2[124]);
2775 
2776  m_decimator4.myDecimateSup(
2777  &buf2[0],
2778  &buf4[0]);
2779 
2780  m_decimator4.myDecimateSup(
2781  &buf2[8],
2782  &buf4[4]);
2783 
2784  m_decimator4.myDecimateSup(
2785  &buf2[16],
2786  &buf4[8]);
2787 
2788  m_decimator4.myDecimateSup(
2789  &buf2[24],
2790  &buf4[12]);
2791 
2792  m_decimator4.myDecimateSup(
2793  &buf2[32],
2794  &buf4[16]);
2795 
2796  m_decimator4.myDecimateSup(
2797  &buf2[40],
2798  &buf4[20]);
2799 
2800  m_decimator4.myDecimateSup(
2801  &buf2[48],
2802  &buf4[24]);
2803 
2804  m_decimator4.myDecimateSup(
2805  &buf2[56],
2806  &buf4[28]);
2807 
2808  m_decimator4.myDecimateSup(
2809  &buf2[64],
2810  &buf4[32]);
2811 
2812  m_decimator4.myDecimateSup(
2813  &buf2[72],
2814  &buf4[36]);
2815 
2816  m_decimator4.myDecimateSup(
2817  &buf2[80],
2818  &buf4[40]);
2819 
2820  m_decimator4.myDecimateSup(
2821  &buf2[88],
2822  &buf4[44]);
2823 
2824  m_decimator4.myDecimateSup(
2825  &buf2[96],
2826  &buf4[48]);
2827 
2828  m_decimator4.myDecimateSup(
2829  &buf2[104],
2830  &buf4[52]);
2831 
2832  m_decimator4.myDecimateSup(
2833  &buf2[112],
2834  &buf4[56]);
2835 
2836  m_decimator4.myDecimateSup(
2837  &buf2[120],
2838  &buf4[60]);
2839 
2840  m_decimator8.myDecimateSup(
2841  &buf4[0],
2842  &buf8[0]);
2843 
2844  m_decimator8.myDecimateSup(
2845  &buf4[8],
2846  &buf8[4]);
2847 
2848  m_decimator8.myDecimateSup(
2849  &buf4[16],
2850  &buf8[8]);
2851 
2852  m_decimator8.myDecimateSup(
2853  &buf4[24],
2854  &buf8[12]);
2855 
2856  m_decimator8.myDecimateSup(
2857  &buf4[32],
2858  &buf8[16]);
2859 
2860  m_decimator8.myDecimateSup(
2861  &buf4[40],
2862  &buf8[20]);
2863 
2864  m_decimator8.myDecimateSup(
2865  &buf4[48],
2866  &buf8[24]);
2867 
2868  m_decimator8.myDecimateSup(
2869  &buf4[56],
2870  &buf8[28]);
2871 
2872  m_decimator16.myDecimateSup(
2873  &buf8[0],
2874  &buf16[0]);
2875 
2876  m_decimator16.myDecimateSup(
2877  &buf8[8],
2878  &buf16[4]);
2879 
2880  m_decimator16.myDecimateSup(
2881  &buf8[16],
2882  &buf16[8]);
2883 
2884  m_decimator16.myDecimateSup(
2885  &buf8[24],
2886  &buf16[12]);
2887 
2888  m_decimator32.myDecimateSup(
2889  &buf16[0],
2890  &buf32[0]);
2891 
2892  m_decimator32.myDecimateSup(
2893  &buf16[8],
2894  &buf32[4]);
2895 
2896  m_decimator64.myDecimateCen(
2897  &buf32[0],
2898  &buf64[0]);
2899 
2900  (**it).setReal(buf64[0] >> decimation_shifts<SdrBits, InputBits>::post64);
2901  (**it).setImag(buf64[1] >> decimation_shifts<SdrBits, InputBits>::post64);
2902  ++(*it);
2903 
2904  (**it).setReal(buf64[2] >> decimation_shifts<SdrBits, InputBits>::post64);
2905  (**it).setImag(buf64[3] >> decimation_shifts<SdrBits, InputBits>::post64);
2906  ++(*it);
2907  }
2908 }
2909 
2910 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
2911 void Decimators<StorageType, T, SdrBits, InputBits>::decimate64_inf_txsync(SampleVector::iterator* it, const T* buf, qint32 len)
2912 {
2913  StorageType buf2[128], buf4[64], buf8[32], buf16[16], buf32[8], buf64[4];
2914 
2915  for (int pos = 0; pos < len - 255; pos += 256)
2916  {
2917  for (int i = 0; i < 32; i++)
2918  {
2919  m_decimator2.myDecimateInf(
2928  &buf2[4*i]);
2929  }
2930 
2931  for (int i = 0; i < 16; i++)
2932  {
2933  m_decimator4.myDecimateSup(
2934  &buf2[8*i],
2935  &buf4[4*i]);
2936  }
2937 
2938  for (int i = 0; i < 8; i++)
2939  {
2940  m_decimator8.myDecimateInf(
2941  &buf4[8*i],
2942  &buf8[4*i]);
2943  }
2944 
2945  for (int i = 0; i < 4; i++)
2946  {
2947  m_decimator16.myDecimateSup(
2948  &buf8[8*i],
2949  &buf16[4*i]);
2950  }
2951 
2952  m_decimator32.myDecimateInf(
2953  &buf16[0],
2954  &buf32[0]);
2955 
2956  m_decimator32.myDecimateInf(
2957  &buf16[8],
2958  &buf32[4]);
2959 
2960  m_decimator64.myDecimateSup(
2961  &buf32[0],
2962  &buf64[0]);
2963 
2964  (**it).setReal(buf64[0] >> decimation_shifts<SdrBits, InputBits>::post64);
2965  (**it).setImag(buf64[1] >> decimation_shifts<SdrBits, InputBits>::post64);
2966  ++(*it);
2967 
2968  (**it).setReal(buf64[2] >> decimation_shifts<SdrBits, InputBits>::post64);
2969  (**it).setImag(buf64[3] >> decimation_shifts<SdrBits, InputBits>::post64);
2970  ++(*it);
2971  }
2972 }
2973 
2974 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
2975 void Decimators<StorageType, T, SdrBits, InputBits>::decimate64_sup(SampleVector::iterator* it, const T* buf, qint32 len)
2976 {
2977  StorageType buf2[128], buf4[64], buf8[32], buf16[16], buf32[8], buf64[4];
2978 
2979  for (int pos = 0; pos < len - 255; pos += 256)
2980  {
2981  for (int i = 0; i < 32; i++)
2982  {
2983  m_decimator2.myDecimateInf(
2992  &buf2[4*i]);
2993  }
2994 
2995  for (int i = 0; i < 16; i++)
2996  {
2997  m_decimator4.myDecimateSup(
2998  &buf2[8*i],
2999  &buf4[4*i]);
3000  }
3001 
3002  for (int i = 0; i < 8; i++)
3003  {
3004  m_decimator8.myDecimateInf(
3005  &buf4[8*i],
3006  &buf8[4*i]);
3007  }
3008 
3009  for (int i = 0; i < 4; i++)
3010  {
3011  m_decimator16.myDecimateSup(
3012  &buf8[8*i],
3013  &buf16[4*i]);
3014  }
3015 
3016  m_decimator32.myDecimateInf(
3017  &buf16[0],
3018  &buf32[0]);
3019 
3020  m_decimator32.myDecimateInf(
3021  &buf16[8],
3022  &buf32[4]);
3023 
3024  m_decimator64.myDecimateSup(
3025  &buf32[0],
3026  &buf64[0]);
3027 
3028 
3029  (**it).setReal(buf64[0] >> decimation_shifts<SdrBits, InputBits>::post64);
3030  (**it).setImag(buf64[1] >> decimation_shifts<SdrBits, InputBits>::post64);
3031  ++(*it);
3032 
3033  (**it).setReal(buf64[2] >> decimation_shifts<SdrBits, InputBits>::post64);
3034  (**it).setImag(buf64[3] >> decimation_shifts<SdrBits, InputBits>::post64);
3035  ++(*it);
3036  }
3037 }
3038 
3039 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
3040 void Decimators<StorageType, T, SdrBits, InputBits>::decimate64_cen(SampleVector::iterator* it, const T* buf, qint32 len)
3041 {
3042  StorageType intbuf[64];
3043 
3044  for (int pos = 0; pos < len - 127; pos += 128)
3045  {
3046  intbuf[0] = buf[pos+2] << decimation_shifts<SdrBits, InputBits>::pre64;
3047  intbuf[1] = buf[pos+3] << decimation_shifts<SdrBits, InputBits>::pre64;
3048  intbuf[2] = buf[pos+6] << decimation_shifts<SdrBits, InputBits>::pre64;
3049  intbuf[3] = buf[pos+7] << decimation_shifts<SdrBits, InputBits>::pre64;
3050  intbuf[4] = buf[pos+10] << decimation_shifts<SdrBits, InputBits>::pre64;
3051  intbuf[5] = buf[pos+11] << decimation_shifts<SdrBits, InputBits>::pre64;
3052  intbuf[6] = buf[pos+14] << decimation_shifts<SdrBits, InputBits>::pre64;
3053  intbuf[7] = buf[pos+15] << decimation_shifts<SdrBits, InputBits>::pre64;
3054  intbuf[8] = buf[pos+18] << decimation_shifts<SdrBits, InputBits>::pre64;
3055  intbuf[9] = buf[pos+19] << decimation_shifts<SdrBits, InputBits>::pre64;
3056  intbuf[10] = buf[pos+22] << decimation_shifts<SdrBits, InputBits>::pre64;
3057  intbuf[11] = buf[pos+23] << decimation_shifts<SdrBits, InputBits>::pre64;
3058  intbuf[12] = buf[pos+26] << decimation_shifts<SdrBits, InputBits>::pre64;
3059  intbuf[13] = buf[pos+27] << decimation_shifts<SdrBits, InputBits>::pre64;
3060  intbuf[14] = buf[pos+30] << decimation_shifts<SdrBits, InputBits>::pre64;
3061  intbuf[15] = buf[pos+31] << decimation_shifts<SdrBits, InputBits>::pre64;
3062  intbuf[16] = buf[pos+34] << decimation_shifts<SdrBits, InputBits>::pre64;
3063  intbuf[17] = buf[pos+35] << decimation_shifts<SdrBits, InputBits>::pre64;
3064  intbuf[18] = buf[pos+38] << decimation_shifts<SdrBits, InputBits>::pre64;
3065  intbuf[19] = buf[pos+39] << decimation_shifts<SdrBits, InputBits>::pre64;
3066  intbuf[20] = buf[pos+42] << decimation_shifts<SdrBits, InputBits>::pre64;
3067  intbuf[21] = buf[pos+43] << decimation_shifts<SdrBits, InputBits>::pre64;
3068  intbuf[22] = buf[pos+46] << decimation_shifts<SdrBits, InputBits>::pre64;
3069  intbuf[23] = buf[pos+47] << decimation_shifts<SdrBits, InputBits>::pre64;
3070  intbuf[24] = buf[pos+50] << decimation_shifts<SdrBits, InputBits>::pre64;
3071  intbuf[25] = buf[pos+51] << decimation_shifts<SdrBits, InputBits>::pre64;
3072  intbuf[26] = buf[pos+54] << decimation_shifts<SdrBits, InputBits>::pre64;
3073  intbuf[27] = buf[pos+55] << decimation_shifts<SdrBits, InputBits>::pre64;
3074  intbuf[28] = buf[pos+58] << decimation_shifts<SdrBits, InputBits>::pre64;
3075  intbuf[29] = buf[pos+59] << decimation_shifts<SdrBits, InputBits>::pre64;
3076  intbuf[30] = buf[pos+62] << decimation_shifts<SdrBits, InputBits>::pre64;
3077  intbuf[31] = buf[pos+63] << decimation_shifts<SdrBits, InputBits>::pre64;
3078 
3079  intbuf[32] = buf[pos+66] << decimation_shifts<SdrBits, InputBits>::pre64;
3080  intbuf[33] = buf[pos+67] << decimation_shifts<SdrBits, InputBits>::pre64;
3081  intbuf[34] = buf[pos+70] << decimation_shifts<SdrBits, InputBits>::pre64;
3082  intbuf[35] = buf[pos+71] << decimation_shifts<SdrBits, InputBits>::pre64;
3083  intbuf[36] = buf[pos+74] << decimation_shifts<SdrBits, InputBits>::pre64;
3084  intbuf[37] = buf[pos+75] << decimation_shifts<SdrBits, InputBits>::pre64;
3085  intbuf[38] = buf[pos+78] << decimation_shifts<SdrBits, InputBits>::pre64;
3086  intbuf[39] = buf[pos+79] << decimation_shifts<SdrBits, InputBits>::pre64;
3087  intbuf[40] = buf[pos+82] << decimation_shifts<SdrBits, InputBits>::pre64;
3088  intbuf[41] = buf[pos+83] << decimation_shifts<SdrBits, InputBits>::pre64;
3089  intbuf[42] = buf[pos+86] << decimation_shifts<SdrBits, InputBits>::pre64;
3090  intbuf[43] = buf[pos+87] << decimation_shifts<SdrBits, InputBits>::pre64;
3091  intbuf[44] = buf[pos+90] << decimation_shifts<SdrBits, InputBits>::pre64;
3092  intbuf[45] = buf[pos+91] << decimation_shifts<SdrBits, InputBits>::pre64;
3093  intbuf[46] = buf[pos+94] << decimation_shifts<SdrBits, InputBits>::pre64;
3094  intbuf[47] = buf[pos+95] << decimation_shifts<SdrBits, InputBits>::pre64;
3095  intbuf[48] = buf[pos+98] << decimation_shifts<SdrBits, InputBits>::pre64;
3096  intbuf[49] = buf[pos+99] << decimation_shifts<SdrBits, InputBits>::pre64;
3097  intbuf[50] = buf[pos+102] << decimation_shifts<SdrBits, InputBits>::pre64;
3098  intbuf[51] = buf[pos+103] << decimation_shifts<SdrBits, InputBits>::pre64;
3099  intbuf[52] = buf[pos+106] << decimation_shifts<SdrBits, InputBits>::pre64;
3100  intbuf[53] = buf[pos+107] << decimation_shifts<SdrBits, InputBits>::pre64;
3101  intbuf[54] = buf[pos+110] << decimation_shifts<SdrBits, InputBits>::pre64;
3102  intbuf[55] = buf[pos+111] << decimation_shifts<SdrBits, InputBits>::pre64;
3103  intbuf[56] = buf[pos+114] << decimation_shifts<SdrBits, InputBits>::pre64;
3104  intbuf[57] = buf[pos+115] << decimation_shifts<SdrBits, InputBits>::pre64;
3105  intbuf[58] = buf[pos+118] << decimation_shifts<SdrBits, InputBits>::pre64;
3106  intbuf[59] = buf[pos+119] << decimation_shifts<SdrBits, InputBits>::pre64;
3107  intbuf[60] = buf[pos+122] << decimation_shifts<SdrBits, InputBits>::pre64;
3108  intbuf[61] = buf[pos+123] << decimation_shifts<SdrBits, InputBits>::pre64;
3109  intbuf[62] = buf[pos+126] << decimation_shifts<SdrBits, InputBits>::pre64;
3110  intbuf[63] = buf[pos+127] << decimation_shifts<SdrBits, InputBits>::pre64;
3111 
3112  m_decimator2.myDecimate(
3113  buf[pos+0] << decimation_shifts<SdrBits, InputBits>::pre64,
3114  buf[pos+1] << decimation_shifts<SdrBits, InputBits>::pre64,
3115  &intbuf[0],
3116  &intbuf[1]);
3117  m_decimator2.myDecimate(
3118  buf[pos+4] << decimation_shifts<SdrBits, InputBits>::pre64,
3119  buf[pos+5] << decimation_shifts<SdrBits, InputBits>::pre64,
3120  &intbuf[2],
3121  &intbuf[3]);
3122  m_decimator2.myDecimate(
3123  buf[pos+8] << decimation_shifts<SdrBits, InputBits>::pre64,
3124  buf[pos+9] << decimation_shifts<SdrBits, InputBits>::pre64,
3125  &intbuf[4],
3126  &intbuf[5]);
3127  m_decimator2.myDecimate(
3128  buf[pos+12] << decimation_shifts<SdrBits, InputBits>::pre64,
3129  buf[pos+13] << decimation_shifts<SdrBits, InputBits>::pre64,
3130  &intbuf[6],
3131  &intbuf[7]);
3132  m_decimator2.myDecimate(
3133  buf[pos+16] << decimation_shifts<SdrBits, InputBits>::pre64,
3134  buf[pos+17] << decimation_shifts<SdrBits, InputBits>::pre64,
3135  &intbuf[8],
3136  &intbuf[9]);
3137  m_decimator2.myDecimate(
3138  buf[pos+20] << decimation_shifts<SdrBits, InputBits>::pre64,
3139  buf[pos+21] << decimation_shifts<SdrBits, InputBits>::pre64,
3140  &intbuf[10],
3141  &intbuf[11]);
3142  m_decimator2.myDecimate(
3143  buf[pos+24] << decimation_shifts<SdrBits, InputBits>::pre64,
3144  buf[pos+25] << decimation_shifts<SdrBits, InputBits>::pre64,
3145  &intbuf[12],
3146  &intbuf[13]);
3147  m_decimator2.myDecimate(
3148  buf[pos+28] << decimation_shifts<SdrBits, InputBits>::pre64,
3149  buf[pos+29] << decimation_shifts<SdrBits, InputBits>::pre64,
3150  &intbuf[14],
3151  &intbuf[15]);
3152  m_decimator2.myDecimate(
3153  buf[pos+32] << decimation_shifts<SdrBits, InputBits>::pre64,
3154  buf[pos+33] << decimation_shifts<SdrBits, InputBits>::pre64,
3155  &intbuf[16],
3156  &intbuf[17]);
3157  m_decimator2.myDecimate(
3158  buf[pos+36] << decimation_shifts<SdrBits, InputBits>::pre64,
3159  buf[pos+37] << decimation_shifts<SdrBits, InputBits>::pre64,
3160  &intbuf[18],
3161  &intbuf[19]);
3162  m_decimator2.myDecimate(
3163  buf[pos+40] << decimation_shifts<SdrBits, InputBits>::pre64,
3164  buf[pos+41] << decimation_shifts<SdrBits, InputBits>::pre64,
3165  &intbuf[20],
3166  &intbuf[21]);
3167  m_decimator2.myDecimate(
3168  buf[pos+44] << decimation_shifts<SdrBits, InputBits>::pre64,
3169  buf[pos+45] << decimation_shifts<SdrBits, InputBits>::pre64,
3170  &intbuf[22],
3171  &intbuf[23]);
3172  m_decimator2.myDecimate(
3173  buf[pos+48] << decimation_shifts<SdrBits, InputBits>::pre64,
3174  buf[pos+49] << decimation_shifts<SdrBits, InputBits>::pre64,
3175  &intbuf[24],
3176  &intbuf[25]);
3177  m_decimator2.myDecimate(
3178  buf[pos+52] << decimation_shifts<SdrBits, InputBits>::pre64,
3179  buf[pos+53] << decimation_shifts<SdrBits, InputBits>::pre64,
3180  &intbuf[26],
3181  &intbuf[27]);
3182  m_decimator2.myDecimate(
3183  buf[pos+56] << decimation_shifts<SdrBits, InputBits>::pre64,
3184  buf[pos+57] << decimation_shifts<SdrBits, InputBits>::pre64,
3185  &intbuf[28],
3186  &intbuf[29]);
3187  m_decimator2.myDecimate(
3188  buf[pos+60] << decimation_shifts<SdrBits, InputBits>::pre64,
3189  buf[pos+61] << decimation_shifts<SdrBits, InputBits>::pre64,
3190  &intbuf[30],
3191  &intbuf[31]);
3192  m_decimator2.myDecimate(
3193  buf[pos+64] << decimation_shifts<SdrBits, InputBits>::pre64,
3194  buf[pos+65] << decimation_shifts<SdrBits, InputBits>::pre64,
3195  &intbuf[32],
3196  &intbuf[33]);
3197  m_decimator2.myDecimate(
3198  buf[pos+68] << decimation_shifts<SdrBits, InputBits>::pre64,
3199  buf[pos+69] << decimation_shifts<SdrBits, InputBits>::pre64,
3200  &intbuf[34],
3201  &intbuf[35]);
3202  m_decimator2.myDecimate(
3203  buf[pos+72] << decimation_shifts<SdrBits, InputBits>::pre64,
3204  buf[pos+73] << decimation_shifts<SdrBits, InputBits>::pre64,
3205  &intbuf[36],
3206  &intbuf[37]);
3207  m_decimator2.myDecimate(
3208  buf[pos+76] << decimation_shifts<SdrBits, InputBits>::pre64,
3209  buf[pos+77] << decimation_shifts<SdrBits, InputBits>::pre64,
3210  &intbuf[38],
3211  &intbuf[39]);
3212  m_decimator2.myDecimate(
3213  buf[pos+80] << decimation_shifts<SdrBits, InputBits>::pre64,
3214  buf[pos+81] << decimation_shifts<SdrBits, InputBits>::pre64,
3215  &intbuf[40],
3216  &intbuf[41]);
3217  m_decimator2.myDecimate(
3218  buf[pos+84] << decimation_shifts<SdrBits, InputBits>::pre64,
3219  buf[pos+85] << decimation_shifts<SdrBits, InputBits>::pre64,
3220  &intbuf[42],
3221  &intbuf[43]);
3222  m_decimator2.myDecimate(
3223  buf[pos+88] << decimation_shifts<SdrBits, InputBits>::pre64,
3224  buf[pos+89] << decimation_shifts<SdrBits, InputBits>::pre64,
3225  &intbuf[44],
3226  &intbuf[45]);
3227  m_decimator2.myDecimate(
3228  buf[pos+92] << decimation_shifts<SdrBits, InputBits>::pre64,
3229  buf[pos+93] << decimation_shifts<SdrBits, InputBits>::pre64,
3230  &intbuf[46],
3231  &intbuf[47]);
3232  m_decimator2.myDecimate(
3233  buf[pos+96] << decimation_shifts<SdrBits, InputBits>::pre64,
3234  buf[pos+97] << decimation_shifts<SdrBits, InputBits>::pre64,
3235  &intbuf[48],
3236  &intbuf[49]);
3237  m_decimator2.myDecimate(
3238  buf[pos+100] << decimation_shifts<SdrBits, InputBits>::pre64,
3239  buf[pos+101] << decimation_shifts<SdrBits, InputBits>::pre64,
3240  &intbuf[50],
3241  &intbuf[51]);
3242  m_decimator2.myDecimate(
3243  buf[pos+104] << decimation_shifts<SdrBits, InputBits>::pre64,
3244  buf[pos+105] << decimation_shifts<SdrBits, InputBits>::pre64,
3245  &intbuf[52],
3246  &intbuf[53]);
3247  m_decimator2.myDecimate(
3248  buf[pos+108] << decimation_shifts<SdrBits, InputBits>::pre64,
3249  buf[pos+109] << decimation_shifts<SdrBits, InputBits>::pre64,
3250  &intbuf[54],
3251  &intbuf[55]);
3252  m_decimator2.myDecimate(
3253  buf[pos+112] << decimation_shifts<SdrBits, InputBits>::pre64,
3254  buf[pos+113] << decimation_shifts<SdrBits, InputBits>::pre64,
3255  &intbuf[56],
3256  &intbuf[57]);
3257  m_decimator2.myDecimate(
3258  buf[pos+116] << decimation_shifts<SdrBits, InputBits>::pre64,
3259  buf[pos+117] << decimation_shifts<SdrBits, InputBits>::pre64,
3260  &intbuf[58],
3261  &intbuf[59]);
3262  m_decimator2.myDecimate(
3263  buf[pos+120] << decimation_shifts<SdrBits, InputBits>::pre64,
3264  buf[pos+121] << decimation_shifts<SdrBits, InputBits>::pre64,
3265  &intbuf[60],
3266  &intbuf[61]);
3267  m_decimator2.myDecimate(
3268  buf[pos+124] << decimation_shifts<SdrBits, InputBits>::pre64,
3269  buf[pos+125] << decimation_shifts<SdrBits, InputBits>::pre64,
3270  &intbuf[62],
3271  &intbuf[63]);
3272 
3273  m_decimator4.myDecimate(
3274  intbuf[0],
3275  intbuf[1],
3276  &intbuf[2],
3277  &intbuf[3]);
3278  m_decimator4.myDecimate(
3279  intbuf[4],
3280  intbuf[5],
3281  &intbuf[6],
3282  &intbuf[7]);
3283  m_decimator4.myDecimate(
3284  intbuf[8],
3285  intbuf[9],
3286  &intbuf[10],
3287  &intbuf[11]);
3288  m_decimator4.myDecimate(
3289  intbuf[12],
3290  intbuf[13],
3291  &intbuf[14],
3292  &intbuf[15]);
3293  m_decimator4.myDecimate(
3294  intbuf[16],
3295  intbuf[17],
3296  &intbuf[18],
3297  &intbuf[19]);
3298  m_decimator4.myDecimate(
3299  intbuf[20],
3300  intbuf[21],
3301  &intbuf[22],
3302  &intbuf[23]);
3303  m_decimator4.myDecimate(
3304  intbuf[24],
3305  intbuf[25],
3306  &intbuf[26],
3307  &intbuf[27]);
3308  m_decimator4.myDecimate(
3309  intbuf[28],
3310  intbuf[29],
3311  &intbuf[30],
3312  &intbuf[31]);
3313  m_decimator4.myDecimate(
3314  intbuf[32],
3315  intbuf[33],
3316  &intbuf[34],
3317  &intbuf[35]);
3318  m_decimator4.myDecimate(
3319  intbuf[36],
3320  intbuf[37],
3321  &intbuf[38],
3322  &intbuf[39]);
3323  m_decimator4.myDecimate(
3324  intbuf[40],
3325  intbuf[41],
3326  &intbuf[42],
3327  &intbuf[43]);
3328  m_decimator4.myDecimate(
3329  intbuf[44],
3330  intbuf[45],
3331  &intbuf[46],
3332  &intbuf[47]);
3333  m_decimator4.myDecimate(
3334  intbuf[48],
3335  intbuf[49],
3336  &intbuf[50],
3337  &intbuf[51]);
3338  m_decimator4.myDecimate(
3339  intbuf[52],
3340  intbuf[53],
3341  &intbuf[54],
3342  &intbuf[55]);
3343  m_decimator4.myDecimate(
3344  intbuf[56],
3345  intbuf[57],
3346  &intbuf[58],
3347  &intbuf[59]);
3348  m_decimator4.myDecimate(
3349  intbuf[60],
3350  intbuf[61],
3351  &intbuf[62],
3352  &intbuf[63]);
3353 
3354  m_decimator8.myDecimate(
3355  intbuf[2],
3356  intbuf[3],
3357  &intbuf[6],
3358  &intbuf[7]);
3359  m_decimator8.myDecimate(
3360  intbuf[10],
3361  intbuf[11],
3362  &intbuf[14],
3363  &intbuf[15]);
3364  m_decimator8.myDecimate(
3365  intbuf[18],
3366  intbuf[19],
3367  &intbuf[22],
3368  &intbuf[23]);
3369  m_decimator8.myDecimate(
3370  intbuf[26],
3371  intbuf[27],
3372  &intbuf[30],
3373  &intbuf[31]);
3374  m_decimator8.myDecimate(
3375  intbuf[34],
3376  intbuf[35],
3377  &intbuf[38],
3378  &intbuf[39]);
3379  m_decimator8.myDecimate(
3380  intbuf[42],
3381  intbuf[43],
3382  &intbuf[46],
3383  &intbuf[47]);
3384  m_decimator8.myDecimate(
3385  intbuf[50],
3386  intbuf[51],
3387  &intbuf[54],
3388  &intbuf[55]);
3389  m_decimator8.myDecimate(
3390  intbuf[58],
3391  intbuf[59],
3392  &intbuf[62],
3393  &intbuf[63]);
3394 
3395  m_decimator16.myDecimate(
3396  intbuf[6],
3397  intbuf[7],
3398  &intbuf[14],
3399  &intbuf[15]);
3400  m_decimator16.myDecimate(
3401  intbuf[22],
3402  intbuf[23],
3403  &intbuf[30],
3404  &intbuf[31]);
3405  m_decimator16.myDecimate(
3406  intbuf[38],
3407  intbuf[39],
3408  &intbuf[46],
3409  &intbuf[47]);
3410  m_decimator16.myDecimate(
3411  intbuf[54],
3412  intbuf[55],
3413  &intbuf[62],
3414  &intbuf[63]);
3415 
3416  m_decimator32.myDecimate(
3417  intbuf[14],
3418  intbuf[15],
3419  &intbuf[30],
3420  &intbuf[31]);
3421  m_decimator32.myDecimate(
3422  intbuf[46],
3423  intbuf[47],
3424  &intbuf[62],
3425  &intbuf[63]);
3426 
3427  m_decimator64.myDecimate(
3428  intbuf[30],
3429  intbuf[31],
3430  &intbuf[62],
3431  &intbuf[63]);
3432 
3433  (**it).setReal(intbuf[62] >> decimation_shifts<SdrBits, InputBits>::post64);
3434  (**it).setImag(intbuf[63] >> decimation_shifts<SdrBits, InputBits>::post64);
3435  ++(*it);
3436  }
3437 }
3438 
3439 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
3440 void Decimators<StorageType, T, SdrBits, InputBits>::decimate64_sup_txsync(SampleVector::iterator* it, const T* buf, qint32 len)
3441 {
3442  StorageType buf2[128], buf4[64], buf8[32], buf16[16], buf32[8], buf64[4];
3443 
3444  for (int pos = 0; pos < len - 255; pos += 256)
3445  {
3446  for (int i = 0; i < 32; i++)
3447  {
3448  m_decimator2.myDecimateSup(
3457  &buf2[4*i]);
3458  }
3459 
3460  for (int i = 0; i < 16; i++)
3461  {
3462  m_decimator4.myDecimateInf(
3463  &buf2[8*i],
3464  &buf4[4*i]);
3465  }
3466 
3467  for (int i = 0; i < 8; i++)
3468  {
3469  m_decimator8.myDecimateSup(
3470  &buf4[8*i],
3471  &buf8[4*i]);
3472  }
3473 
3474  for (int i = 0; i < 4; i++)
3475  {
3476  m_decimator16.myDecimateInf(
3477  &buf8[8*i],
3478  &buf16[4*i]);
3479  }
3480 
3481  m_decimator32.myDecimateSup(
3482  &buf16[0],
3483  &buf32[0]);
3484 
3485  m_decimator32.myDecimateSup(
3486  &buf16[8],
3487  &buf32[4]);
3488 
3489  m_decimator64.myDecimateInf(
3490  &buf32[0],
3491  &buf64[0]);
3492 
3493  (**it).setReal(buf64[0] >> decimation_shifts<SdrBits, InputBits>::post64);
3494  (**it).setImag(buf64[1] >> decimation_shifts<SdrBits, InputBits>::post64);
3495  ++(*it);
3496 
3497  (**it).setReal(buf64[2] >> decimation_shifts<SdrBits, InputBits>::post64);
3498  (**it).setImag(buf64[3] >> decimation_shifts<SdrBits, InputBits>::post64);
3499  ++(*it);
3500  }
3501 }
3502 
3503 
3504 // ==============================================================================================================
3505 
3506 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
3507 void Decimators<StorageType, T, SdrBits, InputBits>::decimate1(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len)
3508 {
3509  qint32 xreal, yimag;
3510 
3511  for (int pos = 0; pos < len; pos += 1)
3512  {
3513  xreal = bufI[pos];
3514  yimag = bufQ[pos];
3515  (**it).setReal(xreal << decimation_shifts<SdrBits, InputBits>::pre1); // Valgrind optim (2 - comment not repeated)
3516  (**it).setImag(yimag << decimation_shifts<SdrBits, InputBits>::pre1);
3517  ++(*it); // Valgrind optim (comment not repeated)
3518  }
3519 }
3520 
3521 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
3522 void Decimators<StorageType, T, SdrBits, InputBits>::decimate2_u(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len)
3523 {
3524  StorageType xreal, yimag;
3525 
3526  for (int pos = 0; pos < len - 3; pos += 4)
3527  {
3528  // 0: I[0] 1: Q[0] 2: I[1] 3: Q[1]
3529  xreal = (bufI[pos] - bufQ[pos+1]) << decimation_shifts<SdrBits, InputBits>::pre2;
3530  yimag = (bufQ[pos] + bufI[pos+1] - 255) << decimation_shifts<SdrBits, InputBits>::pre2;
3531  (**it).setReal(xreal >> decimation_shifts<SdrBits, InputBits>::post2);
3532  (**it).setImag(yimag >> decimation_shifts<SdrBits, InputBits>::post2);
3533  ++(*it);
3534 
3535  // 4: I[2] 5: Q[2] 6: I[3] 7: Q[3]
3536  xreal = (bufQ[pos+3] - bufI[pos+2]) << decimation_shifts<SdrBits, InputBits>::pre2;
3537  yimag = (255 - bufQ[pos+2] - bufI[pos+3]) << decimation_shifts<SdrBits, InputBits>::pre2;
3538  (**it).setReal(xreal >> decimation_shifts<SdrBits, InputBits>::post2);
3539  (**it).setImag(yimag >> decimation_shifts<SdrBits, InputBits>::post2);
3540  ++(*it);
3541  }
3542 }
3543 
3544 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
3545 void Decimators<StorageType, T, SdrBits, InputBits>::decimate2_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len)
3546 {
3547  StorageType intbuf[2];
3548 
3549  for (int pos = 0; pos < len - 1; pos += 2)
3550  {
3551  intbuf[0] = bufI[pos+1] << decimation_shifts<SdrBits, InputBits>::pre2;
3552  intbuf[1] = bufQ[pos+1] << decimation_shifts<SdrBits, InputBits>::pre2;
3553 
3554  m_decimator2.myDecimate(
3555  bufI[pos+0] << decimation_shifts<SdrBits, InputBits>::pre2,
3556  bufQ[pos+0] << decimation_shifts<SdrBits, InputBits>::pre2,
3557  &intbuf[0],
3558  &intbuf[1]);
3559 
3560  (**it).setReal(intbuf[0] >> decimation_shifts<SdrBits, InputBits>::post2);
3561  (**it).setImag(intbuf[1] >> decimation_shifts<SdrBits, InputBits>::post2);
3562  ++(*it);
3563  }
3564 }
3565 
3566 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
3567 void Decimators<StorageType, T, SdrBits, InputBits>::decimate4_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len)
3568 {
3569  StorageType intbuf[4];
3570 
3571  for (int pos = 0; pos < len - 3; pos += 4)
3572  {
3573  intbuf[0] = bufI[pos+1] << decimation_shifts<SdrBits, InputBits>::pre4;
3574  intbuf[1] = bufQ[pos+1] << decimation_shifts<SdrBits, InputBits>::pre4;
3575  intbuf[2] = bufI[pos+3] << decimation_shifts<SdrBits, InputBits>::pre4;
3576  intbuf[3] = bufQ[pos+3] << decimation_shifts<SdrBits, InputBits>::pre4;
3577 
3578  m_decimator2.myDecimate(
3579  bufI[pos+0] << decimation_shifts<SdrBits, InputBits>::pre4,
3580  bufQ[pos+0] << decimation_shifts<SdrBits, InputBits>::pre4,
3581  &intbuf[0],
3582  &intbuf[1]);
3583  m_decimator2.myDecimate(
3584  bufI[pos+2] << decimation_shifts<SdrBits, InputBits>::pre4,
3585  bufQ[pos+2] << decimation_shifts<SdrBits, InputBits>::pre4,
3586  &intbuf[2],
3587  &intbuf[3]);
3588 
3589  m_decimator4.myDecimate(
3590  intbuf[0],
3591  intbuf[1],
3592  &intbuf[2],
3593  &intbuf[3]);
3594 
3595  (**it).setReal(intbuf[2] >> decimation_shifts<SdrBits, InputBits>::post4);
3596  (**it).setImag(intbuf[3] >> decimation_shifts<SdrBits, InputBits>::post4);
3597  ++(*it);
3598  }
3599 }
3600 
3601 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
3602 void Decimators<StorageType, T, SdrBits, InputBits>::decimate8_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len)
3603 {
3604  StorageType intbuf[8];
3605 
3606  for (int pos = 0; pos < len - 7; pos += 8)
3607  {
3608  intbuf[0] = bufI[pos+1] << decimation_shifts<SdrBits, InputBits>::pre8;
3609  intbuf[1] = bufQ[pos+1] << decimation_shifts<SdrBits, InputBits>::pre8;
3610  intbuf[2] = bufI[pos+3] << decimation_shifts<SdrBits, InputBits>::pre8;
3611  intbuf[3] = bufQ[pos+3] << decimation_shifts<SdrBits, InputBits>::pre8;
3612  intbuf[4] = bufI[pos+5] << decimation_shifts<SdrBits, InputBits>::pre8;
3613  intbuf[5] = bufQ[pos+5] << decimation_shifts<SdrBits, InputBits>::pre8;
3614  intbuf[6] = bufI[pos+7] << decimation_shifts<SdrBits, InputBits>::pre8;
3615  intbuf[7] = bufQ[pos+7] << decimation_shifts<SdrBits, InputBits>::pre8;
3616 
3617  m_decimator2.myDecimate(
3618  bufI[pos+0] << decimation_shifts<SdrBits, InputBits>::pre8,
3619  bufQ[pos+0] << decimation_shifts<SdrBits, InputBits>::pre8,
3620  &intbuf[0],
3621  &intbuf[1]);
3622  m_decimator2.myDecimate(
3623  bufI[pos+2] << decimation_shifts<SdrBits, InputBits>::pre8,
3624  bufQ[pos+2] << decimation_shifts<SdrBits, InputBits>::pre8,
3625  &intbuf[2],
3626  &intbuf[3]);
3627  m_decimator2.myDecimate(
3628  bufI[pos+4] << decimation_shifts<SdrBits, InputBits>::pre8,
3629  bufQ[pos+4] << decimation_shifts<SdrBits, InputBits>::pre8,
3630  &intbuf[4],
3631  &intbuf[5]);
3632  m_decimator2.myDecimate(
3633  bufI[pos+6] << decimation_shifts<SdrBits, InputBits>::pre8,
3634  bufQ[pos+6] << decimation_shifts<SdrBits, InputBits>::pre8,
3635  &intbuf[6],
3636  &intbuf[7]);
3637 
3638  m_decimator4.myDecimate(
3639  intbuf[0],
3640  intbuf[1],
3641  &intbuf[2],
3642  &intbuf[3]);
3643  m_decimator4.myDecimate(
3644  intbuf[4],
3645  intbuf[5],
3646  &intbuf[6],
3647  &intbuf[7]);
3648 
3649  m_decimator8.myDecimate(
3650  intbuf[2],
3651  intbuf[3],
3652  &intbuf[6],
3653  &intbuf[7]);
3654 
3655  (**it).setReal(intbuf[6] >> decimation_shifts<SdrBits, InputBits>::post8);
3656  (**it).setImag(intbuf[7] >> decimation_shifts<SdrBits, InputBits>::post8);
3657  ++(*it);
3658  }
3659 }
3660 
3661 
3662 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
3663 void Decimators<StorageType, T, SdrBits, InputBits>::decimate16_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len)
3664 {
3665  StorageType intbuf[16];
3666 
3667  for (int pos = 0; pos < len - 15; pos += 16)
3668  {
3669  intbuf[0] = bufI[pos+1] << decimation_shifts<SdrBits, InputBits>::pre16;
3670  intbuf[1] = bufQ[pos+1] << decimation_shifts<SdrBits, InputBits>::pre16;
3671  intbuf[2] = bufI[pos+3] << decimation_shifts<SdrBits, InputBits>::pre16;
3672  intbuf[3] = bufQ[pos+3] << decimation_shifts<SdrBits, InputBits>::pre16;
3673  intbuf[4] = bufI[pos+5] << decimation_shifts<SdrBits, InputBits>::pre16;
3674  intbuf[5] = bufQ[pos+5] << decimation_shifts<SdrBits, InputBits>::pre16;
3675  intbuf[6] = bufI[pos+7] << decimation_shifts<SdrBits, InputBits>::pre16;
3676  intbuf[7] = bufQ[pos+7] << decimation_shifts<SdrBits, InputBits>::pre16;
3677  intbuf[8] = bufI[pos+9] << decimation_shifts<SdrBits, InputBits>::pre16;
3678  intbuf[9] = bufQ[pos+9] << decimation_shifts<SdrBits, InputBits>::pre16;
3679  intbuf[10] = bufI[pos+11] << decimation_shifts<SdrBits, InputBits>::pre16;
3680  intbuf[11] = bufQ[pos+11] << decimation_shifts<SdrBits, InputBits>::pre16;
3681  intbuf[12] = bufI[pos+13] << decimation_shifts<SdrBits, InputBits>::pre16;
3682  intbuf[13] = bufQ[pos+13] << decimation_shifts<SdrBits, InputBits>::pre16;
3683  intbuf[14] = bufI[pos+15] << decimation_shifts<SdrBits, InputBits>::pre16;
3684  intbuf[15] = bufQ[pos+15] << decimation_shifts<SdrBits, InputBits>::pre16;
3685 
3686  m_decimator2.myDecimate(
3687  bufI[pos+0] << decimation_shifts<SdrBits, InputBits>::pre16,
3688  bufQ[pos+0] << decimation_shifts<SdrBits, InputBits>::pre16,
3689  &intbuf[0],
3690  &intbuf[1]);
3691  m_decimator2.myDecimate(
3692  bufI[pos+2] << decimation_shifts<SdrBits, InputBits>::pre16,
3693  bufQ[pos+2] << decimation_shifts<SdrBits, InputBits>::pre16,
3694  &intbuf[2],
3695  &intbuf[3]);
3696  m_decimator2.myDecimate(
3697  bufI[pos+4] << decimation_shifts<SdrBits, InputBits>::pre16,
3698  bufQ[pos+4] << decimation_shifts<SdrBits, InputBits>::pre16,
3699  &intbuf[4],
3700  &intbuf[5]);
3701  m_decimator2.myDecimate(
3702  bufI[pos+6] << decimation_shifts<SdrBits, InputBits>::pre16,
3703  bufQ[pos+6] << decimation_shifts<SdrBits, InputBits>::pre16,
3704  &intbuf[6],
3705  &intbuf[7]);
3706  m_decimator2.myDecimate(
3707  bufI[pos+8] << decimation_shifts<SdrBits, InputBits>::pre16,
3708  bufQ[pos+8] << decimation_shifts<SdrBits, InputBits>::pre16,
3709  &intbuf[8],
3710  &intbuf[9]);
3711  m_decimator2.myDecimate(
3712  bufI[pos+10] << decimation_shifts<SdrBits, InputBits>::pre16,
3713  bufQ[pos+10] << decimation_shifts<SdrBits, InputBits>::pre16,
3714  &intbuf[10],
3715  &intbuf[11]);
3716  m_decimator2.myDecimate(
3717  bufI[pos+12] << decimation_shifts<SdrBits, InputBits>::pre16,
3718  bufQ[pos+12] << decimation_shifts<SdrBits, InputBits>::pre16,
3719  &intbuf[12],
3720  &intbuf[13]);
3721  m_decimator2.myDecimate(
3722  bufI[pos+14] << decimation_shifts<SdrBits, InputBits>::pre16,
3723  bufQ[pos+14] << decimation_shifts<SdrBits, InputBits>::pre16,
3724  &intbuf[14],
3725  &intbuf[15]);
3726 
3727  m_decimator4.myDecimate(
3728  intbuf[0],
3729  intbuf[1],
3730  &intbuf[2],
3731  &intbuf[3]);
3732  m_decimator4.myDecimate(
3733  intbuf[4],
3734  intbuf[5],
3735  &intbuf[6],
3736  &intbuf[7]);
3737  m_decimator4.myDecimate(
3738  intbuf[8],
3739  intbuf[9],
3740  &intbuf[10],
3741  &intbuf[11]);
3742  m_decimator4.myDecimate(
3743  intbuf[12],
3744  intbuf[13],
3745  &intbuf[14],
3746  &intbuf[15]);
3747 
3748  m_decimator8.myDecimate(
3749  intbuf[2],
3750  intbuf[3],
3751  &intbuf[6],
3752  &intbuf[7]);
3753  m_decimator8.myDecimate(
3754  intbuf[10],
3755  intbuf[11],
3756  &intbuf[14],
3757  &intbuf[15]);
3758 
3759  m_decimator16.myDecimate(
3760  intbuf[6],
3761  intbuf[7],
3762  &intbuf[14],
3763  &intbuf[15]);
3764 
3765  (**it).setReal(intbuf[14] >> decimation_shifts<SdrBits, InputBits>::post16);
3766  (**it).setImag(intbuf[15] >> decimation_shifts<SdrBits, InputBits>::post16);
3767  ++(*it);
3768  }
3769 }
3770 
3771 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
3772 void Decimators<StorageType, T, SdrBits, InputBits>::decimate32_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len)
3773 {
3774  StorageType intbuf[32];
3775 
3776  for (int pos = 0; pos < len - 31; pos += 32)
3777  {
3778  intbuf[0] = bufI[pos+1] << decimation_shifts<SdrBits, InputBits>::pre32;
3779  intbuf[1] = bufQ[pos+1] << decimation_shifts<SdrBits, InputBits>::pre32;
3780  intbuf[2] = bufI[pos+3] << decimation_shifts<SdrBits, InputBits>::pre32;
3781  intbuf[3] = bufQ[pos+3] << decimation_shifts<SdrBits, InputBits>::pre32;
3782  intbuf[4] = bufI[pos+5] << decimation_shifts<SdrBits, InputBits>::pre32;
3783  intbuf[5] = bufQ[pos+5] << decimation_shifts<SdrBits, InputBits>::pre32;
3784  intbuf[6] = bufI[pos+7] << decimation_shifts<SdrBits, InputBits>::pre32;
3785  intbuf[7] = bufQ[pos+7] << decimation_shifts<SdrBits, InputBits>::pre32;
3786  intbuf[8] = bufI[pos+9] << decimation_shifts<SdrBits, InputBits>::pre32;
3787  intbuf[9] = bufQ[pos+9] << decimation_shifts<SdrBits, InputBits>::pre32;
3788  intbuf[10] = bufI[pos+11] << decimation_shifts<SdrBits, InputBits>::pre32;
3789  intbuf[11] = bufQ[pos+11] << decimation_shifts<SdrBits, InputBits>::pre32;
3790  intbuf[12] = bufI[pos+13] << decimation_shifts<SdrBits, InputBits>::pre32;
3791  intbuf[13] = bufQ[pos+13] << decimation_shifts<SdrBits, InputBits>::pre32;
3792  intbuf[14] = bufI[pos+15] << decimation_shifts<SdrBits, InputBits>::pre32;
3793  intbuf[15] = bufQ[pos+15] << decimation_shifts<SdrBits, InputBits>::pre32;
3794  intbuf[16] = bufI[pos+17] << decimation_shifts<SdrBits, InputBits>::pre32;
3795  intbuf[17] = bufQ[pos+17] << decimation_shifts<SdrBits, InputBits>::pre32;
3796  intbuf[18] = bufI[pos+19] << decimation_shifts<SdrBits, InputBits>::pre32;
3797  intbuf[19] = bufQ[pos+19] << decimation_shifts<SdrBits, InputBits>::pre32;
3798  intbuf[20] = bufI[pos+21] << decimation_shifts<SdrBits, InputBits>::pre32;
3799  intbuf[21] = bufQ[pos+21] << decimation_shifts<SdrBits, InputBits>::pre32;
3800  intbuf[22] = bufI[pos+23] << decimation_shifts<SdrBits, InputBits>::pre32;
3801  intbuf[23] = bufQ[pos+23] << decimation_shifts<SdrBits, InputBits>::pre32;
3802  intbuf[24] = bufI[pos+25] << decimation_shifts<SdrBits, InputBits>::pre32;
3803  intbuf[25] = bufQ[pos+25] << decimation_shifts<SdrBits, InputBits>::pre32;
3804  intbuf[26] = bufI[pos+27] << decimation_shifts<SdrBits, InputBits>::pre32;
3805  intbuf[27] = bufQ[pos+27] << decimation_shifts<SdrBits, InputBits>::pre32;
3806  intbuf[28] = bufI[pos+29] << decimation_shifts<SdrBits, InputBits>::pre32;
3807  intbuf[29] = bufQ[pos+29] << decimation_shifts<SdrBits, InputBits>::pre32;
3808  intbuf[30] = bufI[pos+31] << decimation_shifts<SdrBits, InputBits>::pre32;
3809  intbuf[31] = bufQ[pos+31] << decimation_shifts<SdrBits, InputBits>::pre32;
3810 
3811  m_decimator2.myDecimate(
3812  bufI[pos+0] << decimation_shifts<SdrBits, InputBits>::pre32,
3813  bufQ[pos+0] << decimation_shifts<SdrBits, InputBits>::pre32,
3814  &intbuf[0],
3815  &intbuf[1]);
3816  m_decimator2.myDecimate(
3817  bufI[pos+2] << decimation_shifts<SdrBits, InputBits>::pre32,
3818  bufQ[pos+2] << decimation_shifts<SdrBits, InputBits>::pre32,
3819  &intbuf[2],
3820  &intbuf[3]);
3821  m_decimator2.myDecimate(
3822  bufI[pos+4] << decimation_shifts<SdrBits, InputBits>::pre32,
3823  bufQ[pos+4] << decimation_shifts<SdrBits, InputBits>::pre32,
3824  &intbuf[4],
3825  &intbuf[5]);
3826  m_decimator2.myDecimate(
3827  bufI[pos+6] << decimation_shifts<SdrBits, InputBits>::pre32,
3828  bufQ[pos+6] << decimation_shifts<SdrBits, InputBits>::pre32,
3829  &intbuf[6],
3830  &intbuf[7]);
3831  m_decimator2.myDecimate(
3832  bufI[pos+8] << decimation_shifts<SdrBits, InputBits>::pre32,
3833  bufQ[pos+8] << decimation_shifts<SdrBits, InputBits>::pre32,
3834  &intbuf[8],
3835  &intbuf[9]);
3836  m_decimator2.myDecimate(
3837  bufI[pos+10] << decimation_shifts<SdrBits, InputBits>::pre32,
3838  bufQ[pos+10] << decimation_shifts<SdrBits, InputBits>::pre32,
3839  &intbuf[10],
3840  &intbuf[11]);
3841  m_decimator2.myDecimate(
3842  bufI[pos+12] << decimation_shifts<SdrBits, InputBits>::pre32,
3843  bufQ[pos+12] << decimation_shifts<SdrBits, InputBits>::pre32,
3844  &intbuf[12],
3845  &intbuf[13]);
3846  m_decimator2.myDecimate(
3847  bufI[pos+14] << decimation_shifts<SdrBits, InputBits>::pre32,
3848  bufQ[pos+14] << decimation_shifts<SdrBits, InputBits>::pre32,
3849  &intbuf[14],
3850  &intbuf[15]);
3851  m_decimator2.myDecimate(
3852  bufI[pos+16] << decimation_shifts<SdrBits, InputBits>::pre32,
3853  bufQ[pos+16] << decimation_shifts<SdrBits, InputBits>::pre32,
3854  &intbuf[16],
3855  &intbuf[17]);
3856  m_decimator2.myDecimate(
3857  bufI[pos+18] << decimation_shifts<SdrBits, InputBits>::pre32,
3858  bufQ[pos+18] << decimation_shifts<SdrBits, InputBits>::pre32,
3859  &intbuf[18],
3860  &intbuf[19]);
3861  m_decimator2.myDecimate(
3862  bufI[pos+20] << decimation_shifts<SdrBits, InputBits>::pre32,
3863  bufQ[pos+20] << decimation_shifts<SdrBits, InputBits>::pre32,
3864  &intbuf[20],
3865  &intbuf[21]);
3866  m_decimator2.myDecimate(
3867  bufI[pos+22] << decimation_shifts<SdrBits, InputBits>::pre32,
3868  bufQ[pos+22] << decimation_shifts<SdrBits, InputBits>::pre32,
3869  &intbuf[22],
3870  &intbuf[23]);
3871  m_decimator2.myDecimate(
3872  bufI[pos+24] << decimation_shifts<SdrBits, InputBits>::pre32,
3873  bufQ[pos+24] << decimation_shifts<SdrBits, InputBits>::pre32,
3874  &intbuf[24],
3875  &intbuf[25]);
3876  m_decimator2.myDecimate(
3877  bufI[pos+26] << decimation_shifts<SdrBits, InputBits>::pre32,
3878  bufQ[pos+26] << decimation_shifts<SdrBits, InputBits>::pre32,
3879  &intbuf[26],
3880  &intbuf[27]);
3881  m_decimator2.myDecimate(
3882  bufI[pos+28] << decimation_shifts<SdrBits, InputBits>::pre32,
3883  bufQ[pos+28] << decimation_shifts<SdrBits, InputBits>::pre32,
3884  &intbuf[28],
3885  &intbuf[29]);
3886  m_decimator2.myDecimate(
3887  bufI[pos+30] << decimation_shifts<SdrBits, InputBits>::pre32,
3888  bufQ[pos+30] << decimation_shifts<SdrBits, InputBits>::pre32,
3889  &intbuf[30],
3890  &intbuf[31]);
3891 
3892  m_decimator4.myDecimate(
3893  intbuf[0],
3894  intbuf[1],
3895  &intbuf[2],
3896  &intbuf[3]);
3897  m_decimator4.myDecimate(
3898  intbuf[4],
3899  intbuf[5],
3900  &intbuf[6],
3901  &intbuf[7]);
3902  m_decimator4.myDecimate(
3903  intbuf[8],
3904  intbuf[9],
3905  &intbuf[10],
3906  &intbuf[11]);
3907  m_decimator4.myDecimate(
3908  intbuf[12],
3909  intbuf[13],
3910  &intbuf[14],
3911  &intbuf[15]);
3912  m_decimator4.myDecimate(
3913  intbuf[16],
3914  intbuf[17],
3915  &intbuf[18],
3916  &intbuf[19]);
3917  m_decimator4.myDecimate(
3918  intbuf[20],
3919  intbuf[21],
3920  &intbuf[22],
3921  &intbuf[23]);
3922  m_decimator4.myDecimate(
3923  intbuf[24],
3924  intbuf[25],
3925  &intbuf[26],
3926  &intbuf[27]);
3927  m_decimator4.myDecimate(
3928  intbuf[28],
3929  intbuf[29],
3930  &intbuf[30],
3931  &intbuf[31]);
3932 
3933  m_decimator8.myDecimate(
3934  intbuf[2],
3935  intbuf[3],
3936  &intbuf[6],
3937  &intbuf[7]);
3938  m_decimator8.myDecimate(
3939  intbuf[10],
3940  intbuf[11],
3941  &intbuf[14],
3942  &intbuf[15]);
3943  m_decimator8.myDecimate(
3944  intbuf[18],
3945  intbuf[19],
3946  &intbuf[22],
3947  &intbuf[23]);
3948  m_decimator8.myDecimate(
3949  intbuf[26],
3950  intbuf[27],
3951  &intbuf[30],
3952  &intbuf[31]);
3953 
3954  m_decimator16.myDecimate(
3955  intbuf[6],
3956  intbuf[7],
3957  &intbuf[14],
3958  &intbuf[15]);
3959  m_decimator16.myDecimate(
3960  intbuf[22],
3961  intbuf[23],
3962  &intbuf[30],
3963  &intbuf[31]);
3964 
3965  m_decimator32.myDecimate(
3966  intbuf[14],
3967  intbuf[15],
3968  &intbuf[30],
3969  &intbuf[31]);
3970 
3971  (**it).setReal(intbuf[30] >> decimation_shifts<SdrBits, InputBits>::post32);
3972  (**it).setImag(intbuf[31] >> decimation_shifts<SdrBits, InputBits>::post32);
3973  ++(*it);
3974  }
3975 }
3976 
3977 template<typename StorageType, typename T, uint SdrBits, uint InputBits>
3978 void Decimators<StorageType, T, SdrBits, InputBits>::decimate64_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len)
3979 {
3980  StorageType intbuf[64];
3981 
3982  for (int pos = 0; pos < len - 63; pos += 64)
3983  {
3984  intbuf[0] = bufI[pos+1] << decimation_shifts<SdrBits, InputBits>::pre64;
3985  intbuf[1] = bufQ[pos+1] << decimation_shifts<SdrBits, InputBits>::pre64;
3986  intbuf[2] = bufI[pos+3] << decimation_shifts<SdrBits, InputBits>::pre64;
3987  intbuf[3] = bufQ[pos+3] << decimation_shifts<SdrBits, InputBits>::pre64;
3988  intbuf[4] = bufI[pos+5] << decimation_shifts<SdrBits, InputBits>::pre64;
3989  intbuf[5] = bufQ[pos+5] << decimation_shifts<SdrBits, InputBits>::pre64;
3990  intbuf[6] = bufI[pos+7] << decimation_shifts<SdrBits, InputBits>::pre64;
3991  intbuf[7] = bufQ[pos+7] << decimation_shifts<SdrBits, InputBits>::pre64;
3992  intbuf[8] = bufI[pos+9] << decimation_shifts<SdrBits, InputBits>::pre64;
3993  intbuf[9] = bufQ[pos+9] << decimation_shifts<SdrBits, InputBits>::pre64;
3994  intbuf[10] = bufI[pos+11] << decimation_shifts<SdrBits, InputBits>::pre64;
3995  intbuf[11] = bufQ[pos+11] << decimation_shifts<SdrBits, InputBits>::pre64;
3996  intbuf[12] = bufI[pos+13] << decimation_shifts<SdrBits, InputBits>::pre64;
3997  intbuf[13] = bufQ[pos+13] << decimation_shifts<SdrBits, InputBits>::pre64;
3998  intbuf[14] = bufI[pos+15] << decimation_shifts<SdrBits, InputBits>::pre64;
3999  intbuf[15] = bufQ[pos+15] << decimation_shifts<SdrBits, InputBits>::pre64;
4000  intbuf[16] = bufI[pos+17] << decimation_shifts<SdrBits, InputBits>::pre64;
4001  intbuf[17] = bufQ[pos+17] << decimation_shifts<SdrBits, InputBits>::pre64;
4002  intbuf[18] = bufI[pos+19] << decimation_shifts<SdrBits, InputBits>::pre64;
4003  intbuf[19] = bufQ[pos+19] << decimation_shifts<SdrBits, InputBits>::pre64;
4004  intbuf[20] = bufI[pos+21] << decimation_shifts<SdrBits, InputBits>::pre64;
4005  intbuf[21] = bufQ[pos+21] << decimation_shifts<SdrBits, InputBits>::pre64;
4006  intbuf[22] = bufI[pos+23] << decimation_shifts<SdrBits, InputBits>::pre64;
4007  intbuf[23] = bufQ[pos+23] << decimation_shifts<SdrBits, InputBits>::pre64;
4008  intbuf[24] = bufI[pos+25] << decimation_shifts<SdrBits, InputBits>::pre64;
4009  intbuf[25] = bufQ[pos+25] << decimation_shifts<SdrBits, InputBits>::pre64;
4010  intbuf[26] = bufI[pos+27] << decimation_shifts<SdrBits, InputBits>::pre64;
4011  intbuf[27] = bufQ[pos+27] << decimation_shifts<SdrBits, InputBits>::pre64;
4012  intbuf[28] = bufI[pos+29] << decimation_shifts<SdrBits, InputBits>::pre64;
4013  intbuf[29] = bufQ[pos+29] << decimation_shifts<SdrBits, InputBits>::pre64;
4014  intbuf[30] = bufI[pos+31] << decimation_shifts<SdrBits, InputBits>::pre64;
4015  intbuf[31] = bufQ[pos+31] << decimation_shifts<SdrBits, InputBits>::pre64;
4016 
4017  intbuf[32] = bufI[pos+33] << decimation_shifts<SdrBits, InputBits>::pre64;
4018  intbuf[33] = bufQ[pos+33] << decimation_shifts<SdrBits, InputBits>::pre64;
4019  intbuf[34] = bufI[pos+35] << decimation_shifts<SdrBits, InputBits>::pre64;
4020  intbuf[35] = bufQ[pos+35] << decimation_shifts<SdrBits, InputBits>::pre64;
4021  intbuf[36] = bufI[pos+37] << decimation_shifts<SdrBits, InputBits>::pre64;
4022  intbuf[37] = bufQ[pos+37] << decimation_shifts<SdrBits, InputBits>::pre64;
4023  intbuf[38] = bufI[pos+39] << decimation_shifts<SdrBits, InputBits>::pre64;
4024  intbuf[39] = bufQ[pos+39] << decimation_shifts<SdrBits, InputBits>::pre64;
4025  intbuf[40] = bufI[pos+41] << decimation_shifts<SdrBits, InputBits>::pre64;
4026  intbuf[41] = bufQ[pos+41] << decimation_shifts<SdrBits, InputBits>::pre64;
4027  intbuf[42] = bufI[pos+43] << decimation_shifts<SdrBits, InputBits>::pre64;
4028  intbuf[43] = bufQ[pos+43] << decimation_shifts<SdrBits, InputBits>::pre64;
4029  intbuf[44] = bufI[pos+45] << decimation_shifts<SdrBits, InputBits>::pre64;
4030  intbuf[45] = bufQ[pos+45] << decimation_shifts<SdrBits, InputBits>::pre64;
4031  intbuf[46] = bufI[pos+47] << decimation_shifts<SdrBits, InputBits>::pre64;
4032  intbuf[47] = bufQ[pos+47] << decimation_shifts<SdrBits, InputBits>::pre64;
4033  intbuf[48] = bufI[pos+49] << decimation_shifts<SdrBits, InputBits>::pre64;
4034  intbuf[49] = bufQ[pos+49] << decimation_shifts<SdrBits, InputBits>::pre64;
4035  intbuf[50] = bufI[pos+51] << decimation_shifts<SdrBits, InputBits>::pre64;
4036  intbuf[51] = bufQ[pos+51] << decimation_shifts<SdrBits, InputBits>::pre64;
4037  intbuf[52] = bufI[pos+53] << decimation_shifts<SdrBits, InputBits>::pre64;
4038  intbuf[53] = bufQ[pos+53] << decimation_shifts<SdrBits, InputBits>::pre64;
4039  intbuf[54] = bufI[pos+55] << decimation_shifts<SdrBits, InputBits>::pre64;
4040  intbuf[55] = bufQ[pos+55] << decimation_shifts<SdrBits, InputBits>::pre64;
4041  intbuf[56] = bufI[pos+57] << decimation_shifts<SdrBits, InputBits>::pre64;
4042  intbuf[57] = bufQ[pos+57] << decimation_shifts<SdrBits, InputBits>::pre64;
4043  intbuf[58] = bufI[pos+59] << decimation_shifts<SdrBits, InputBits>::pre64;
4044  intbuf[59] = bufQ[pos+59] << decimation_shifts<SdrBits, InputBits>::pre64;
4045  intbuf[60] = bufI[pos+61] << decimation_shifts<SdrBits, InputBits>::pre64;
4046  intbuf[61] = bufQ[pos+61] << decimation_shifts<SdrBits, InputBits>::pre64;
4047  intbuf[62] = bufI[pos+63] << decimation_shifts<SdrBits, InputBits>::pre64;
4048  intbuf[63] = bufQ[pos+63] << decimation_shifts<SdrBits, InputBits>::pre64;
4049 
4050  m_decimator2.myDecimate(
4051  bufI[pos+0] << decimation_shifts<SdrBits, InputBits>::pre64,
4052  bufQ[pos+0] << decimation_shifts<SdrBits, InputBits>::pre64,
4053  &intbuf[0],
4054  &intbuf[1]);
4055  m_decimator2.myDecimate(
4056  bufI[pos+2] << decimation_shifts<SdrBits, InputBits>::pre64,
4057  bufQ[pos+2] << decimation_shifts<SdrBits, InputBits>::pre64,
4058  &intbuf[2],
4059  &intbuf[3]);
4060  m_decimator2.myDecimate(
4061  bufI[pos+4] << decimation_shifts<SdrBits, InputBits>::pre64,
4062  bufQ[pos+4] << decimation_shifts<SdrBits, InputBits>::pre64,
4063  &intbuf[4],
4064  &intbuf[5]);
4065  m_decimator2.myDecimate(
4066  bufI[pos+6] << decimation_shifts<SdrBits, InputBits>::pre64,
4067  bufQ[pos+6] << decimation_shifts<SdrBits, InputBits>::pre64,
4068  &intbuf[6],
4069  &intbuf[7]);
4070  m_decimator2.myDecimate(
4071  bufI[pos+8] << decimation_shifts<SdrBits, InputBits>::pre64,
4072  bufQ[pos+8] << decimation_shifts<SdrBits, InputBits>::pre64,
4073  &intbuf[8],
4074  &intbuf[9]);
4075  m_decimator2.myDecimate(
4076  bufI[pos+10] << decimation_shifts<SdrBits, InputBits>::pre64,
4077  bufQ[pos+10] << decimation_shifts<SdrBits, InputBits>::pre64,
4078  &intbuf[10],
4079  &intbuf[11]);
4080  m_decimator2.myDecimate(
4081  bufI[pos+12] << decimation_shifts<SdrBits, InputBits>::pre64,
4082  bufQ[pos+12] << decimation_shifts<SdrBits, InputBits>::pre64,
4083  &intbuf[12],
4084  &intbuf[13]);
4085  m_decimator2.myDecimate(
4086  bufI[pos+14] << decimation_shifts<SdrBits, InputBits>::pre64,
4087  bufQ[pos+14] << decimation_shifts<SdrBits, InputBits>::pre64,
4088  &intbuf[14],
4089  &intbuf[15]);
4090  m_decimator2.myDecimate(
4091  bufI[pos+16] << decimation_shifts<SdrBits, InputBits>::pre64,
4092  bufQ[pos+16] << decimation_shifts<SdrBits, InputBits>::pre64,
4093  &intbuf[16],
4094  &intbuf[17]);
4095  m_decimator2.myDecimate(
4096  bufI[pos+18] << decimation_shifts<SdrBits, InputBits>::pre64,
4097  bufQ[pos+18] << decimation_shifts<SdrBits, InputBits>::pre64,
4098  &intbuf[18],
4099  &intbuf[19]);
4100  m_decimator2.myDecimate(
4101  bufI[pos+20] << decimation_shifts<SdrBits, InputBits>::pre64,
4102  bufQ[pos+20] << decimation_shifts<SdrBits, InputBits>::pre64,
4103  &intbuf[20],
4104  &intbuf[21]);
4105  m_decimator2.myDecimate(
4106  bufI[pos+22] << decimation_shifts<SdrBits, InputBits>::pre64,
4107  bufQ[pos+22] << decimation_shifts<SdrBits, InputBits>::pre64,
4108  &intbuf[22],
4109  &intbuf[23]);
4110  m_decimator2.myDecimate(
4111  bufI[pos+24] << decimation_shifts<SdrBits, InputBits>::pre64,
4112  bufQ[pos+24] << decimation_shifts<SdrBits, InputBits>::pre64,
4113  &intbuf[24],
4114  &intbuf[25]);
4115  m_decimator2.myDecimate(
4116  bufI[pos+26] << decimation_shifts<SdrBits, InputBits>::pre64,
4117  bufQ[pos+26] << decimation_shifts<SdrBits, InputBits>::pre64,
4118  &intbuf[26],
4119  &intbuf[27]);
4120  m_decimator2.myDecimate(
4121  bufI[pos+28] << decimation_shifts<SdrBits, InputBits>::pre64,
4122  bufQ[pos+28] << decimation_shifts<SdrBits, InputBits>::pre64,
4123  &intbuf[28],
4124  &intbuf[29]);
4125  m_decimator2.myDecimate(
4126  bufI[pos+30] << decimation_shifts<SdrBits, InputBits>::pre64,
4127  bufQ[pos+30] << decimation_shifts<SdrBits, InputBits>::pre64,
4128  &intbuf[30],
4129  &intbuf[31]);
4130  m_decimator2.myDecimate(
4131  bufI[pos+32] << decimation_shifts<SdrBits, InputBits>::pre64,
4132  bufQ[pos+32] << decimation_shifts<SdrBits, InputBits>::pre64,
4133  &intbuf[32],
4134  &intbuf[33]);
4135  m_decimator2.myDecimate(
4136  bufI[pos+34] << decimation_shifts<SdrBits, InputBits>::pre64,
4137  bufQ[pos+34] << decimation_shifts<SdrBits, InputBits>::pre64,
4138  &intbuf[34],
4139  &intbuf[35]);
4140  m_decimator2.myDecimate(
4141  bufI[pos+36] << decimation_shifts<SdrBits, InputBits>::pre64,
4142  bufQ[pos+36] << decimation_shifts<SdrBits, InputBits>::pre64,
4143  &intbuf[36],
4144  &intbuf[37]);
4145  m_decimator2.myDecimate(
4146  bufI[pos+38] << decimation_shifts<SdrBits, InputBits>::pre64,
4147  bufQ[pos+38] << decimation_shifts<SdrBits, InputBits>::pre64,
4148  &intbuf[38],
4149  &intbuf[39]);
4150  m_decimator2.myDecimate(
4151  bufI[pos+40] << decimation_shifts<SdrBits, InputBits>::pre64,
4152  bufQ[pos+40] << decimation_shifts<SdrBits, InputBits>::pre64,
4153  &intbuf[40],
4154  &intbuf[41]);
4155  m_decimator2.myDecimate(
4156  bufI[pos+42] << decimation_shifts<SdrBits, InputBits>::pre64,
4157  bufQ[pos+42] << decimation_shifts<SdrBits, InputBits>::pre64,
4158  &intbuf[42],
4159  &intbuf[43]);
4160  m_decimator2.myDecimate(
4161  bufI[pos+44] << decimation_shifts<SdrBits, InputBits>::pre64,
4162  bufQ[pos+44] << decimation_shifts<SdrBits, InputBits>::pre64,
4163  &intbuf[44],
4164  &intbuf[45]);
4165  m_decimator2.myDecimate(
4166  bufI[pos+46] << decimation_shifts<SdrBits, InputBits>::pre64,
4167  bufQ[pos+46] << decimation_shifts<SdrBits, InputBits>::pre64,
4168  &intbuf[46],
4169  &intbuf[47]);
4170  m_decimator2.myDecimate(
4171  bufI[pos+48] << decimation_shifts<SdrBits, InputBits>::pre64,
4172  bufQ[pos+48] << decimation_shifts<SdrBits, InputBits>::pre64,
4173  &intbuf[48],
4174  &intbuf[49]);
4175  m_decimator2.myDecimate(
4176  bufI[pos+50] << decimation_shifts<SdrBits, InputBits>::pre64,
4177  bufQ[pos+50] << decimation_shifts<SdrBits, InputBits>::pre64,
4178  &intbuf[50],
4179  &intbuf[51]);
4180  m_decimator2.myDecimate(
4181  bufI[pos+52] << decimation_shifts<SdrBits, InputBits>::pre64,
4182  bufQ[pos+52] << decimation_shifts<SdrBits, InputBits>::pre64,
4183  &intbuf[52],
4184  &intbuf[53]);
4185  m_decimator2.myDecimate(
4186  bufI[pos+54] << decimation_shifts<SdrBits, InputBits>::pre64,
4187  bufQ[pos+54] << decimation_shifts<SdrBits, InputBits>::pre64,
4188  &intbuf[54],
4189  &intbuf[55]);
4190  m_decimator2.myDecimate(
4191  bufI[pos+56] << decimation_shifts<SdrBits, InputBits>::pre64,
4192  bufQ[pos+56] << decimation_shifts<SdrBits, InputBits>::pre64,
4193  &intbuf[56],
4194  &intbuf[57]);
4195  m_decimator2.myDecimate(
4196  bufI[pos+58] << decimation_shifts<SdrBits, InputBits>::pre64,
4197  bufQ[pos+58] << decimation_shifts<SdrBits, InputBits>::pre64,
4198  &intbuf[58],
4199  &intbuf[59]);
4200  m_decimator2.myDecimate(
4201  bufI[pos+60] << decimation_shifts<SdrBits, InputBits>::pre64,
4202  bufQ[pos+60] << decimation_shifts<SdrBits, InputBits>::pre64,
4203  &intbuf[60],
4204  &intbuf[61]);
4205  m_decimator2.myDecimate(
4206  bufI[pos+62] << decimation_shifts<SdrBits, InputBits>::pre64,
4207  bufQ[pos+62] << decimation_shifts<SdrBits, InputBits>::pre64,
4208  &intbuf[62],
4209  &intbuf[63]);
4210 
4211  m_decimator4.myDecimate(
4212  intbuf[0],
4213  intbuf[1],
4214  &intbuf[2],
4215  &intbuf[3]);
4216  m_decimator4.myDecimate(
4217  intbuf[4],
4218  intbuf[5],
4219  &intbuf[6],
4220  &intbuf[7]);
4221  m_decimator4.myDecimate(
4222  intbuf[8],
4223  intbuf[9],
4224  &intbuf[10],
4225  &intbuf[11]);
4226  m_decimator4.myDecimate(
4227  intbuf[12],
4228  intbuf[13],
4229  &intbuf[14],
4230  &intbuf[15]);
4231  m_decimator4.myDecimate(
4232  intbuf[16],
4233  intbuf[17],
4234  &intbuf[18],
4235  &intbuf[19]);
4236  m_decimator4.myDecimate(
4237  intbuf[20],
4238  intbuf[21],
4239  &intbuf[22],
4240  &intbuf[23]);
4241  m_decimator4.myDecimate(
4242  intbuf[24],
4243  intbuf[25],
4244  &intbuf[26],
4245  &intbuf[27]);
4246  m_decimator4.myDecimate(
4247  intbuf[28],
4248  intbuf[29],
4249  &intbuf[30],
4250  &intbuf[31]);
4251  m_decimator4.myDecimate(
4252  intbuf[32],
4253  intbuf[33],
4254  &intbuf[34],
4255  &intbuf[35]);
4256  m_decimator4.myDecimate(
4257  intbuf[36],
4258  intbuf[37],
4259  &intbuf[38],
4260  &intbuf[39]);
4261  m_decimator4.myDecimate(
4262  intbuf[40],
4263  intbuf[41],
4264  &intbuf[42],
4265  &intbuf[43]);
4266  m_decimator4.myDecimate(
4267  intbuf[44],
4268  intbuf[45],
4269  &intbuf[46],
4270  &intbuf[47]);
4271  m_decimator4.myDecimate(
4272  intbuf[48],
4273  intbuf[49],
4274  &intbuf[50],
4275  &intbuf[51]);
4276  m_decimator4.myDecimate(
4277  intbuf[52],
4278  intbuf[53],
4279  &intbuf[54],
4280  &intbuf[55]);
4281  m_decimator4.myDecimate(
4282  intbuf[56],
4283  intbuf[57],
4284  &intbuf[58],
4285  &intbuf[59]);
4286  m_decimator4.myDecimate(
4287  intbuf[60],
4288  intbuf[61],
4289  &intbuf[62],
4290  &intbuf[63]);
4291 
4292  m_decimator8.myDecimate(
4293  intbuf[2],
4294  intbuf[3],
4295  &intbuf[6],
4296  &intbuf[7]);
4297  m_decimator8.myDecimate(
4298  intbuf[10],
4299  intbuf[11],
4300  &intbuf[14],
4301  &intbuf[15]);
4302  m_decimator8.myDecimate(
4303  intbuf[18],
4304  intbuf[19],
4305  &intbuf[22],
4306  &intbuf[23]);
4307  m_decimator8.myDecimate(
4308  intbuf[26],
4309  intbuf[27],
4310  &intbuf[30],
4311  &intbuf[31]);
4312  m_decimator8.myDecimate(
4313  intbuf[34],
4314  intbuf[35],
4315  &intbuf[38],
4316  &intbuf[39]);
4317  m_decimator8.myDecimate(
4318  intbuf[42],
4319  intbuf[43],
4320  &intbuf[46],
4321  &intbuf[47]);
4322  m_decimator8.myDecimate(
4323  intbuf[50],
4324  intbuf[51],
4325  &intbuf[54],
4326  &intbuf[55]);
4327  m_decimator8.myDecimate(
4328  intbuf[58],
4329  intbuf[59],
4330  &intbuf[62],
4331  &intbuf[63]);
4332 
4333  m_decimator16.myDecimate(
4334  intbuf[6],
4335  intbuf[7],
4336  &intbuf[14],
4337  &intbuf[15]);
4338  m_decimator16.myDecimate(
4339  intbuf[22],
4340  intbuf[23],
4341  &intbuf[30],
4342  &intbuf[31]);
4343  m_decimator16.myDecimate(
4344  intbuf[38],
4345  intbuf[39],
4346  &intbuf[46],
4347  &intbuf[47]);
4348  m_decimator16.myDecimate(
4349  intbuf[54],
4350  intbuf[55],
4351  &intbuf[62],
4352  &intbuf[63]);
4353 
4354  m_decimator32.myDecimate(
4355  intbuf[14],
4356  intbuf[15],
4357  &intbuf[30],
4358  &intbuf[31]);
4359  m_decimator32.myDecimate(
4360  intbuf[46],
4361  intbuf[47],
4362  &intbuf[62],
4363  &intbuf[63]);
4364 
4365  m_decimator64.myDecimate(
4366  intbuf[30],
4367  intbuf[31],
4368  &intbuf[62],
4369  &intbuf[63]);
4370 
4371  (**it).setReal(intbuf[62] >> decimation_shifts<SdrBits, InputBits>::post64);
4372  (**it).setImag(intbuf[63] >> decimation_shifts<SdrBits, InputBits>::post64);
4373  ++(*it);
4374  }
4375 }
4376 
4377 #endif /* INCLUDE_GPL_DSP_DECIMATORS_H_ */
static const uint pre64
Definition: decimators.h:40
void decimate2_inf(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:498
void decimate64_sup(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:2975
IntHalfbandFilterEO< qint32, qint32, DECIMATORS_HB_FILTER_ORDER > m_decimator2
Definition: decimators.h:452
void decimate4_sup_txsync(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:732
static const uint pre1
Definition: decimators.h:29
void decimate64_cen(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:3040
static const uint pre32
Definition: decimators.h:38
uint8_t i3
Definition: decimators.h:247
void decimate2_sup(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:526
static const uint pre16
Definition: decimators.h:36
void decimate64_inf_txsync(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:2911
void decimate2_cen(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:554
void decimate8_sup(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:941
IntHalfbandFilterEO< qint32, qint32, DECIMATORS_HB_FILTER_ORDER > m_decimator16
Definition: decimators.h:455
static const uint post8
Definition: decimators.h:35
void decimate64_inf(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:2418
void decimate32_inf(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:1592
void decimate32_sup(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:1902
static const uint post32
Definition: decimators.h:39
uint8_t b2
Definition: decimators.h:57
unsigned int uint32_t
Definition: rtptypes_win.h:46
void decimate4_sup(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:682
void decimate8_inf_txsync(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:898
void decimate8_cen(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:1057
unsigned char uint8_t
Definition: rtptypes_win.h:42
void decimate8_inf(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:825
static const uint post2
Definition: decimators.h:31
uint8_t b2
Definition: decimators.h:229
void decimate8_sup_txsync(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:1014
void decimate16_sup(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:1300
IntHalfbandFilterEO< qint32, qint32, DECIMATORS_HB_FILTER_ORDER > m_decimator8
Definition: decimators.h:454
static const uint pre2
Definition: decimators.h:30
uint8_t b1
Definition: decimators.h:56
void decimate64_sup_txsync(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:3440
IntHalfbandFilterEO< qint32, qint32, DECIMATORS_HB_FILTER_ORDER > m_decimator64
Definition: decimators.h:457
int32_t i
Definition: decimators.h:244
void decimate16_inf_txsync(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:1250
static const uint pre4
Definition: decimators.h:32
int int32_t
Definition: rtptypes_win.h:45
typedef __attribute__
void decimate4_cen(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:782
uint8_t b1
Definition: decimators.h:228
IntHalfbandFilterEO< qint32, qint32, DECIMATORS_HB_FILTER_ORDER > m_decimator4
Definition: decimators.h:453
static const uint pre8
Definition: decimators.h:34
uint32_t ia
Definition: decimators.h:379
void decimate4_inf(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:582
uint8_t i3
Definition: decimators.h:67
uint8_t i0
Definition: decimators.h:64
uint8_t b0
Definition: decimators.h:55
void decimate32_sup_txsync(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:2155
int32_t i
Definition: decimators.h:61
void decimate16_sup_txsync(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:1433
static const uint post4
Definition: decimators.h:33
IntHalfbandFilterEO< qint32, qint32, DECIMATORS_HB_FILTER_ORDER > m_decimator32
Definition: decimators.h:456
void decimate2_u(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:477
uint8_t i0
Definition: decimators.h:244
static const uint post16
Definition: decimators.h:37
uint32_t ia
Definition: decimators.h:64
void decimate16_inf(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:1117
uint8_t i2
Definition: decimators.h:66
uint8_t i1
Definition: decimators.h:245
void decimate16_cen(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:1483
void decimate32_cen(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:2212
uint8_t i1
Definition: decimators.h:65
void decimate1(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:462
uint8_t b0
Definition: decimators.h:227
uint8_t i2
Definition: decimators.h:246
void decimate32_inf_txsync(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:1845
static const uint post64
Definition: decimators.h:41
void decimate4_inf_txsync(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:632