1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-24 10:50:29 -05:00

Use even/odd FIR filter half band interpolator only if SIMD is available

This commit is contained in:
f4exb 2016-11-04 22:47:09 +01:00
parent 9f74c82715
commit f2a50c0c0f
2 changed files with 30 additions and 0 deletions

View File

@ -201,6 +201,7 @@ void UpChannelizer::applyConfiguration()
}
}
#ifdef USE_SIMD
UpChannelizer::FilterStage::FilterStage(Mode mode) :
m_filter(new IntHalfbandFilterEO1<UPCHANNELIZER_HB_FILTER_ORDER>),
m_workFunction(0)
@ -219,6 +220,26 @@ UpChannelizer::FilterStage::FilterStage(Mode mode) :
break;
}
}
#else
UpChannelizer::FilterStage::FilterStage(Mode mode) :
m_filter(new IntHalfbandFilterDB<UPCHANNELIZER_HB_FILTER_ORDER>),
m_workFunction(0)
{
switch(mode) {
case ModeCenter:
m_workFunction = &IntHalfbandFilterDB<UPCHANNELIZER_HB_FILTER_ORDER>::workInterpolateCenter;
break;
case ModeLowerHalf:
m_workFunction = &IntHalfbandFilterDB<UPCHANNELIZER_HB_FILTER_ORDER>::workInterpolateLowerHalf;
break;
case ModeUpperHalf:
m_workFunction = &IntHalfbandFilterDB<UPCHANNELIZER_HB_FILTER_ORDER>::workInterpolateUpperHalf;
break;
}
}
#endif
UpChannelizer::FilterStage::~FilterStage()
{

View File

@ -23,7 +23,11 @@
#include <QMutex>
#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<UPCHANNELIZER_HB_FILTER_ORDER>::*WorkFunction)(Sample* sIn, Sample *sOut);
IntHalfbandFilterEO1<UPCHANNELIZER_HB_FILTER_ORDER>* m_filter;
#else
typedef bool (IntHalfbandFilterDB<UPCHANNELIZER_HB_FILTER_ORDER>::*WorkFunction)(Sample* sIn, Sample *sOut);
IntHalfbandFilterDB<UPCHANNELIZER_HB_FILTER_ORDER>* m_filter;
#endif
WorkFunction m_workFunction;
FilterStage(Mode mode);