From f2a50c0c0fa9a6b1ab50a06f157af72b97ce8e11 Mon Sep 17 00:00:00 2001 From: f4exb Date: Fri, 4 Nov 2016 22:47:09 +0100 Subject: [PATCH] Use even/odd FIR filter half band interpolator only if SIMD is available --- sdrbase/dsp/upchannelizer.cpp | 21 +++++++++++++++++++++ sdrbase/dsp/upchannelizer.h | 9 +++++++++ 2 files changed, 30 insertions(+) diff --git a/sdrbase/dsp/upchannelizer.cpp b/sdrbase/dsp/upchannelizer.cpp index 5fcbcbd3f..896af2ec2 100644 --- a/sdrbase/dsp/upchannelizer.cpp +++ b/sdrbase/dsp/upchannelizer.cpp @@ -201,6 +201,7 @@ void UpChannelizer::applyConfiguration() } } +#ifdef USE_SIMD UpChannelizer::FilterStage::FilterStage(Mode mode) : m_filter(new IntHalfbandFilterEO1), m_workFunction(0) @@ -219,6 +220,26 @@ UpChannelizer::FilterStage::FilterStage(Mode mode) : break; } } +#else +UpChannelizer::FilterStage::FilterStage(Mode mode) : + m_filter(new IntHalfbandFilterDB), + m_workFunction(0) +{ + switch(mode) { + case ModeCenter: + m_workFunction = &IntHalfbandFilterDB::workInterpolateCenter; + break; + + case ModeLowerHalf: + m_workFunction = &IntHalfbandFilterDB::workInterpolateLowerHalf; + break; + + case ModeUpperHalf: + m_workFunction = &IntHalfbandFilterDB::workInterpolateUpperHalf; + break; + } +} +#endif UpChannelizer::FilterStage::~FilterStage() { diff --git a/sdrbase/dsp/upchannelizer.h b/sdrbase/dsp/upchannelizer.h index f08e7efee..b6dcb20e7 100644 --- a/sdrbase/dsp/upchannelizer.h +++ b/sdrbase/dsp/upchannelizer.h @@ -23,7 +23,11 @@ #include #include "util/export.h" #include "util/message.h" +#ifdef USE_SIMD #include "dsp/inthalfbandfiltereo1.h" +#else +#include "dsp/inthalfbandfilterdb.h" +#endif #define UPCHANNELIZER_HB_FILTER_ORDER 96 @@ -69,8 +73,13 @@ protected: ModeUpperHalf }; +#ifdef USE_SIMD typedef bool (IntHalfbandFilterEO1::*WorkFunction)(Sample* sIn, Sample *sOut); IntHalfbandFilterEO1* m_filter; +#else + typedef bool (IntHalfbandFilterDB::*WorkFunction)(Sample* sIn, Sample *sOut); + IntHalfbandFilterDB* m_filter; +#endif WorkFunction m_workFunction; FilterStage(Mode mode);