1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-09-28 15:56:33 -04:00

Allow SSE 4.1 optimization on the down channelizer

This commit is contained in:
f4exb 2016-11-07 18:51:32 +01:00
parent aef5e722c1
commit 3505e1b095
2 changed files with 30 additions and 0 deletions

View File

@ -186,6 +186,26 @@ void DownChannelizer::applyConfiguration()
}
}
#ifdef USE_SSE4_1
DownChannelizer::FilterStage::FilterStage(Mode mode) :
m_filter(new IntHalfbandFilterEO1<DOWNCHANNELIZER_HB_FILTER_ORDER>),
m_workFunction(0)
{
switch(mode) {
case ModeCenter:
m_workFunction = &IntHalfbandFilterEO1<DOWNCHANNELIZER_HB_FILTER_ORDER>::workDecimateCenter;
break;
case ModeLowerHalf:
m_workFunction = &IntHalfbandFilterEO1<DOWNCHANNELIZER_HB_FILTER_ORDER>::workDecimateLowerHalf;
break;
case ModeUpperHalf:
m_workFunction = &IntHalfbandFilterEO1<DOWNCHANNELIZER_HB_FILTER_ORDER>::workDecimateUpperHalf;
break;
}
}
#else
DownChannelizer::FilterStage::FilterStage(Mode mode) :
m_filter(new IntHalfbandFilterDB<DOWNCHANNELIZER_HB_FILTER_ORDER>),
m_workFunction(0)
@ -204,6 +224,7 @@ DownChannelizer::FilterStage::FilterStage(Mode mode) :
break;
}
}
#endif
DownChannelizer::FilterStage::~FilterStage()
{

View File

@ -23,7 +23,11 @@
#include <QMutex>
#include "util/export.h"
#include "util/message.h"
#ifdef USE_SSE4_1
#include "dsp/inthalfbandfiltereo1.h"
#else
#include "dsp/inthalfbandfilterdb.h"
#endif
#define DOWNCHANNELIZER_HB_FILTER_ORDER 48
@ -69,8 +73,13 @@ protected:
ModeUpperHalf
};
#ifdef USE_SSE4_1
typedef bool (IntHalfbandFilterEO1<DOWNCHANNELIZER_HB_FILTER_ORDER>::*WorkFunction)(Sample* s);
IntHalfbandFilterEO1<DOWNCHANNELIZER_HB_FILTER_ORDER>* m_filter;
#else
typedef bool (IntHalfbandFilterDB<DOWNCHANNELIZER_HB_FILTER_ORDER>::*WorkFunction)(Sample* s);
IntHalfbandFilterDB<DOWNCHANNELIZER_HB_FILTER_ORDER>* m_filter;
#endif
WorkFunction m_workFunction;
FilterStage(Mode mode);