Down channelizer optimization: use even/odd technique halfband filter

This commit is contained in:
f4exb 2018-05-01 22:02:30 +02:00
parent a81e2f297a
commit 4924e3edbd
2 changed files with 30 additions and 59 deletions

View File

@ -190,70 +190,48 @@ void DownChannelizer::applyConfiguration()
#ifdef SDR_RX_SAMPLE_24BIT
DownChannelizer::FilterStage::FilterStage(Mode mode) :
m_filter(new IntHalfbandFilterDB<qint64, DOWNCHANNELIZER_HB_FILTER_ORDER>),
m_filter(new IntHalfbandFilterEO2<DOWNCHANNELIZER_HB_FILTER_ORDER>),
m_workFunction(0),
m_mode(mode),
m_sse(false)
m_sse(true)
{
switch(mode) {
case ModeCenter:
m_workFunction = &IntHalfbandFilterDB<qint64, DOWNCHANNELIZER_HB_FILTER_ORDER>::workDecimateCenter;
m_workFunction = &IntHalfbandFilterEO2<DOWNCHANNELIZER_HB_FILTER_ORDER>::workDecimateCenter;
break;
case ModeLowerHalf:
m_workFunction = &IntHalfbandFilterDB<qint64, DOWNCHANNELIZER_HB_FILTER_ORDER>::workDecimateLowerHalf;
m_workFunction = &IntHalfbandFilterEO2<DOWNCHANNELIZER_HB_FILTER_ORDER>::workDecimateLowerHalf;
break;
case ModeUpperHalf:
m_workFunction = &IntHalfbandFilterDB<qint64, DOWNCHANNELIZER_HB_FILTER_ORDER>::workDecimateUpperHalf;
m_workFunction = &IntHalfbandFilterEO2<DOWNCHANNELIZER_HB_FILTER_ORDER>::workDecimateUpperHalf;
break;
}
}
#else
#ifdef USE_SSE4_1
DownChannelizer::FilterStage::FilterStage(Mode mode) :
m_filter(new IntHalfbandFilterEO1<DOWNCHANNELIZER_HB_FILTER_ORDER>),
m_workFunction(0),
m_mode(mode),
m_sse(true)
m_filter(new IntHalfbandFilterEO1<DOWNCHANNELIZER_HB_FILTER_ORDER>),
m_workFunction(0),
m_mode(mode),
m_sse(true)
{
switch(mode) {
case ModeCenter:
m_workFunction = &IntHalfbandFilterEO1<DOWNCHANNELIZER_HB_FILTER_ORDER>::workDecimateCenter;
break;
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 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<qint32, DOWNCHANNELIZER_HB_FILTER_ORDER>),
m_workFunction(0),
m_mode(mode),
m_sse(false)
{
switch(mode) {
case ModeCenter:
m_workFunction = &IntHalfbandFilterDB<qint32, DOWNCHANNELIZER_HB_FILTER_ORDER>::workDecimateCenter;
break;
case ModeLowerHalf:
m_workFunction = &IntHalfbandFilterDB<qint32, DOWNCHANNELIZER_HB_FILTER_ORDER>::workDecimateLowerHalf;
break;
case ModeUpperHalf:
m_workFunction = &IntHalfbandFilterDB<qint32, DOWNCHANNELIZER_HB_FILTER_ORDER>::workDecimateUpperHalf;
break;
}
case ModeUpperHalf:
m_workFunction = &IntHalfbandFilterEO1<DOWNCHANNELIZER_HB_FILTER_ORDER>::workDecimateUpperHalf;
break;
}
}
#endif
#endif
DownChannelizer::FilterStage::~FilterStage()
{
delete m_filter;

View File

@ -23,15 +23,12 @@
#include <QMutex>
#include "export.h"
#include "util/message.h"
#ifdef SDR_RX_SAMPLE_24BIT
#include "dsp/inthalfbandfilterdb.h"
#else
#ifdef USE_SSE4_1
#include "dsp/inthalfbandfiltereo2.h"
#else // SDR_RX_SAMPLE_24BIT
#include "dsp/inthalfbandfiltereo1.h"
#else
#include "dsp/inthalfbandfilterdb.h"
#endif
#endif
#endif // SDR_RX_SAMPLE_24BIT
#define DOWNCHANNELIZER_HB_FILTER_ORDER 48
@ -84,17 +81,13 @@ protected:
};
#ifdef SDR_RX_SAMPLE_24BIT
typedef bool (IntHalfbandFilterDB<qint64, DOWNCHANNELIZER_HB_FILTER_ORDER>::*WorkFunction)(Sample* s);
IntHalfbandFilterDB<qint64, DOWNCHANNELIZER_HB_FILTER_ORDER>* m_filter;
typedef bool (IntHalfbandFilterEO2<DOWNCHANNELIZER_HB_FILTER_ORDER>::*WorkFunction)(Sample* s);
IntHalfbandFilterEO2<DOWNCHANNELIZER_HB_FILTER_ORDER>* m_filter;
#else
#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<qint32, DOWNCHANNELIZER_HB_FILTER_ORDER>::*WorkFunction)(Sample* s);
IntHalfbandFilterDB<qint32, DOWNCHANNELIZER_HB_FILTER_ORDER>* m_filter;
#endif
typedef bool (IntHalfbandFilterEO1<DOWNCHANNELIZER_HB_FILTER_ORDER>::*WorkFunction)(Sample* s);
IntHalfbandFilterEO1<DOWNCHANNELIZER_HB_FILTER_ORDER>* m_filter;
#endif
WorkFunction m_workFunction;
Mode m_mode;
bool m_sse;