diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Buffer.h | 3 | ||||
-rw-r--r-- | src/GainControl.cpp | 24 | ||||
-rw-r--r-- | src/Utils.cpp | 4 |
3 files changed, 16 insertions, 15 deletions
diff --git a/src/Buffer.h b/src/Buffer.h index 2c2a65e..a8130ed 100644 --- a/src/Buffer.h +++ b/src/Buffer.h @@ -34,11 +34,12 @@ #include <vector> #include <memory> #include <complex> +#include <cstdint> #include "fpm/fixed.hpp" typedef std::complex<float> complexf; -using fixed_16 = fpm::fixed<std::int16_t, std::int32_t, 14>; +using fixed_16 = fpm::fixed<int16_t, int32_t, 14>; typedef std::complex<fixed_16> complexfix; typedef std::complex<fpm::fixed_16_16> complexfix_wide; diff --git a/src/GainControl.cpp b/src/GainControl.cpp index 84cf065..e3e280f 100644 --- a/src/GainControl.cpp +++ b/src/GainControl.cpp @@ -35,7 +35,7 @@ #ifdef __SSE__ # include <xmmintrin.h> -union __u128 { +union u128_union_t { __m128 m; float f[4]; }; @@ -122,7 +122,7 @@ int GainControl::internal_process(Buffer* const dataIn, Buffer* dataOut) __m128* out = reinterpret_cast<__m128*>(dataOut->getData()); size_t sizeIn = dataIn->getLength() / sizeof(__m128); size_t sizeOut = dataOut->getLength() / sizeof(__m128); - __u128 gain128; + u128_union_t gain128; if ((sizeIn % m_frameSize) != 0) { @@ -200,10 +200,10 @@ __m128 GainControl::computeGainFix(const __m128* in, size_t sizeIn) __m128 GainControl::computeGainMax(const __m128* in, size_t sizeIn) { - __u128 gain128; - __u128 min128; - __u128 max128; - __u128 tmp128; + u128_union_t gain128; + u128_union_t min128; + u128_union_t max128; + u128_union_t tmp128; static const __m128 factor128 = _mm_set1_ps(0x7fff); //////////////////////////////////////////////////////////////////////// @@ -250,10 +250,10 @@ __m128 GainControl::computeGainMax(const __m128* in, size_t sizeIn) __m128 GainControl::computeGainVar(const __m128* in, size_t sizeIn) { - __u128 gain128; - __u128 mean128; - __u128 var128; - __u128 tmp128; + u128_union_t gain128; + u128_union_t mean128; + u128_union_t var128; + u128_union_t tmp128; static const __m128 factor128 = _mm_set1_ps(0x7fff); mean128.m = _mm_setzero_ps(); @@ -297,8 +297,8 @@ __m128 GainControl::computeGainVar(const __m128* in, size_t sizeIn) var128.m = _mm_add_ps(var128.m, q128); /* - __u128 udiff128; udiff128.m = diff128; - __u128 udelta128; udelta128.m = delta128; + u128_union_t udiff128; udiff128.m = diff128; + u128_union_t udelta128; udelta128.m = delta128; for (int off=0; off<4; off+=2) { printf("S %zu, %.2f+%.2fj\t", sample, diff --git a/src/Utils.cpp b/src/Utils.cpp index 78f36f0..23e0aa5 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -89,8 +89,8 @@ void printUsage(const char* progName) "\n\t" #if defined(HAVE_OUTPUT_UHD) " [-G txgain]" - " [-T filter_taps_file]" #endif // defined(HAVE_OUTPUT_UHD) + " [-T filter_taps_file]" " [-a gain]" " [-c clockrate]" "\n\t" @@ -114,9 +114,9 @@ void printUsage(const char* progName) fprintf(out, "-u device: Use UHD output with given device string. (use "" for default device)\n"); fprintf(out, "-F frequency: Set the transmit frequency when using UHD output. (mandatory option when using UHD)\n"); fprintf(out, "-G txgain: Set the transmit gain for the UHD driver (default: 0)\n"); +#endif // defined(HAVE_OUTPUT_UHD) fprintf(out, "-T taps_file: Enable filtering before the output, using the specified file containing the filter taps.\n"); fprintf(out, " Use 'default' as taps_file to use the internal taps.\n"); -#endif // defined(HAVE_OUTPUT_UHD) fprintf(out, "-a gain: Apply digital amplitude gain.\n"); fprintf(out, "-c rate: Set the DAC clock rate and enable Cic Equalisation.\n"); fprintf(out, "-g gainmode: Set computation gain mode: fix, max or var\n"); |