diff --git a/plugins/channelrx/demoddatv/demoddatv.pro b/plugins/channelrx/demoddatv/demoddatv.pro index 9279b0554..e623d00b9 100644 --- a/plugins/channelrx/demoddatv/demoddatv.pro +++ b/plugins/channelrx/demoddatv/demoddatv.pro @@ -11,6 +11,7 @@ QT += core gui multimedia multimediawidgets widgets opengl qml TARGET = demoddatv +DEFINES += _USE_MATH_DEFINES=1 DEFINES += USE_SSE2=1 QMAKE_CXXFLAGS += -msse2 DEFINES += USE_SSE4_1=1 @@ -31,26 +32,41 @@ CONFIG(macx):INCLUDEPATH += "../../../../../boost_1_69_0" SOURCES += datvdemod.cpp\ datvdemodgui.cpp\ + datvdemodsettings.cpp \ datvdemodplugin.cpp\ datvideostream.cpp \ - datvideorender.cpp + datvideorender.cpp \ + leansdr/dvb.cpp \ + leansdr/filtergen.cpp \ + leansdr/framework.cpp \ + leansdr/math.cpp \ + leansdr/sdr.cpp HEADERS += datvdemod.h\ datvdemodgui.h\ + datvdemodsettings.h \ datvdemodplugin.h\ + leansdr/bch.h \ leansdr/convolutional.h \ + leansdr/crc.h \ + leansdr/discrmath.h \ leansdr/dsp.h \ leansdr/dvb.h \ + leansdr/dvbs2.h \ + leansdr/dvbs2_data.h \ leansdr/filtergen.h \ leansdr/framework.h \ leansdr/generic.h \ + leansdr/gui.h \ leansdr/hdlc.h \ leansdr/iess.h \ + leansdr/ldpc.h \ leansdr/math.h \ leansdr/rs.h \ leansdr/sdr.h \ + leansdr/softword.h \ leansdr/viterbi.h \ - datvconstellation.h \ + leansdr/datvconstellation.h \ datvvideoplayer.h \ datvideostream.h \ datvideorender.h diff --git a/plugins/channelrx/demoddatv/leansdr/dsp.h b/plugins/channelrx/demoddatv/leansdr/dsp.h index 9a51f2c9b..c946bb736 100644 --- a/plugins/channelrx/demoddatv/leansdr/dsp.h +++ b/plugins/channelrx/demoddatv/leansdr/dsp.h @@ -297,7 +297,7 @@ struct fir_filter : runnable } } - unsigned long count = min((in.readable() - ncoeffs) / decim, + long count = min((in.readable() - ncoeffs) / decim, out.writable()); T *pin = in.rd() + ncoeffs, *pend = pin + count * decim, *pout = out.wr(); // TBD use coeffs when current_freq=0 (fewer mults if float) @@ -315,11 +315,11 @@ struct fir_filter : runnable } private: - unsigned int ncoeffs; + int ncoeffs; Tc *coeffs; pipereader in; pipewriter out; - unsigned int decim; + int decim; T *shifted_coeffs; float current_freq; diff --git a/plugins/channelrx/demoddatv/leansdr/dvb.h b/plugins/channelrx/demoddatv/leansdr/dvb.h index f5735ef7a..a3d1d8a10 100644 --- a/plugins/channelrx/demoddatv/leansdr/dvb.h +++ b/plugins/channelrx/demoddatv/leansdr/dvb.h @@ -650,13 +650,13 @@ static struct fec_spec const uint16_t *polys; // [bits_out] } fec_specs[FEC_COUNT] = { - [FEC12] = {1, 2, polys_fec12}, - [FEC23] = {2, 3, polys_fec23}, - [FEC46] = {4, 6, polys_fec46}, - [FEC34] = {3, 4, polys_fec34}, - [FEC56] = {5, 6, polys_fec56}, - [FEC78] = {7, 8, polys_fec78}, - [FEC45] = {4, 5, polys_fec45}, // Non-standard + {1, 2, polys_fec12}, + {2, 3, polys_fec23}, + {4, 6, polys_fec46}, + {3, 4, polys_fec34}, + {5, 6, polys_fec56}, + {7, 8, polys_fec78}, + {4, 5, polys_fec45}, // Non-standard }; struct dvb_convol : runnable diff --git a/plugins/channelrx/demoddatv/leansdr/framework.h b/plugins/channelrx/demoddatv/leansdr/framework.h index 5cb68dd5a..cdb380ebe 100644 --- a/plugins/channelrx/demoddatv/leansdr/framework.h +++ b/plugins/channelrx/demoddatv/leansdr/framework.h @@ -17,6 +17,9 @@ #ifndef LEANSDR_FRAMEWORK_H #define LEANSDR_FRAMEWORK_H +#include +#include + #include #include #include diff --git a/plugins/channelrx/demoddatv/leansdr/generic.h b/plugins/channelrx/demoddatv/leansdr/generic.h index 68371af80..11d13c88e 100644 --- a/plugins/channelrx/demoddatv/leansdr/generic.h +++ b/plugins/channelrx/demoddatv/leansdr/generic.h @@ -20,7 +20,13 @@ #include #include #include + +#ifdef _MSC_VER +#include +#include +#else #include +#endif #include "leansdr/math.h" @@ -302,7 +308,7 @@ struct itemcounter : runnable template struct decimator : runnable { - unsigned int d; + int d; decimator(scheduler *sch, int _d, pipebuf &_in, pipebuf &_out) : runnable(sch, "decimator"), @@ -312,7 +318,7 @@ struct decimator : runnable } void run() { - unsigned long count = min(in.readable() / d, out.writable()); + long count = min(in.readable() / d, out.writable()); T *pin = in.rd(), *pend = pin + count * d, *pout = out.wr(); for (; pin < pend; pin += d, ++pout) *pout = *pin; diff --git a/plugins/channelrx/demoddatv/leansdr/sdr.cpp b/plugins/channelrx/demoddatv/leansdr/sdr.cpp index 3cb04c108..42721b642 100644 --- a/plugins/channelrx/demoddatv/leansdr/sdr.cpp +++ b/plugins/channelrx/demoddatv/leansdr/sdr.cpp @@ -5,15 +5,15 @@ namespace leansdr const char *cstln_base::names[] = { - [BPSK] = "BPSK", - [QPSK] = "QPSK", - [PSK8] = "8PSK", - [APSK16] = "16APSK", - [APSK32] = "32APSK", - [APSK64E] = "64APSKe", - [QAM16] = "16QAM", - [QAM64] = "64QAM", - [QAM256] = "256QAM" + "BPSK", + "QPSK", + "8PSK", + "16APSK", + "32APSK", + "64APSKe", + "16QAM", + "64QAM", + "256QAM" }; @@ -95,4 +95,4 @@ void to_softsymb(const full_ss *fss, llr_ss *ss) } } -} // leansdr \ No newline at end of file +} // leansdr diff --git a/plugins/channelrx/demoddatv/leansdr/sdr.h b/plugins/channelrx/demoddatv/leansdr/sdr.h index 1fc26d594..8427f8feb 100644 --- a/plugins/channelrx/demoddatv/leansdr/sdr.h +++ b/plugins/channelrx/demoddatv/leansdr/sdr.h @@ -763,7 +763,7 @@ struct cstln_lut : cstln_base void make_lut_from_symbols(float mer) { // Note: Excessively low values of MER will break 16APSK and 32APSK. - float sigma = cstln_amp * exp10f(-mer / 20); + float sigma = cstln_amp * pow(10.0, (-mer / 20)); // Precomputed values. // Shared scope so that we don't have to reset dists2[nsymbols..] to -1.