diff --git a/plugins/samplesource/airspy/airspythread.h b/plugins/samplesource/airspy/airspythread.h index 6abd2efd8..48511b18a 100644 --- a/plugins/samplesource/airspy/airspythread.h +++ b/plugins/samplesource/airspy/airspythread.h @@ -55,11 +55,7 @@ private: int m_fcPos; static AirspyThread *m_this; -#ifdef SDR_RX_SAMPLE_24BIT - Decimators m_decimators; -#else Decimators m_decimators; -#endif void run(); void callback(const qint16* buf, qint32 len); diff --git a/plugins/samplesource/bladerfinput/bladerfinputthread.h b/plugins/samplesource/bladerfinput/bladerfinputthread.h index a6e0b29b0..8c2766166 100644 --- a/plugins/samplesource/bladerfinput/bladerfinputthread.h +++ b/plugins/samplesource/bladerfinput/bladerfinputthread.h @@ -51,11 +51,7 @@ private: unsigned int m_log2Decim; int m_fcPos; -#ifdef SDR_RX_SAMPLE_24BIT - Decimators m_decimators; -#else Decimators m_decimators; -#endif void run(); void callback(const qint16* buf, qint32 len); diff --git a/plugins/samplesource/hackrfinput/hackrfinputthread.h b/plugins/samplesource/hackrfinput/hackrfinputthread.h index 6cb81d1b4..cf93c4e92 100644 --- a/plugins/samplesource/hackrfinput/hackrfinputthread.h +++ b/plugins/samplesource/hackrfinput/hackrfinputthread.h @@ -54,11 +54,7 @@ private: unsigned int m_log2Decim; int m_fcPos; -#ifdef SDR_RX_SAMPLE_24BIT - Decimators m_decimators; -#else Decimators m_decimators; -#endif void run(); void callback(const qint8* buf, qint32 len); diff --git a/plugins/samplesource/limesdrinput/limesdrinputthread.h b/plugins/samplesource/limesdrinput/limesdrinputthread.h index f7b645b94..ddf671047 100644 --- a/plugins/samplesource/limesdrinput/limesdrinputthread.h +++ b/plugins/samplesource/limesdrinput/limesdrinputthread.h @@ -55,11 +55,7 @@ private: unsigned int m_log2Decim; // soft decimation -#ifdef SDR_RX_SAMPLE_24BIT Decimators m_decimators; -#else - Decimators m_decimators; -#endif void run(); void callback(const qint16* buf, qint32 len); diff --git a/plugins/samplesource/plutosdrinput/plutosdrinputthread.h b/plugins/samplesource/plutosdrinput/plutosdrinputthread.h index 843175246..4bd285aee 100644 --- a/plugins/samplesource/plutosdrinput/plutosdrinputthread.h +++ b/plugins/samplesource/plutosdrinput/plutosdrinputthread.h @@ -59,11 +59,7 @@ private: int m_fcPos; float m_phasor; -#ifdef SDR_RX_SAMPLE_24BIT Decimators m_decimators; -#else - Decimators m_decimators; -#endif void run(); void convert(const qint16* buf, qint32 len); diff --git a/plugins/samplesource/sdrplay/sdrplaythread.h b/plugins/samplesource/sdrplay/sdrplaythread.h index 1317ae57f..428cd00c4 100644 --- a/plugins/samplesource/sdrplay/sdrplaythread.h +++ b/plugins/samplesource/sdrplay/sdrplaythread.h @@ -52,11 +52,7 @@ private: unsigned int m_log2Decim; int m_fcPos; -#ifdef SDR_RX_SAMPLE_24BIT Decimators m_decimators; -#else - Decimators m_decimators; -#endif void run(); void callback(const qint16* buf, qint32 len); diff --git a/plugins/samplesource/testsource/testsourcethread.h b/plugins/samplesource/testsource/testsourcethread.h index db9e4d3c8..db506d308 100644 --- a/plugins/samplesource/testsource/testsourcethread.h +++ b/plugins/samplesource/testsource/testsourcethread.h @@ -99,15 +99,9 @@ private: bool m_throttleToggle; QMutex m_mutex; -#ifdef SDR_RX_SAMPLE_24BIT - Decimators m_decimators_8; - Decimators m_decimators_12; - Decimators m_decimators_16; -#else Decimators m_decimators_8; Decimators m_decimators_12; Decimators m_decimators_16; -#endif void run(); void callback(const qint16* buf, qint32 len); diff --git a/sdrbase/dsp/decimators.h b/sdrbase/dsp/decimators.h index 44680cbd8..9d413e948 100644 --- a/sdrbase/dsp/decimators.h +++ b/sdrbase/dsp/decimators.h @@ -280,7 +280,7 @@ struct TripleByteLE /** Decimators with integer input and integer output */ -template +template class Decimators { public: @@ -345,8 +345,8 @@ private: #endif // SDR_RX_SAMPLE_24BIT }; -template -void Decimators::decimate1(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate1(SampleVector::iterator* it, const T* buf, qint32 len) { qint32 xreal, yimag; @@ -360,8 +360,8 @@ void Decimators::decimate1(SampleVector::iterat } } -template -void Decimators::decimate1(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate1(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { qint32 xreal, yimag; @@ -375,10 +375,10 @@ void Decimators::decimate1(SampleVector::iterat } } -template -void Decimators::decimate2_u(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate2_u(SampleVector::iterator* it, const T* buf, qint32 len) { - AccuType xreal, yimag; + StorageType xreal, yimag; for (int pos = 0; pos < len - 7; pos += 8) { @@ -396,10 +396,10 @@ void Decimators::decimate2_u(SampleVector::iter } } -template -void Decimators::decimate2_u(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate2_u(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - AccuType xreal, yimag; + StorageType xreal, yimag; for (int pos = 0; pos < len - 3; pos += 4) { @@ -419,10 +419,10 @@ void Decimators::decimate2_u(SampleVector::iter } } -template -void Decimators::decimate2_inf(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate2_inf(SampleVector::iterator* it, const T* buf, qint32 len) { - AccuType xreal, yimag; + StorageType xreal, yimag; for (int pos = 0; pos < len - 7; pos += 8) { @@ -440,10 +440,10 @@ void Decimators::decimate2_inf(SampleVector::it } } -template -void Decimators::decimate2_inf(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate2_inf(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - AccuType xreal, yimag; + StorageType xreal, yimag; for (int pos = 0; pos < len - 3; pos += 4) { @@ -463,10 +463,10 @@ void Decimators::decimate2_inf(SampleVector::it } } -template -void Decimators::decimate2_sup(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate2_sup(SampleVector::iterator* it, const T* buf, qint32 len) { - AccuType xreal, yimag; + StorageType xreal, yimag; for (int pos = 0; pos < len - 7; pos += 8) { @@ -484,10 +484,10 @@ void Decimators::decimate2_sup(SampleVector::it } } -template -void Decimators::decimate2_sup(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate2_sup(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - AccuType xreal, yimag; + StorageType xreal, yimag; for (int pos = 0; pos < len - 3; pos += 4) { @@ -507,10 +507,10 @@ void Decimators::decimate2_sup(SampleVector::it } } -template -void Decimators::decimate4_inf(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate4_inf(SampleVector::iterator* it, const T* buf, qint32 len) { - AccuType xreal, yimag; + StorageType xreal, yimag; for (int pos = 0; pos < len - 7; pos += 8) { @@ -524,10 +524,10 @@ void Decimators::decimate4_inf(SampleVector::it } } -template -void Decimators::decimate4_inf(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate4_inf(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - AccuType xreal, yimag; + StorageType xreal, yimag; for (int pos = 0; pos < len - 3; pos += 4) { @@ -541,8 +541,8 @@ void Decimators::decimate4_inf(SampleVector::it } } -template -void Decimators::decimate4_sup(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate4_sup(SampleVector::iterator* it, const T* buf, qint32 len) { // Sup (USB): // x y x y x y x y / x -> 1,-2,-5,6 / y -> -0,-3,4,7 @@ -550,7 +550,7 @@ void Decimators::decimate4_sup(SampleVector::it // Inf (LSB): // x y x y x y x y / x -> 0,-3,-4,7 / y -> 1,2,-5,-6 // [ rotate: 0, 1, -3, 2, -4, -5, 7, -6] - AccuType xreal, yimag; + StorageType xreal, yimag; for (int pos = 0; pos < len - 7; pos += 8) { @@ -564,10 +564,10 @@ void Decimators::decimate4_sup(SampleVector::it } } -template -void Decimators::decimate4_sup(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate4_sup(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - AccuType xreal, yimag; + StorageType xreal, yimag; for (int pos = 0; pos < len - 3; pos += 4) { @@ -581,10 +581,10 @@ void Decimators::decimate4_sup(SampleVector::it } } -template -void Decimators::decimate8_inf(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate8_inf(SampleVector::iterator* it, const T* buf, qint32 len) { - AccuType xreal[2], yimag[2]; + StorageType xreal[2], yimag[2]; for (int pos = 0; pos < len - 15; pos += 8) { @@ -604,10 +604,10 @@ void Decimators::decimate8_inf(SampleVector::it } } -template -void Decimators::decimate8_inf(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate8_inf(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - AccuType xreal[2], yimag[2]; + StorageType xreal[2], yimag[2]; for (int pos = 0; pos < len - 7; pos += 4) { @@ -627,10 +627,10 @@ void Decimators::decimate8_inf(SampleVector::it } } -template -void Decimators::decimate8_sup(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate8_sup(SampleVector::iterator* it, const T* buf, qint32 len) { - AccuType xreal[2], yimag[2]; + StorageType xreal[2], yimag[2]; for (int pos = 0; pos < len - 15; pos += 8) { @@ -650,10 +650,10 @@ void Decimators::decimate8_sup(SampleVector::it } } -template -void Decimators::decimate8_sup(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate8_sup(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - AccuType xreal[2], yimag[2]; + StorageType xreal[2], yimag[2]; for (int pos = 0; pos < len - 7; pos += 4) { @@ -673,12 +673,12 @@ void Decimators::decimate8_sup(SampleVector::it } } -template -void Decimators::decimate16_inf(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate16_inf(SampleVector::iterator* it, const T* buf, qint32 len) { // Offset tuning: 4x downsample and rotate, then // downsample 4x more. [ rotate: 0, 1, -3, 2, -4, -5, 7, -6] - AccuType xreal[4], yimag[4]; + StorageType xreal[4], yimag[4]; for (int pos = 0; pos < len - 31; ) { @@ -701,12 +701,12 @@ void Decimators::decimate16_inf(SampleVector::i } } -template -void Decimators::decimate16_inf(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate16_inf(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { // Offset tuning: 4x downsample and rotate, then // downsample 4x more. [ rotate: 0, 1, -3, 2, -4, -5, 7, -6] - AccuType xreal[4], yimag[4]; + StorageType xreal[4], yimag[4]; for (int pos = 0; pos < len - 15; ) { @@ -729,12 +729,12 @@ void Decimators::decimate16_inf(SampleVector::i } } -template -void Decimators::decimate16_sup(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate16_sup(SampleVector::iterator* it, const T* buf, qint32 len) { // Offset tuning: 4x downsample and rotate, then // downsample 4x more. [ rotate: 1, 0, -2, 3, -5, -4, 6, -7] - AccuType xreal[4], yimag[4]; + StorageType xreal[4], yimag[4]; for (int pos = 0; pos < len - 31; ) { @@ -757,12 +757,12 @@ void Decimators::decimate16_sup(SampleVector::i } } -template -void Decimators::decimate16_sup(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate16_sup(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { // Offset tuning: 4x downsample and rotate, then // downsample 4x more. [ rotate: 1, 0, -2, 3, -5, -4, 6, -7] - AccuType xreal[4], yimag[4]; + StorageType xreal[4], yimag[4]; for (int pos = 0; pos < len - 15; ) { @@ -785,10 +785,10 @@ void Decimators::decimate16_sup(SampleVector::i } } -template -void Decimators::decimate32_inf(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate32_inf(SampleVector::iterator* it, const T* buf, qint32 len) { - AccuType xreal[8], yimag[8]; + StorageType xreal[8], yimag[8]; for (int pos = 0; pos < len - 63; ) { @@ -816,10 +816,10 @@ void Decimators::decimate32_inf(SampleVector::i } } -template -void Decimators::decimate32_inf(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate32_inf(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - AccuType xreal[8], yimag[8]; + StorageType xreal[8], yimag[8]; for (int pos = 0; pos < len - 31; ) { @@ -847,10 +847,10 @@ void Decimators::decimate32_inf(SampleVector::i } } -template -void Decimators::decimate32_sup(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate32_sup(SampleVector::iterator* it, const T* buf, qint32 len) { - AccuType xreal[8], yimag[8]; + StorageType xreal[8], yimag[8]; for (int pos = 0; pos < len - 63; ) { @@ -878,10 +878,10 @@ void Decimators::decimate32_sup(SampleVector::i } } -template -void Decimators::decimate32_sup(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate32_sup(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - AccuType xreal[8], yimag[8]; + StorageType xreal[8], yimag[8]; for (int pos = 0; pos < len - 31; ) { @@ -909,10 +909,10 @@ void Decimators::decimate32_sup(SampleVector::i } } -template -void Decimators::decimate64_inf(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate64_inf(SampleVector::iterator* it, const T* buf, qint32 len) { - AccuType xreal[16], yimag[16]; + StorageType xreal[16], yimag[16]; for (int pos = 0; pos < len - 127; ) { @@ -949,10 +949,10 @@ void Decimators::decimate64_inf(SampleVector::i } } -template -void Decimators::decimate64_inf(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate64_inf(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - AccuType xreal[16], yimag[16]; + StorageType xreal[16], yimag[16]; for (int pos = 0; pos < len - 63; ) { @@ -989,10 +989,10 @@ void Decimators::decimate64_inf(SampleVector::i } } -template -void Decimators::decimate64_sup(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate64_sup(SampleVector::iterator* it, const T* buf, qint32 len) { - AccuType xreal[16], yimag[16]; + StorageType xreal[16], yimag[16]; for (int pos = 0; pos < len - 127; ) { @@ -1029,10 +1029,10 @@ void Decimators::decimate64_sup(SampleVector::i } } -template -void Decimators::decimate64_sup(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate64_sup(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - AccuType xreal[16], yimag[16]; + StorageType xreal[16], yimag[16]; for (int pos = 0; pos < len - 63; ) { @@ -1069,10 +1069,10 @@ void Decimators::decimate64_sup(SampleVector::i } } -template -void Decimators::decimate2_cen(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate2_cen(SampleVector::iterator* it, const T* buf, qint32 len) { - AccuType intbuf[2]; + StorageType intbuf[2]; for (int pos = 0; pos < len - 3; pos += 4) { @@ -1092,10 +1092,10 @@ void Decimators::decimate2_cen(SampleVector::it } } -template -void Decimators::decimate2_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate2_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - AccuType intbuf[2]; + StorageType intbuf[2]; for (int pos = 0; pos < len - 1; pos += 2) { @@ -1114,10 +1114,10 @@ void Decimators::decimate2_cen(SampleVector::it } } -template -void Decimators::decimate4_cen(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate4_cen(SampleVector::iterator* it, const T* buf, qint32 len) { - AccuType intbuf[4]; + StorageType intbuf[4]; for (int pos = 0; pos < len - 7; pos += 8) { @@ -1149,10 +1149,10 @@ void Decimators::decimate4_cen(SampleVector::it } } -template -void Decimators::decimate4_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate4_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - AccuType intbuf[4]; + StorageType intbuf[4]; for (int pos = 0; pos < len - 3; pos += 4) { @@ -1184,10 +1184,10 @@ void Decimators::decimate4_cen(SampleVector::it } } -template -void Decimators::decimate8_cen(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate8_cen(SampleVector::iterator* it, const T* buf, qint32 len) { - AccuType intbuf[8]; + StorageType intbuf[8]; for (int pos = 0; pos < len - 15; pos += 16) { @@ -1244,10 +1244,10 @@ void Decimators::decimate8_cen(SampleVector::it } } -template -void Decimators::decimate8_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate8_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - AccuType intbuf[8]; + StorageType intbuf[8]; for (int pos = 0; pos < len - 7; pos += 8) { @@ -1304,10 +1304,10 @@ void Decimators::decimate8_cen(SampleVector::it } } -template -void Decimators::decimate16_cen(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate16_cen(SampleVector::iterator* it, const T* buf, qint32 len) { - AccuType intbuf[16]; + StorageType intbuf[16]; for (int pos = 0; pos < len - 31; pos += 32) { @@ -1413,10 +1413,10 @@ void Decimators::decimate16_cen(SampleVector::i } } -template -void Decimators::decimate16_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate16_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - AccuType intbuf[16]; + StorageType intbuf[16]; for (int pos = 0; pos < len - 15; pos += 16) { @@ -1522,10 +1522,10 @@ void Decimators::decimate16_cen(SampleVector::i } } -template -void Decimators::decimate32_cen(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate32_cen(SampleVector::iterator* it, const T* buf, qint32 len) { - AccuType intbuf[32]; + StorageType intbuf[32]; for (int pos = 0; pos < len - 63; pos += 64) { @@ -1728,10 +1728,10 @@ void Decimators::decimate32_cen(SampleVector::i } } -template -void Decimators::decimate32_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate32_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - AccuType intbuf[32]; + StorageType intbuf[32]; for (int pos = 0; pos < len - 31; pos += 32) { @@ -1934,10 +1934,10 @@ void Decimators::decimate32_cen(SampleVector::i } } -template -void Decimators::decimate64_cen(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate64_cen(SampleVector::iterator* it, const T* buf, qint32 len) { - AccuType intbuf[64]; + StorageType intbuf[64]; for (int pos = 0; pos < len - 127; pos += 128) { @@ -2334,10 +2334,10 @@ void Decimators::decimate64_cen(SampleVector::i } } -template -void Decimators::decimate64_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate64_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - AccuType intbuf[64]; + StorageType intbuf[64]; for (int pos = 0; pos < len - 63; pos += 64) { diff --git a/sdrbench/mainbench.h b/sdrbench/mainbench.h index 8ee61f386..beb17e5fd 100644 --- a/sdrbench/mainbench.h +++ b/sdrbench/mainbench.h @@ -64,11 +64,7 @@ private: std::uniform_real_distribution m_uniform_distribution_f; std::uniform_int_distribution m_uniform_distribution_s16; -#ifdef SDR_RX_SAMPLE_24BIT - Decimators m_decimatorsII; -#else Decimators m_decimatorsII; -#endif DecimatorsIF m_decimatorsIF; DecimatorsFI m_decimatorsFI; DecimatorsFF m_decimatorsFF;