From 645b9e87fc5dab2cf87bfef1d5b2ba2ce2f85089 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 20 Mar 2018 14:20:55 +0100 Subject: Simplify QpskSymbolMapper a bit --- src/QpskSymbolMapper.cpp | 36 +++++++++++++----------------------- src/QpskSymbolMapper.h | 7 ------- 2 files changed, 13 insertions(+), 30 deletions(-) diff --git a/src/QpskSymbolMapper.cpp b/src/QpskSymbolMapper.cpp index 7c4299c..e26853a 100644 --- a/src/QpskSymbolMapper.cpp +++ b/src/QpskSymbolMapper.cpp @@ -19,36 +19,25 @@ along with ODR-DabMod. If not, see . */ -#include "QpskSymbolMapper.h" -#include "PcDebug.h" - -#include -#include +#include +#include +#include #include #include -#include +#include #ifdef __SSE__ # include #endif // __SSE__ -typedef std::complex complexf; +#include "QpskSymbolMapper.h" +#include "PcDebug.h" + +typedef std::complex complexf; QpskSymbolMapper::QpskSymbolMapper(size_t carriers) : ModCodec(), - d_carriers(carriers) -{ - PDEBUG("QpskSymbolMapper::QpskSymbolMapper(%zu) @ %p\n", carriers, this); - -} - - -QpskSymbolMapper::~QpskSymbolMapper() -{ - PDEBUG("QpskSymbolMapper::~QpskSymbolMapper() @ %p\n", this); - -} - + d_carriers(carriers) { } int QpskSymbolMapper::process(Buffer* const dataIn, Buffer* dataOut) { @@ -62,10 +51,11 @@ int QpskSymbolMapper::process(Buffer* const dataIn, Buffer* dataOut) __m128* out = reinterpret_cast<__m128*>(dataOut->getData()); if (dataIn->getLength() % (d_carriers / 4) != 0) { - fprintf(stderr, "%zu (input size) %% (%zu (carriers) / 4) != 0\n", - dataIn->getLength(), d_carriers); throw std::runtime_error( - "QpskSymbolMapper::process input size not valid!"); + "QpskSymbolMapper::process input size not valid: " + + std::to_string(dataIn->getLength()) + + "(input size) % (" + std::to_string(d_carriers) + + " (carriers) / 4) != 0"); } const static __m128 symbols[16] = { diff --git a/src/QpskSymbolMapper.h b/src/QpskSymbolMapper.h index 98f2e60..dbcf4dd 100644 --- a/src/QpskSymbolMapper.h +++ b/src/QpskSymbolMapper.h @@ -25,20 +25,13 @@ # include #endif - #include "ModPlugin.h" - #include - class QpskSymbolMapper : public ModCodec { public: QpskSymbolMapper(size_t carriers); - virtual ~QpskSymbolMapper(); - QpskSymbolMapper(QpskSymbolMapper&); - QpskSymbolMapper& operator=(QpskSymbolMapper&); - int process(Buffer* const dataIn, Buffer* dataOut); const char* name() { return "QpskSymbolMapper"; } -- cgit v1.2.3