From 5a594629b350873e043709d648c06c3a065f868c Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 21 Jan 2018 01:19:35 +0100 Subject: [PATCH 01/27] Use FixReal in place of qint16 --- sdrbase/dsp/dspdevicesourceengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdrbase/dsp/dspdevicesourceengine.cpp b/sdrbase/dsp/dspdevicesourceengine.cpp index a641de94e..6cc6086c6 100644 --- a/sdrbase/dsp/dspdevicesourceengine.cpp +++ b/sdrbase/dsp/dspdevicesourceengine.cpp @@ -178,7 +178,7 @@ void DSPDeviceSourceEngine::dcOffset(SampleVector::iterator begin, SampleVector: double count; int io = 0; int qo = 0; - Sample corr((qint16)m_iOffset, (qint16)m_qOffset); + Sample corr((FixReal)m_iOffset, (FixReal)m_qOffset); // sum and correct in one pass for(SampleVector::iterator it = begin; it < end; it++) From f34750716aa36ffa742d6fdd68484be7bb07aff1 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 21 Jan 2018 01:45:58 +0100 Subject: [PATCH 02/27] Added define for 32 bit sample compilation --- sdrbase/dsp/dsptypes.h | 8 ++++++-- sdrbase/dsp/inthalfbandfiltereo1.h | 24 ++++++++++++------------ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/sdrbase/dsp/dsptypes.h b/sdrbase/dsp/dsptypes.h index 3ac484eb0..8d8c92e6c 100644 --- a/sdrbase/dsp/dsptypes.h +++ b/sdrbase/dsp/dsptypes.h @@ -22,13 +22,17 @@ #include #include +#ifdef SAMPLE_32BIT +#define SDR_SAMP_SZ 32 // internal fixed arithmetic sample size +typedef qint32 FixReal; +#else #define SDR_SAMP_SZ 16 // internal fixed arithmetic sample size +typedef qint16 FixReal; +#endif typedef float Real; typedef std::complex Complex; -typedef qint16 FixReal; - #pragma pack(push, 1) struct Sample { diff --git a/sdrbase/dsp/inthalfbandfiltereo1.h b/sdrbase/dsp/inthalfbandfiltereo1.h index cef06ea27..b69c1da3a 100644 --- a/sdrbase/dsp/inthalfbandfiltereo1.h +++ b/sdrbase/dsp/inthalfbandfiltereo1.h @@ -70,7 +70,7 @@ public: { case 0: // insert sample into ring-buffer - storeSample(0, 0); + storeSample((FixReal) 0, (FixReal) 0); // save result doFIR(SampleOut); // advance write-pointer @@ -131,7 +131,7 @@ public: bool workDecimateCenter(int32_t *x, int32_t *y) { // insert sample into ring-buffer - storeSample(*x, *y); + storeSample32(*x, *y); switch(m_state) { @@ -215,7 +215,7 @@ public: { case 0: // insert sample into ring-buffer - storeSample(0, 0); + storeSample((FixReal) 0, (FixReal) 0); // save result doFIR(&s); @@ -251,7 +251,7 @@ public: case 2: // insert sample into ring-buffer - storeSample(0, 0); + storeSample((FixReal) 0, (FixReal) 0); // save result doFIR(&s); @@ -414,7 +414,7 @@ public: { case 0: // insert sample into ring-buffer - storeSample(0, 0); + storeSample((FixReal) 0, (FixReal) 0); // save result doFIR(&s); @@ -450,7 +450,7 @@ public: case 2: // insert sample into ring-buffer - storeSample(0, 0); + storeSample((FixReal) 0, (FixReal) 0); // save result doFIR(&s); @@ -565,10 +565,10 @@ public: void myDecimate(int32_t x1, int32_t y1, int32_t *x2, int32_t *y2) { - storeSample(x1, y1); + storeSample32(x1, y1); advancePointer(); - storeSample(*x2, *y2); + storeSample32(*x2, *y2); doFIR(x2, y2); advancePointer(); } @@ -580,7 +580,7 @@ public: doFIR(sample1); advancePointer(); - storeSample(0, 0); + storeSample((FixReal) 0, (FixReal) 0); doFIR(sample2); advancePointer(); } @@ -588,11 +588,11 @@ public: /** Simple zero stuffing and filter */ void myInterpolateZeroStuffing(int32_t *x1, int32_t *y1, int32_t *x2, int32_t *y2) { - storeSample(*x1, *y1); + storeSample32(*x1, *y1); doFIR(x1, y1); advancePointer(); - storeSample(0, 0); + storeSample32(0, 0); doFIR(x2, y2); advancePointer(); } @@ -648,7 +648,7 @@ protected: } } - void storeSample(int32_t x, int32_t y) + void storeSample32(int32_t x, int32_t y) { if ((m_ptr % 2) == 0) { From 491b8a6d3340c0f1f2724b548258a74ff4d3f796 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 21 Jan 2018 10:57:04 +0100 Subject: [PATCH 03/27] Replaced hardcoded bit scaling literals by defines --- devices/plutosdr/deviceplutosdrbox.cpp | 3 +- plugins/channelrx/chanalyzer/chanalyzer.cpp | 7 ++-- plugins/channelrx/chanalyzerng/chanalyzerng.h | 6 +-- .../chanalyzerng/chanalyzernggui.cpp | 2 - plugins/channelrx/demodam/amdemod.cpp | 1 - plugins/channelrx/demodam/amdemod.h | 7 ++-- plugins/channelrx/demodatv/atvdemod.cpp | 3 +- plugins/channelrx/demodatv/atvdemodgui.cpp | 2 +- plugins/channelrx/demodbfm/bfmdemod.cpp | 6 +-- plugins/channelrx/demoddsd/dsddemod.cpp | 6 ++- plugins/channelrx/demodlora/lorademod.cpp | 2 +- plugins/channelrx/demodnfm/nfmdemod.cpp | 2 +- plugins/channelrx/demodssb/ssbdemod.cpp | 7 ++-- plugins/channelrx/demodwfm/wfmdemod.cpp | 3 +- plugins/channelrx/tcpsrc/tcpsrc.cpp | 6 +-- plugins/channelrx/udpsrc/udpsrc.cpp | 20 ++++----- plugins/channeltx/modam/ammod.cpp | 4 +- plugins/channeltx/modatv/atvmod.cpp | 4 +- plugins/channeltx/modatv/atvmodsettings.cpp | 2 +- plugins/channeltx/modnfm/nfmmod.cpp | 8 ++-- plugins/channeltx/modssb/ssbmod.cpp | 42 +++++-------------- plugins/channeltx/modwfm/wfmmod.cpp | 8 ++-- plugins/channeltx/udpsink/udpsink.cpp | 22 +++++----- .../plutosdroutput/plutosdroutput.cpp | 1 - sdrbase/dsp/dsptypes.h | 8 +++- sdrgui/dsp/scopevis.cpp | 6 +-- sdrgui/dsp/scopevismulti.h | 4 +- sdrgui/dsp/scopevisng.h | 4 +- sdrgui/dsp/spectrumvis.cpp | 4 +- 29 files changed, 89 insertions(+), 111 deletions(-) diff --git a/devices/plutosdr/deviceplutosdrbox.cpp b/devices/plutosdr/deviceplutosdrbox.cpp index f792f28d2..0ac0c7203 100644 --- a/devices/plutosdr/deviceplutosdrbox.cpp +++ b/devices/plutosdr/deviceplutosdrbox.cpp @@ -22,6 +22,7 @@ #include #include +#include "dsp/dsptypes.h" #include "dsp/wfir.h" #include "deviceplutosdr.h" #include "deviceplutosdrbox.h" @@ -638,7 +639,7 @@ void DevicePlutoSDRBox::formatFIRCoefficients(std::ostringstream& ostr, uint32_t WFIR::BasicFIR(fcoeffs, nbTaps, WFIR::LPF, normalizedBW, 0.0, normalizedBW < 0.2 ? WFIR::wtHAMMING : WFIR::wtBLACKMAN_HARRIS, 0.0); for (unsigned int i = 0; i < nbTaps; i++) { - ostr << (int16_t) (fcoeffs[i] * 32768.0) << ", " << (int16_t) (fcoeffs[i] * 32768.0) << std::endl; + ostr << (int16_t) (fcoeffs[i] * SDR_SCALEF) << ", " << (int16_t) (fcoeffs[i] * SDR_SCALEF) << std::endl; } delete[] fcoeffs; diff --git a/plugins/channelrx/chanalyzer/chanalyzer.cpp b/plugins/channelrx/chanalyzer/chanalyzer.cpp index b26308f38..cb4e627bd 100644 --- a/plugins/channelrx/chanalyzer/chanalyzer.cpp +++ b/plugins/channelrx/chanalyzer/chanalyzer.cpp @@ -92,7 +92,6 @@ void ChannelAnalyzer::feed(const SampleVector::const_iterator& begin, const Samp for(SampleVector::const_iterator it = begin; it < end; ++it) { - //Complex c(it->real() / 32768.0f, it->imag() / 32768.0f); Complex c(it->real(), it->imag()); c *= m_nco.nextIQ(); @@ -115,16 +114,16 @@ void ChannelAnalyzer::feed(const SampleVector::const_iterator& begin, const Samp if (!(m_undersampleCount++ & decim_mask)) { m_sum /= decim; - m_magsq = (m_sum.real() * m_sum.real() + m_sum.imag() * m_sum.imag())/ (1<<30); + Real re = m_sum.real() / SDR_SCALED; + Real im = m_sum.imag() / SDR_SCALED; + m_magsq = re*re + im*im; if (m_ssb & !m_usb) { // invert spectrum for LSB - //m_sampleBuffer.push_back(Sample(m_sum.imag() * 32768.0, m_sum.real() * 32768.0)); m_sampleBuffer.push_back(Sample(m_sum.imag(), m_sum.real())); } else { - //m_sampleBuffer.push_back(Sample(m_sum.real() * 32768.0, m_sum.imag() * 32768.0)); m_sampleBuffer.push_back(Sample(m_sum.real(), m_sum.imag())); } diff --git a/plugins/channelrx/chanalyzerng/chanalyzerng.h b/plugins/channelrx/chanalyzerng/chanalyzerng.h index c80c02ca7..5734ee235 100644 --- a/plugins/channelrx/chanalyzerng/chanalyzerng.h +++ b/plugins/channelrx/chanalyzerng/chanalyzerng.h @@ -229,16 +229,16 @@ private: if (!(m_undersampleCount++ & (decim - 1))) // counter LSB bit mask for decimation by 2^(m_scaleLog2 - 1) { m_sum /= decim; - m_magsq = (m_sum.real() * m_sum.real() + m_sum.imag() * m_sum.imag())/ (1<<30); + Real re = m_sum.real() / SDR_SCALED; + Real im = m_sum.imag() / SDR_SCALED; + m_magsq = re*re + im*im; if (m_running.m_ssb & !m_usb) { // invert spectrum for LSB - //m_sampleBuffer.push_back(Sample(m_sum.imag() * 32768.0, m_sum.real() * 32768.0)); m_sampleBuffer.push_back(Sample(m_sum.imag(), m_sum.real())); } else { - //m_sampleBuffer.push_back(Sample(m_sum.real() * 32768.0, m_sum.imag() * 32768.0)); m_sampleBuffer.push_back(Sample(m_sum.real(), m_sum.imag())); } diff --git a/plugins/channelrx/chanalyzerng/chanalyzernggui.cpp b/plugins/channelrx/chanalyzerng/chanalyzernggui.cpp index 6bc2a3561..b290020ef 100644 --- a/plugins/channelrx/chanalyzerng/chanalyzernggui.cpp +++ b/plugins/channelrx/chanalyzerng/chanalyzernggui.cpp @@ -464,8 +464,6 @@ bool ChannelAnalyzerNGGUI::setNewFinalRate(int spanLog2) } m_spanLog2 = spanLog2; - //m_rate = 48000 / (1<getInputSampleRate() / (1<real() / 32768.0, it->imag() / 32768.0); Complex c(it->real(), it->imag()); c *= m_nco.nextIQ(); diff --git a/plugins/channelrx/demodam/amdemod.h b/plugins/channelrx/demodam/amdemod.h index b6cc056e3..01ebe092a 100644 --- a/plugins/channelrx/demodam/amdemod.h +++ b/plugins/channelrx/demodam/amdemod.h @@ -161,8 +161,9 @@ private: void processOneSample(Complex &ci) { - Real magsq = ci.real() * ci.real() + ci.imag() * ci.imag(); - magsq /= (1<<30); + Real re = ci.real() / SDR_SCALED; + Real im = ci.imag() / SDR_SCALED; + Real magsq = re*re + im*im; m_movingAverage.feed(magsq); m_magsq = m_movingAverage.average(); m_magsqSum += magsq; @@ -209,7 +210,7 @@ private: Real attack = (m_squelchCount - 0.05f * m_settings.m_audioSampleRate) / (0.05f * m_settings.m_audioSampleRate); sample = demod * attack * 2048 * m_settings.m_volume; - if (m_settings.m_copyAudioToUDP) m_udpBufferAudio->write(demod * attack * 32768); + if (m_settings.m_copyAudioToUDP) m_udpBufferAudio->write(demod * attack * SDR_SCALEF); m_squelchOpen = true; } diff --git a/plugins/channelrx/demodatv/atvdemod.cpp b/plugins/channelrx/demodatv/atvdemod.cpp index 1635e6c7d..d1acb0355 100644 --- a/plugins/channelrx/demodatv/atvdemod.cpp +++ b/plugins/channelrx/demodatv/atvdemod.cpp @@ -338,8 +338,7 @@ void ATVDemod::demod(Complex& c) magSq = fltI*fltI + fltQ*fltQ; m_objMagSqAverage.feed(magSq); fltNorm = sqrt(magSq); - fltVal = fltNorm / (1<<15); - //fltVal = magSq / (1<<30); + fltVal = fltNorm / SDR_SCALEF; //********** Mini and Maxi Amplitude tracking ********** diff --git a/plugins/channelrx/demodatv/atvdemodgui.cpp b/plugins/channelrx/demodatv/atvdemodgui.cpp index 365ccb329..586f79d52 100644 --- a/plugins/channelrx/demodatv/atvdemodgui.cpp +++ b/plugins/channelrx/demodatv/atvdemodgui.cpp @@ -474,7 +474,7 @@ void ATVDemodGUI::tick() if (m_atvDemod) { m_objMagSqAverage.feed(m_atvDemod->getMagSq()); - double magSqDB = CalcDb::dbPower(m_objMagSqAverage.average() / (1<<30)); + double magSqDB = CalcDb::dbPower(m_objMagSqAverage.average() / (SDR_SCALED*SDR_SCALED)); ui->channePowerText->setText(tr("%1 dB").arg(magSqDB, 0, 'f', 1)); if (m_atvDemod->getBFOLocked()) { diff --git a/plugins/channelrx/demodbfm/bfmdemod.cpp b/plugins/channelrx/demodbfm/bfmdemod.cpp index 5dc2f6075..4f1a54774 100644 --- a/plugins/channelrx/demodbfm/bfmdemod.cpp +++ b/plugins/channelrx/demodbfm/bfmdemod.cpp @@ -125,7 +125,7 @@ void BFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto for (SampleVector::const_iterator it = begin; it != end; ++it) { - Complex c(it->real() / 32768.0f, it->imag() / 32768.0f); + Complex c(it->real() / SDR_SCALEF, it->imag() / SDR_SCALEF); c *= m_nco.nextIQ(); rf_out = m_rfFilter->runFilt(c, &rf); // filter RF before demod @@ -163,7 +163,7 @@ void BFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto if (!m_settings.m_showPilot) { - m_sampleBuffer.push_back(Sample(demod * (1<<15), 0.0)); + m_sampleBuffer.push_back(Sample(demod * SDR_SCALEF, 0.0)); } if (m_settings.m_rdsActive) @@ -197,7 +197,7 @@ void BFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto if (m_settings.m_showPilot) { - m_sampleBuffer.push_back(Sample(m_pilotPLLSamples[1] * (1<<15), 0.0)); // debug 38 kHz pilot + m_sampleBuffer.push_back(Sample(m_pilotPLLSamples[1] * SDR_SCALEF, 0.0)); // debug 38 kHz pilot } if (m_settings.m_lsbStereo) diff --git a/plugins/channelrx/demoddsd/dsddemod.cpp b/plugins/channelrx/demoddsd/dsddemod.cpp index a02c8c637..451e21497 100644 --- a/plugins/channelrx/demoddsd/dsddemod.cpp +++ b/plugins/channelrx/demoddsd/dsddemod.cpp @@ -128,7 +128,9 @@ void DSDDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto { qint16 sample, delayedSample; - Real magsq = ((ci.real()*ci.real() + ci.imag()*ci.imag())) / (1<<30); + Real re = ci.real() / SDR_SCALED; + Real im = ci.imag() / SDR_SCALED; + Real magsq = re*re + im*im; m_movingAverage.feed(magsq); m_magsqSum += magsq; @@ -140,7 +142,7 @@ void DSDDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto m_magsqCount++; - Real demod = 32768.0f * m_phaseDiscri.phaseDiscriminator(ci) * m_settings.m_demodGain; + Real demod = SDR_SCALEF * m_phaseDiscri.phaseDiscriminator(ci) * m_settings.m_demodGain; m_sampleCount++; // AF processing diff --git a/plugins/channelrx/demodlora/lorademod.cpp b/plugins/channelrx/demodlora/lorademod.cpp index fe2b96d0f..cd30f01a6 100644 --- a/plugins/channelrx/demodlora/lorademod.cpp +++ b/plugins/channelrx/demodlora/lorademod.cpp @@ -261,7 +261,7 @@ void LoRaDemod::feed(const SampleVector::const_iterator& begin, const SampleVect for(SampleVector::const_iterator it = begin; it < end; ++it) { - Complex c(it->real() / 32768.0f, it->imag() / 32768.0f); + Complex c(it->real() / SDR_SCALEF, it->imag() / SDR_SCALEF); c *= m_nco.nextIQ(); if(m_interpolator.decimate(&m_sampleDistanceRemain, c, &ci)) diff --git a/plugins/channelrx/demodnfm/nfmdemod.cpp b/plugins/channelrx/demodnfm/nfmdemod.cpp index bf2c1965d..7fdcb54eb 100644 --- a/plugins/channelrx/demodnfm/nfmdemod.cpp +++ b/plugins/channelrx/demodnfm/nfmdemod.cpp @@ -153,7 +153,7 @@ void NFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto Real demod = m_phaseDiscri.phaseDiscriminatorDelta(ci, magsqRaw, deviation); - Real magsq = magsqRaw / (1<<30); + Real magsq = magsqRaw / (SDR_SCALED*SDR_SCALED); m_movingAverage.feed(magsq); m_magsqSum += magsq; diff --git a/plugins/channelrx/demodssb/ssbdemod.cpp b/plugins/channelrx/demodssb/ssbdemod.cpp index 581608fb3..44f880e98 100644 --- a/plugins/channelrx/demodssb/ssbdemod.cpp +++ b/plugins/channelrx/demodssb/ssbdemod.cpp @@ -77,7 +77,7 @@ SSBDemod::SSBDemod(DeviceSourceAPI *deviceAPI) : m_magsqPeak = 0.0f; m_magsqCount = 0; - m_agc.setClampMax(32768.0*32768.0); + m_agc.setClampMax(SDR_SCALED*SDR_SCALED); m_agc.setClamping(m_agcClamping); SSBFilter = new fftfilt(m_LowCutoff / m_audioSampleRate, m_Bandwidth / m_audioSampleRate, ssbFftLen); @@ -154,7 +154,6 @@ void SSBDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto for(SampleVector::const_iterator it = begin; it < end; ++it) { - //Complex c(it->real() / 32768.0, it->imag() / 32768.0); Complex c(it->real(), it->imag()); c *= m_nco.nextIQ(); @@ -187,7 +186,7 @@ void SSBDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto { Real avgr = m_sum.real() / decim; Real avgi = m_sum.imag() / decim; - m_magsq = (avgr * avgr + avgi * avgi) / (1<<30); + m_magsq = (avgr * avgr + avgi * avgi) / (SDR_SCALED*SDR_SCALED); m_magsqSum += m_magsq; @@ -428,7 +427,7 @@ void SSBDemod::applySettings(const SSBDemodSettings& settings, bool force) { int agcNbSamples = 48 * (1<real() / 32768.0f, it->imag() / 32768.0f); Complex c(it->real(), it->imag()); c *= m_nco.nextIQ(); @@ -113,7 +112,7 @@ void WFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto for (int i = 0 ; i < rf_out; i++) { demod = m_phaseDiscri.phaseDiscriminatorDelta(rf[i], msq, fmDev); - Real magsq = msq / (1<<30); + Real magsq = msq / (SDR_SCALED*SDR_SCALED); m_movingAverage.feed(magsq); m_magsqSum += magsq; diff --git a/plugins/channelrx/tcpsrc/tcpsrc.cpp b/plugins/channelrx/tcpsrc/tcpsrc.cpp index a92a043cc..017bdd6d9 100644 --- a/plugins/channelrx/tcpsrc/tcpsrc.cpp +++ b/plugins/channelrx/tcpsrc/tcpsrc.cpp @@ -97,17 +97,15 @@ void TCPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector: m_settingsMutex.lock(); // Rtl-Sdr uses full 16-bit scale; FCDPP does not - //int rescale = 32768 * (1 << m_boost); int rescale = (1 << m_volume); for(SampleVector::const_iterator it = begin; it < end; ++it) { - //Complex c(it->real() / 32768.0f, it->imag() / 32768.0f); Complex c(it->real(), it->imag()); c *= m_nco.nextIQ(); if(m_interpolator.decimate(&m_sampleDistanceRemain, c, &ci)) { - m_magsq = ((ci.real()*ci.real() + ci.imag()*ci.imag())*rescale*rescale) / (1<<30); + m_magsq = ((ci.real()*ci.real() + ci.imag()*ci.imag())*rescale*rescale) / (SDR_SCALED*SDR_SCALED); m_sampleBuffer.push_back(Sample(ci.real() * rescale, ci.imag() * rescale)); m_sampleDistanceRemain += m_inputSampleRate / m_outputSampleRate; } @@ -145,7 +143,7 @@ void TCPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector: if((m_sampleFormat == TCPSrcSettings::FormatNFM) && (m_ssbSockets.count() > 0)) { for(SampleVector::const_iterator it = m_sampleBuffer.begin(); it != m_sampleBuffer.end(); ++it) { - Complex cj(it->real() / 32768.0f, it->imag() / 32768.0f); + Complex cj(it->real() / SDR_SCALEF, it->imag() / SDR_SCALEF); // An FFT filter here is overkill, but was already set up for SSB int n_out = TCPFilter->runFilt(cj, &sideband); if (n_out) { diff --git a/plugins/channelrx/udpsrc/udpsrc.cpp b/plugins/channelrx/udpsrc/udpsrc.cpp index c0aa7be87..6652c53ab 100644 --- a/plugins/channelrx/udpsrc/udpsrc.cpp +++ b/plugins/channelrx/udpsrc/udpsrc.cpp @@ -92,7 +92,7 @@ UDPSrc::UDPSrc(DeviceSourceAPI *deviceAPI) : qWarning("UDPSrc::UDPSrc: cannot bind audio port"); } - m_agc.setClampMax(32768.0*32768.0); + m_agc.setClampMax(SDR_SCALED*SDR_SCALED); m_agc.setClamping(true); //DSPEngine::instance()->addAudioSink(&m_audioFifo); @@ -158,7 +158,7 @@ void UDPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector: inMagSq = ci.real()*ci.real() + ci.imag()*ci.imag(); } - m_inMovingAverage.feed(inMagSq / (1<<30)); + m_inMovingAverage.feed(inMagSq / (SDR_SCALED*SDR_SCALED)); m_inMagsq = m_inMovingAverage.average(); Sample ss(ci.real(), ci.imag()); @@ -180,7 +180,7 @@ void UDPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector: l = m_squelchOpen ? sideband[i].real() * m_settings.m_gain : 0; r = m_squelchOpen ? sideband[i].imag() * m_settings.m_gain : 0; m_udpBuffer->write(Sample(l, r)); - m_outMovingAverage.feed((l*l + r*r) / (1<<30)); + m_outMovingAverage.feed((l*l + r*r) / (SDR_SCALED*SDR_SCALED)); } } } @@ -196,19 +196,19 @@ void UDPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector: l = m_squelchOpen ? sideband[i].real() * m_settings.m_gain : 0; r = m_squelchOpen ? sideband[i].imag() * m_settings.m_gain : 0; m_udpBuffer->write(Sample(l, r)); - m_outMovingAverage.feed((l*l + r*r) / (1<<30)); + m_outMovingAverage.feed((l*l + r*r) / (SDR_SCALED*SDR_SCALED)); } } } else if (m_settings.m_sampleFormat == UDPSrcSettings::FormatNFM) { - double demod = m_squelchOpen ? 32768.0 * m_phaseDiscri.phaseDiscriminator(ci) * m_settings.m_gain : 0; + double demod = m_squelchOpen ? SDR_SCALED * m_phaseDiscri.phaseDiscriminator(ci) * m_settings.m_gain : 0; m_udpBuffer->write(Sample(demod, demod)); - m_outMovingAverage.feed((demod * demod) / (1<<30)); + m_outMovingAverage.feed((demod * demod) / (SDR_SCALED*SDR_SCALED)); } else if (m_settings.m_sampleFormat == UDPSrcSettings::FormatNFMMono) { - FixReal demod = m_squelchOpen ? (FixReal) (32768.0f * m_phaseDiscri.phaseDiscriminator(ci) * m_settings.m_gain) : 0; + FixReal demod = m_squelchOpen ? (FixReal) (SDR_SCALEF * m_phaseDiscri.phaseDiscriminator(ci) * m_settings.m_gain) : 0; m_udpBufferMono->write(demod); m_outMovingAverage.feed((demod * demod) / 1073741824.0); } @@ -223,7 +223,7 @@ void UDPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector: { l = m_squelchOpen ? (sideband[i].real() + sideband[i].imag()) * 0.7 * m_settings.m_gain : 0; m_udpBufferMono->write(l); - m_outMovingAverage.feed((l * l) / (1<<30)); + m_outMovingAverage.feed((l * l) / (SDR_SCALED*SDR_SCALED)); } } } @@ -238,7 +238,7 @@ void UDPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector: { l = m_squelchOpen ? (sideband[i].real() + sideband[i].imag()) * 0.7 * m_settings.m_gain : 0; m_udpBufferMono->write(l); - m_outMovingAverage.feed((l * l) / (1<<30)); + m_outMovingAverage.feed((l * l) / (SDR_SCALED*SDR_SCALED)); } } } @@ -287,7 +287,7 @@ void UDPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector: { Sample s(ci.real() * m_settings.m_gain, ci.imag() * m_settings.m_gain); m_udpBuffer->write(s); - m_outMovingAverage.feed((inMagSq*m_settings.m_gain*m_settings.m_gain) / (1<<30)); + m_outMovingAverage.feed((inMagSq*m_settings.m_gain*m_settings.m_gain) / (SDR_SCALED*SDR_SCALED)); } else { diff --git a/plugins/channeltx/modam/ammod.cpp b/plugins/channeltx/modam/ammod.cpp index d8fe9016f..17672a523 100644 --- a/plugins/channeltx/modam/ammod.cpp +++ b/plugins/channeltx/modam/ammod.cpp @@ -129,8 +129,8 @@ void AMMod::pull(Sample& sample) m_settingsMutex.unlock(); - Real magsq = ci.real() * ci.real() + ci.imag() * ci.imag(); - magsq /= (1<<30); + double magsq = ci.real() * ci.real() + ci.imag() * ci.imag(); + magsq /= (SDR_SCALED*SDR_SCALED); m_movingAverage.feed(magsq); m_magsq = m_movingAverage.average(); diff --git a/plugins/channeltx/modatv/atvmod.cpp b/plugins/channeltx/modatv/atvmod.cpp index f28b6ae93..bbc079a25 100644 --- a/plugins/channeltx/modatv/atvmod.cpp +++ b/plugins/channeltx/modatv/atvmod.cpp @@ -163,8 +163,8 @@ void ATVMod::pullFinalize(Complex& ci, Sample& sample) m_settingsMutex.unlock(); - Real magsq = ci.real() * ci.real() + ci.imag() * ci.imag(); - magsq /= (1<<30); + double magsq = ci.real() * ci.real() + ci.imag() * ci.imag(); + magsq /= (SDR_SCALED*SDR_SCALED); m_movingAverage.feed(magsq); sample.m_real = (FixReal) ci.real(); diff --git a/plugins/channeltx/modatv/atvmodsettings.cpp b/plugins/channeltx/modatv/atvmodsettings.cpp index 1b5014d3c..192c98db9 100644 --- a/plugins/channeltx/modatv/atvmodsettings.cpp +++ b/plugins/channeltx/modatv/atvmodsettings.cpp @@ -43,7 +43,7 @@ void ATVModSettings::resetToDefaults() m_cameraPlay = false; m_channelMute = false; m_invertedVideo = false; - m_rfScalingFactor = 29204.0f; // -1dB + m_rfScalingFactor = 0.891235351562f * SDR_SCALEF; // -1dB m_fmExcursion = 0.5f; // half bandwidth m_forceDecimator = false; m_overlayText = "ATV"; diff --git a/plugins/channeltx/modnfm/nfmmod.cpp b/plugins/channeltx/modnfm/nfmmod.cpp index dad97319c..812e52332 100644 --- a/plugins/channeltx/modnfm/nfmmod.cpp +++ b/plugins/channeltx/modnfm/nfmmod.cpp @@ -135,8 +135,8 @@ void NFMMod::pull(Sample& sample) m_settingsMutex.unlock(); - Real magsq = ci.real() * ci.real() + ci.imag() * ci.imag(); - magsq /= (1<<30); + double magsq = ci.real() * ci.real() + ci.imag() * ci.imag(); + magsq /= (SDR_SCALED*SDR_SCALED); m_movingAverage.feed(magsq); m_magsq = m_movingAverage.average(); @@ -175,8 +175,8 @@ void NFMMod::modulateSample() m_modPhasor += (m_settings.m_fmDeviation / (float) m_settings.m_audioSampleRate) * m_bandpass.filter(t) * (M_PI / 378.0f); } - m_modSample.real(cos(m_modPhasor) * 29204.0f); // -1 dB - m_modSample.imag(sin(m_modPhasor) * 29204.0f); + m_modSample.real(cos(m_modPhasor) * 0.891235351562f * SDR_SCALEF); // -1 dB + m_modSample.imag(sin(m_modPhasor) * 0.891235351562f * SDR_SCALEF); } void NFMMod::pullAF(Real& sample) diff --git a/plugins/channeltx/modssb/ssbmod.cpp b/plugins/channeltx/modssb/ssbmod.cpp index ad90f716e..84d8e7a72 100644 --- a/plugins/channeltx/modssb/ssbmod.cpp +++ b/plugins/channeltx/modssb/ssbmod.cpp @@ -160,12 +160,12 @@ void SSBMod::pull(Sample& sample) m_interpolatorDistanceRemain += m_interpolatorDistance; ci *= m_carrierNco.nextIQ(); // shift to carrier frequency - ci *= 29204.0f; //scaling at -1 dB to account for possible filter overshoot + ci *= 0.891235351562f * SDR_SCALEF; //scaling at -1 dB to account for possible filter overshoot m_settingsMutex.unlock(); - Real magsq = ci.real() * ci.real() + ci.imag() * ci.imag(); - magsq /= (1<<30); + double magsq = ci.real() * ci.real() + ci.imag() * ci.imag(); + magsq /= (SDR_SCALED*SDR_SCALED); m_movingAverage.feed(magsq); m_magsq = m_movingAverage.average(); @@ -298,13 +298,13 @@ void SSBMod::pullAF(Complex& sample) { if (m_settings.m_audioFlipChannels) { - ci.real((m_audioBuffer[m_audioBufferFill].r / 32768.0f) * m_settings.m_volumeFactor); - ci.imag((m_audioBuffer[m_audioBufferFill].l / 32768.0f) * m_settings.m_volumeFactor); + ci.real((m_audioBuffer[m_audioBufferFill].r / SDR_SCALEF) * m_settings.m_volumeFactor); + ci.imag((m_audioBuffer[m_audioBufferFill].l / SDR_SCALEF) * m_settings.m_volumeFactor); } else { - ci.real((m_audioBuffer[m_audioBufferFill].l / 32768.0f) * m_settings.m_volumeFactor); - ci.imag((m_audioBuffer[m_audioBufferFill].r / 32768.0f) * m_settings.m_volumeFactor); + ci.real((m_audioBuffer[m_audioBufferFill].l / SDR_SCALEF) * m_settings.m_volumeFactor); + ci.imag((m_audioBuffer[m_audioBufferFill].r / SDR_SCALEF) * m_settings.m_volumeFactor); } } else @@ -419,18 +419,8 @@ void SSBMod::pullAF(Complex& sample) if (!(m_undersampleCount++ & decim_mask)) { - Real avgr = (m_sum.real() / decim) * 29204.0f; //scaling at -1 dB to account for possible filter overshoot - Real avgi = (m_sum.imag() / decim) * 29204.0f; -// m_magsqSpectrum = (avgr * avgr + avgi * avgi) / (1<<30); -// -// m_magsqSum += m_magsqSpectrum; -// -// if (m_magsqSpectrum > m_magsqPeak) -// { -// m_magsqPeak = m_magsqSpectrum; -// } -// -// m_magsqCount++; + Real avgr = (m_sum.real() / decim) * 0.891235351562f * SDR_SCALEF; //scaling at -1 dB to account for possible filter overshoot + Real avgi = (m_sum.imag() / decim) * 0.891235351562f * SDR_SCALEF; if (!m_settings.m_dsb & !m_settings.m_usb) { // invert spectrum for LSB @@ -453,18 +443,8 @@ void SSBMod::pullAF(Complex& sample) if (!(m_undersampleCount++ & decim_mask)) { - Real avgr = (m_sum.real() / decim) * 29204.0f; //scaling at -1 dB to account for possible filter overshoot - Real avgi = (m_sum.imag() / decim) * 29204.0f; -// m_magsqSpectrum = (avgr * avgr + avgi * avgi) / (1<<30); -// -// m_magsqSum += m_magsqSpectrum; -// -// if (m_magsqSpectrum > m_magsqPeak) -// { -// m_magsqPeak = m_magsqSpectrum; -// } -// -// m_magsqCount++; + Real avgr = (m_sum.real() / decim) * 0.891235351562f * SDR_SCALEF; //scaling at -1 dB to account for possible filter overshoot + Real avgi = (m_sum.imag() / decim) * 0.891235351562f * SDR_SCALEF; if (!m_settings.m_dsb & !m_settings.m_usb) { // invert spectrum for LSB diff --git a/plugins/channeltx/modwfm/wfmmod.cpp b/plugins/channeltx/modwfm/wfmmod.cpp index 3801a255f..7492b6a77 100644 --- a/plugins/channeltx/modwfm/wfmmod.cpp +++ b/plugins/channeltx/modwfm/wfmmod.cpp @@ -139,8 +139,8 @@ void WFMMod::pull(Sample& sample) } m_modPhasor += (m_settings.m_fmDeviation / (float) m_outputSampleRate) * ri.real() * M_PI * 2.0f; - ci.real(cos(m_modPhasor) * 29204.0f); // -1 dB - ci.imag(sin(m_modPhasor) * 29204.0f); + ci.real(cos(m_modPhasor) * 0.891235351562f * SDR_SCALEF); // -1 dB + ci.imag(sin(m_modPhasor) * 0.891235351562f * SDR_SCALEF); // RF filtering rf_out = m_rfFilter->runFilt(ci, &rf); @@ -157,8 +157,8 @@ void WFMMod::pull(Sample& sample) m_settingsMutex.unlock(); - Real magsq = ci.real() * ci.real() + ci.imag() * ci.imag(); - magsq /= (1<<30); + double magsq = ci.real() * ci.real() + ci.imag() * ci.imag(); + magsq /= (SDR_SCALED*SDR_SCALED); m_movingAverage.feed(magsq); m_magsq = m_movingAverage.average(); diff --git a/plugins/channeltx/udpsink/udpsink.cpp b/plugins/channeltx/udpsink/udpsink.cpp index 889376930..f36fd1737 100644 --- a/plugins/channeltx/udpsink/udpsink.cpp +++ b/plugins/channeltx/udpsink/udpsink.cpp @@ -134,7 +134,7 @@ void UDPSink::pull(Sample& sample) m_settingsMutex.unlock(); double magsq = ci.real() * ci.real() + ci.imag() * ci.imag(); - magsq /= (1<<30); + magsq /= (SDR_SCALED*SDR_SCALED); m_movingAverage.feed(magsq); m_magsq = m_movingAverage.average(); @@ -180,9 +180,9 @@ void UDPSink::modulateSample() if (m_squelchOpen) { - m_modPhasor += (m_settings.m_fmDeviation / m_settings.m_inputSampleRate) * (t / 32768.0f) * M_PI * 2.0f; - m_modSample.real(cos(m_modPhasor) * 10362.2f * m_settings.m_gainOut); - m_modSample.imag(sin(m_modPhasor) * 10362.2f * m_settings.m_gainOut); + m_modPhasor += (m_settings.m_fmDeviation / m_settings.m_inputSampleRate) * (t / SDR_SCALEF) * M_PI * 2.0f; + m_modSample.real(cos(m_modPhasor) * 0.3162292f * SDR_SCALEF * m_settings.m_gainOut); + m_modSample.imag(sin(m_modPhasor) * 0.3162292f * SDR_SCALEF * m_settings.m_gainOut); calculateLevel(m_modSample); } else @@ -195,14 +195,14 @@ void UDPSink::modulateSample() { FixReal t; readMonoSample(t); - m_inMovingAverage.feed((t*t)/1073741824.0); + m_inMovingAverage.feed((t*t)/(SDR_SCALED*SDR_SCALED)); m_inMagsq = m_inMovingAverage.average(); calculateSquelch(m_inMagsq); if (m_squelchOpen) { - m_modSample.real(((t / 32768.0f)*m_settings.m_amModFactor*m_settings.m_gainOut + 1.0f) * 16384.0f); // modulate and scale zero frequency carrier + m_modSample.real(((t / SDR_SCALEF)*m_settings.m_amModFactor*m_settings.m_gainOut + 1.0f) * (SDR_SCALEF/2)); // modulate and scale zero frequency carrier m_modSample.imag(0.0f); calculateLevel(m_modSample); } @@ -227,7 +227,7 @@ void UDPSink::modulateSample() if (m_squelchOpen) { - ci.real((t / 32768.0f) * m_settings.m_gainOut); + ci.real((t / SDR_SCALEF) * m_settings.m_gainOut); ci.imag(0.0f); n_out = m_SSBFilter->runSSB(ci, &filtered, (m_settings.m_sampleFormat == UDPSinkSettings::FormatUSB)); @@ -239,8 +239,8 @@ void UDPSink::modulateSample() } c = m_SSBFilterBuffer[m_SSBFilterBufferIndex]; - m_modSample.real(m_SSBFilterBuffer[m_SSBFilterBufferIndex].real() * 32768.0f); - m_modSample.imag(m_SSBFilterBuffer[m_SSBFilterBufferIndex].imag() * 32768.0f); + m_modSample.real(m_SSBFilterBuffer[m_SSBFilterBufferIndex].real() * SDR_SCALEF); + m_modSample.imag(m_SSBFilterBuffer[m_SSBFilterBufferIndex].imag() * SDR_SCALEF); m_SSBFilterBufferIndex++; calculateLevel(m_modSample); @@ -305,8 +305,8 @@ void UDPSink::calculateLevel(Complex sample) } else { - qreal rmsLevel = m_levelSum > 0.0 ? sqrt((m_levelSum/(1<<30)) / m_levelNbSamples) : 0.0; - emit levelChanged(rmsLevel, m_peakLevel / 32768.0, m_levelNbSamples); + qreal rmsLevel = m_levelSum > 0.0 ? sqrt((m_levelSum/(SDR_SCALED*SDR_SCALED)) / m_levelNbSamples) : 0.0; + emit levelChanged(rmsLevel, m_peakLevel / SDR_SCALEF, m_levelNbSamples); m_peakLevel = 0.0f; m_levelSum = 0.0f; m_levelCalcCount = 0; diff --git a/plugins/samplesink/plutosdroutput/plutosdroutput.cpp b/plugins/samplesink/plutosdroutput/plutosdroutput.cpp index 8ad6cdaa2..d6493a1ea 100644 --- a/plugins/samplesink/plutosdroutput/plutosdroutput.cpp +++ b/plugins/samplesink/plutosdroutput/plutosdroutput.cpp @@ -221,7 +221,6 @@ bool PlutoSDROutput::handleMessage(const Message& message) bool PlutoSDROutput::openDevice() { - //m_sampleSourceFifo.resize(m_settings.m_devSampleRate/(1<<(m_settings.m_log2Interp <= 4 ? m_settings.m_log2Interp : 4))); m_sampleSourceFifo.resize(32*PLUTOSDR_BLOCKSIZE_SAMPLES); // look for Rx buddy and get reference to common parameters diff --git a/sdrbase/dsp/dsptypes.h b/sdrbase/dsp/dsptypes.h index 8d8c92e6c..b6462e48d 100644 --- a/sdrbase/dsp/dsptypes.h +++ b/sdrbase/dsp/dsptypes.h @@ -22,11 +22,15 @@ #include #include -#ifdef SAMPLE_32BIT -#define SDR_SAMP_SZ 32 // internal fixed arithmetic sample size +#ifdef SAMPLE_24BIT +#define SDR_SAMP_SZ 24 // internal fixed arithmetic sample size +#define SDR_SCALEF 8388608.0f +#define SDR_SCALED 8388608.0 typedef qint32 FixReal; #else #define SDR_SAMP_SZ 16 // internal fixed arithmetic sample size +#define SDR_SCALEF 32768.0f +#define SDR_SCALED 32768.0 typedef qint16 FixReal; #endif diff --git a/sdrgui/dsp/scopevis.cpp b/sdrgui/dsp/scopevis.cpp index 7050e122a..02fd0066c 100644 --- a/sdrgui/dsp/scopevis.cpp +++ b/sdrgui/dsp/scopevis.cpp @@ -111,7 +111,7 @@ void ScopeVis::feed(const SampleVector::const_iterator& cbegin, const SampleVect for(int i = 0; i < count; ++i) { - *it++ = Complex(begin->real() / 32768.0f, begin->imag() / 32768.0f); + *it++ = Complex(begin->real() / SDR_SCALEF, begin->imag() / SDR_SCALEF); ++begin; } @@ -234,7 +234,7 @@ void ScopeVis::feed(const SampleVector::const_iterator& cbegin, const SampleVect for(int i = 0; i < count; ++i) { - *it++ = Complex(begin->real() / 32768.0f, begin->imag() / 32768.0f); + *it++ = Complex(begin->real() / SDR_SCALEF, begin->imag() / SDR_SCALEF); ++begin; } @@ -341,7 +341,7 @@ void ScopeVis::setSampleRate(int sampleRate) bool ScopeVis::triggerCondition(SampleVector::const_iterator& it) { - Complex c(it->real()/32768.0f, it->imag()/32768.0f); + Complex c(it->real()/SDR_SCALEF, it->imag()/SDR_SCALEF); m_traceback.push_back(c); // store into trace memory FIFO if (m_tracebackCount < m_traceback.size()) diff --git a/sdrgui/dsp/scopevismulti.h b/sdrgui/dsp/scopevismulti.h index 9c1c83427..c05656a8c 100644 --- a/sdrgui/dsp/scopevismulti.h +++ b/sdrgui/dsp/scopevismulti.h @@ -556,7 +556,7 @@ private: switch (m_projectionType) { case ProjectionImag: - v = s.m_imag / 32768.0f; + v = s.m_imag / SDR_SCALEF; break; case ProjectionMagLin: { @@ -590,7 +590,7 @@ private: break; case ProjectionReal: default: - v = s.m_real / 32768.0f; + v = s.m_real / SDR_SCALEF; break; } diff --git a/sdrgui/dsp/scopevisng.h b/sdrgui/dsp/scopevisng.h index b47a0cea7..3687f7d20 100644 --- a/sdrgui/dsp/scopevisng.h +++ b/sdrgui/dsp/scopevisng.h @@ -545,7 +545,7 @@ private: switch (m_projectionType) { case ProjectionImag: - v = s.m_imag / 32768.0f; + v = s.m_imag / SDR_SCALEF; break; case ProjectionMagLin: { @@ -579,7 +579,7 @@ private: break; case ProjectionReal: default: - v = s.m_real / 32768.0f; + v = s.m_real / SDR_SCALEF; break; } diff --git a/sdrgui/dsp/spectrumvis.cpp b/sdrgui/dsp/spectrumvis.cpp index 5489c0965..779436130 100644 --- a/sdrgui/dsp/spectrumvis.cpp +++ b/sdrgui/dsp/spectrumvis.cpp @@ -85,7 +85,7 @@ void SpectrumVis::feed(const SampleVector::const_iterator& cbegin, const SampleV for (std::size_t i = 0; i < samplesNeeded; ++i, ++begin) { - *it++ = Complex(begin->real() / 32768.0f, begin->imag() / 32768.0f); + *it++ = Complex(begin->real() / SDR_SCALEF, begin->imag() / SDR_SCALEF); } // apply fft window (and copy from m_fftBuffer to m_fftIn) @@ -144,7 +144,7 @@ void SpectrumVis::feed(const SampleVector::const_iterator& cbegin, const SampleV // not enough samples for FFT - just fill in new data and return for(std::vector::iterator it = m_fftBuffer.begin() + m_fftBufferFill; begin < end; ++begin) { - *it++ = Complex(begin->real() / 32768.0f, begin->imag() / 32768.0f); + *it++ = Complex(begin->real() / SDR_SCALEF, begin->imag() / SDR_SCALEF); } m_fftBufferFill += todo; From 34fe4cb7478b5efba560f881d1a33961e770fcf3 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 21 Jan 2018 11:06:33 +0100 Subject: [PATCH 04/27] Bumped version to 3.11.1 --- app/main.cpp | 2 +- appsrv/main.cpp | 2 +- debian/changelog | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/main.cpp b/app/main.cpp index d221ecae4..7565508cd 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -34,7 +34,7 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo */ QCoreApplication::setOrganizationName("f4exb"); QCoreApplication::setApplicationName("SDRangel"); - QCoreApplication::setApplicationVersion("3.11.0"); + QCoreApplication::setApplicationVersion("3.11.1"); #if 1 qApp->setStyle(QStyleFactory::create("fusion")); diff --git a/appsrv/main.cpp b/appsrv/main.cpp index 8183ab273..ce68f1319 100644 --- a/appsrv/main.cpp +++ b/appsrv/main.cpp @@ -55,7 +55,7 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo QCoreApplication::setOrganizationName("f4exb"); QCoreApplication::setApplicationName("SDRangelSrv"); - QCoreApplication::setApplicationVersion("3.11.0"); + QCoreApplication::setApplicationVersion("3.11.1"); int catchSignals[] = {SIGQUIT, SIGINT, SIGTERM, SIGHUP}; std::vector vsig(catchSignals, catchSignals + sizeof(catchSignals) / sizeof(int)); diff --git a/debian/changelog b/debian/changelog index f35a0ad8f..8282b4cfc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +sdrangel (3.11.1-1) unstable; urgency=medium + + * Replaced hardcoded bit scaling literals by defines. 24 bit sample option. + + -- Edouard Griffiths, F4EXB Sun, 28 Jan 2018 12:14:18 +0100 + sdrangel (3.11.0-1) unstable; urgency=medium * AirspyHF: support From 8cd462a338e8141f5f7ed723e1be24a13d9ea2e1 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 21 Jan 2018 12:12:20 +0100 Subject: [PATCH 05/27] IntHalfbandFilterDB: use specific storeSample method when samples are defined om 32 bit wide fields --- sdrbase/dsp/inthalfbandfilterdb.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sdrbase/dsp/inthalfbandfilterdb.h b/sdrbase/dsp/inthalfbandfilterdb.h index e6aade996..7ea442cee 100644 --- a/sdrbase/dsp/inthalfbandfilterdb.h +++ b/sdrbase/dsp/inthalfbandfilterdb.h @@ -67,7 +67,7 @@ public: { case 0: // insert sample into ring-buffer - storeSample(0, 0); + storeSample((FixReal) 0, (FixReal) 0); // save result doFIR(SampleOut); // advance write-pointer @@ -128,7 +128,7 @@ public: bool workDecimateCenter(qint32 *x, qint32 *y) { // insert sample into ring-buffer - storeSample(*x, *y); + storeSample32(*x, *y); switch(m_state) { @@ -279,7 +279,7 @@ public: { case 0: // insert sample into ring-buffer - storeSample(0, 0); + storeSample((FixReal) 0, (FixReal) 0); // save result doFIR(&s); @@ -315,7 +315,7 @@ public: case 2: // insert sample into ring-buffer - storeSample(0, 0); + storeSample((FixReal) 0, (FixReal) 0); // save result doFIR(&s); @@ -478,7 +478,7 @@ public: { case 0: // insert sample into ring-buffer - storeSample(0, 0); + storeSample((FixReal) 0, (FixReal) 0); // save result doFIR(&s); @@ -514,7 +514,7 @@ public: case 2: // insert sample into ring-buffer - storeSample(0, 0); + storeSample((FixReal) 0, (FixReal) 0); // save result doFIR(&s); @@ -562,10 +562,10 @@ public: void myDecimate(qint32 x1, qint32 y1, qint32 *x2, qint32 *y2) { - storeSample(x1, y1); + storeSample32(x1, y1); advancePointer(); - storeSample(*x2, *y2); + storeSample32(*x2, *y2); doFIR(x2, y2); advancePointer(); } @@ -577,7 +577,7 @@ public: doFIR(sample1); advancePointer(); - storeSample(0, 0); + storeSample((FixReal) 0, (FixReal) 0); doFIR(sample2); advancePointer(); } @@ -585,11 +585,11 @@ public: /** Simple zero stuffing and filter */ void myInterpolateZeroStuffing(qint32 *x1, qint32 *y1, qint32 *x2, qint32 *y2) { - storeSample(*x1, *y1); + storeSample32(*x1, *y1); doFIR(x1, y1); advancePointer(); - storeSample(0, 0); + storeSample32(0, 0); doFIR(x2, y2); advancePointer(); } @@ -632,7 +632,7 @@ protected: m_samplesDB[m_ptr + m_size][1] = sampleQ; } - void storeSample(qint32 x, qint32 y) + void storeSample32(qint32 x, qint32 y) { m_samplesDB[m_ptr][0] = x; m_samplesDB[m_ptr][1] = y; From 08ce7f423ba711baaf6712907214b0ab8d5fa2e8 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 21 Jan 2018 19:39:51 +0100 Subject: [PATCH 06/27] Templatize the accumulator type of integer half-band filters (non SIMD) --- sdrbase/dsp/decimators.h | 12 ++++++------ sdrbase/dsp/decimatorsu.h | 12 ++++++------ sdrbase/dsp/downchannelizer.cpp | 8 ++++---- sdrbase/dsp/downchannelizer.h | 4 ++-- sdrbase/dsp/interpolators.h | 12 ++++++------ sdrbase/dsp/inthalfbandfilter.h | 20 ++++++++++---------- sdrbase/dsp/inthalfbandfilterdb.h | 24 ++++++++++++------------ sdrbase/dsp/samplesinkfifodecimator.h | 12 ++++++------ sdrbase/dsp/upchannelizer.cpp | 8 ++++---- sdrbase/dsp/upchannelizer.h | 4 ++-- 10 files changed, 58 insertions(+), 58 deletions(-) diff --git a/sdrbase/dsp/decimators.h b/sdrbase/dsp/decimators.h index c4645c2da..c8bbd27af 100644 --- a/sdrbase/dsp/decimators.h +++ b/sdrbase/dsp/decimators.h @@ -154,12 +154,12 @@ private: IntHalfbandFilterEO1 m_decimator32; // 5th stages IntHalfbandFilterEO1 m_decimator64; // 6th stages #else - IntHalfbandFilterDB m_decimator2; // 1st stages - IntHalfbandFilterDB m_decimator4; // 2nd stages - IntHalfbandFilterDB m_decimator8; // 3rd stages - IntHalfbandFilterDB m_decimator16; // 4th stages - IntHalfbandFilterDB m_decimator32; // 5th stages - IntHalfbandFilterDB m_decimator64; // 6th stages + IntHalfbandFilterDB m_decimator2; // 1st stages + IntHalfbandFilterDB m_decimator4; // 2nd stages + IntHalfbandFilterDB m_decimator8; // 3rd stages + IntHalfbandFilterDB m_decimator16; // 4th stages + IntHalfbandFilterDB m_decimator32; // 5th stages + IntHalfbandFilterDB m_decimator64; // 6th stages #endif }; diff --git a/sdrbase/dsp/decimatorsu.h b/sdrbase/dsp/decimatorsu.h index f288bc88c..2e0b04aaf 100644 --- a/sdrbase/dsp/decimatorsu.h +++ b/sdrbase/dsp/decimatorsu.h @@ -138,12 +138,12 @@ private: IntHalfbandFilterEO1 m_decimator32; // 5th stages IntHalfbandFilterEO1 m_decimator64; // 6th stages #else - IntHalfbandFilterDB m_decimator2; // 1st stages - IntHalfbandFilterDB m_decimator4; // 2nd stages - IntHalfbandFilterDB m_decimator8; // 3rd stages - IntHalfbandFilterDB m_decimator16; // 4th stages - IntHalfbandFilterDB m_decimator32; // 5th stages - IntHalfbandFilterDB m_decimator64; // 6th stages + IntHalfbandFilterDB m_decimator2; // 1st stages + IntHalfbandFilterDB m_decimator4; // 2nd stages + IntHalfbandFilterDB m_decimator8; // 3rd stages + IntHalfbandFilterDB m_decimator16; // 4th stages + IntHalfbandFilterDB m_decimator32; // 5th stages + IntHalfbandFilterDB m_decimator64; // 6th stages #endif }; diff --git a/sdrbase/dsp/downchannelizer.cpp b/sdrbase/dsp/downchannelizer.cpp index 3e3193f75..e39b523b8 100644 --- a/sdrbase/dsp/downchannelizer.cpp +++ b/sdrbase/dsp/downchannelizer.cpp @@ -215,22 +215,22 @@ DownChannelizer::FilterStage::FilterStage(Mode mode) : } #else DownChannelizer::FilterStage::FilterStage(Mode mode) : - m_filter(new IntHalfbandFilterDB), + m_filter(new IntHalfbandFilterDB), m_workFunction(0), m_mode(mode), m_sse(false) { switch(mode) { case ModeCenter: - m_workFunction = &IntHalfbandFilterDB::workDecimateCenter; + m_workFunction = &IntHalfbandFilterDB::workDecimateCenter; break; case ModeLowerHalf: - m_workFunction = &IntHalfbandFilterDB::workDecimateLowerHalf; + m_workFunction = &IntHalfbandFilterDB::workDecimateLowerHalf; break; case ModeUpperHalf: - m_workFunction = &IntHalfbandFilterDB::workDecimateUpperHalf; + m_workFunction = &IntHalfbandFilterDB::workDecimateUpperHalf; break; } } diff --git a/sdrbase/dsp/downchannelizer.h b/sdrbase/dsp/downchannelizer.h index 8df11cf75..d77c4a402 100644 --- a/sdrbase/dsp/downchannelizer.h +++ b/sdrbase/dsp/downchannelizer.h @@ -82,8 +82,8 @@ protected: typedef bool (IntHalfbandFilterEO1::*WorkFunction)(Sample* s); IntHalfbandFilterEO1* m_filter; #else - typedef bool (IntHalfbandFilterDB::*WorkFunction)(Sample* s); - IntHalfbandFilterDB* m_filter; + typedef bool (IntHalfbandFilterDB::*WorkFunction)(Sample* s); + IntHalfbandFilterDB* m_filter; #endif WorkFunction m_workFunction; Mode m_mode; diff --git a/sdrbase/dsp/interpolators.h b/sdrbase/dsp/interpolators.h index f1f3dd2d2..d64619f40 100644 --- a/sdrbase/dsp/interpolators.h +++ b/sdrbase/dsp/interpolators.h @@ -122,12 +122,12 @@ private: IntHalfbandFilterEO1 m_interpolator32; // 5th stages IntHalfbandFilterEO1 m_interpolator64; // 6th stages #else - IntHalfbandFilterDB m_interpolator2; // 1st stages - IntHalfbandFilterDB m_interpolator4; // 2nd stages - IntHalfbandFilterDB m_interpolator8; // 3rd stages - IntHalfbandFilterDB m_interpolator16; // 4th stages - IntHalfbandFilterDB m_interpolator32; // 5th stages - IntHalfbandFilterDB m_interpolator64; // 6th stages + IntHalfbandFilterDB m_interpolator2; // 1st stages + IntHalfbandFilterDB m_interpolator4; // 2nd stages + IntHalfbandFilterDB m_interpolator8; // 3rd stages + IntHalfbandFilterDB m_interpolator16; // 4th stages + IntHalfbandFilterDB m_interpolator32; // 5th stages + IntHalfbandFilterDB m_interpolator64; // 6th stages #endif }; diff --git a/sdrbase/dsp/inthalfbandfilter.h b/sdrbase/dsp/inthalfbandfilter.h index c1fd7aea7..f21f12d87 100644 --- a/sdrbase/dsp/inthalfbandfilter.h +++ b/sdrbase/dsp/inthalfbandfilter.h @@ -23,7 +23,7 @@ #include "dsp/hbfiltertraits.h" #include "util/export.h" -template +template class SDRANGEL_API IntHalfbandFilter { public: IntHalfbandFilter() : @@ -748,7 +748,7 @@ public: } protected: - qint32 m_samples[HBFIRFilterTraits::hbOrder + 1][2]; // Valgrind optim (from qint16) + AccuType m_samples[HBFIRFilterTraits::hbOrder + 1][2]; // Valgrind optim (from qint16) qint16 m_ptr; int m_state; @@ -759,8 +759,8 @@ protected: int b = HBFIRFilterTraits::hbMod[m_ptr + 2 - 2]; //-1 - 1 // go through samples in buffer - qint32 iAcc = 0; - qint32 qAcc = 0; + AccuType iAcc = 0; + AccuType qAcc = 0; for (int i = 0; i < HBFIRFilterTraits::hbOrder / 4; i++) { @@ -790,8 +790,8 @@ protected: qint16 b = m_ptr + (HBFIRFilterTraits::hbOrder / 2) - 1; // go through samples in buffer - qint32 iAcc = 0; - qint32 qAcc = 0; + AccuType iAcc = 0; + AccuType qAcc = 0; for (int i = 0; i < HBFIRFilterTraits::hbOrder / 4; i++) { @@ -811,8 +811,8 @@ protected: qint16 b = m_ptr + (HBFIRFilterTraits::hbOrder / 2) - 1; // go through samples in buffer - qint32 iAcc = 0; - qint32 qAcc = 0; + AccuType iAcc = 0; + AccuType qAcc = 0; for (int i = 0; i < HBFIRFilterTraits::hbOrder / 4; i++) { @@ -839,8 +839,8 @@ protected: int b = HBFIRFilterTraits::hbMod[m_ptr + 2 - 2]; //-1 - 1 // go through samples in buffer - qint32 iAcc = 0; - qint32 qAcc = 0; + AccuType iAcc = 0; + AccuType qAcc = 0; for (int i = 0; i < HBFIRFilterTraits::hbOrder / 4; i++) { diff --git a/sdrbase/dsp/inthalfbandfilterdb.h b/sdrbase/dsp/inthalfbandfilterdb.h index 7ea442cee..4a153edc8 100644 --- a/sdrbase/dsp/inthalfbandfilterdb.h +++ b/sdrbase/dsp/inthalfbandfilterdb.h @@ -26,7 +26,7 @@ #include "dsp/hbfiltertraits.h" #include "util/export.h" -template +template class SDRANGEL_API IntHalfbandFilterDB { public: IntHalfbandFilterDB(); @@ -619,7 +619,7 @@ public: } protected: - qint32 m_samplesDB[2*(HBFIRFilterTraits::hbOrder - 1)][2]; // double buffer technique + AccuType m_samplesDB[2*(HBFIRFilterTraits::hbOrder - 1)][2]; // double buffer technique int m_ptr; int m_size; int m_state; @@ -649,8 +649,8 @@ protected: { int a = m_ptr + m_size; // tip pointer int b = m_ptr + 1; // tail pointer - qint32 iAcc = 0; - qint32 qAcc = 0; + AccuType iAcc = 0; + AccuType qAcc = 0; for (int i = 0; i < HBFIRFilterTraits::hbOrder / 4; i++) { @@ -671,8 +671,8 @@ protected: { int a = m_ptr + m_size; // tip pointer int b = m_ptr + 1; // tail pointer - qint32 iAcc = 0; - qint32 qAcc = 0; + AccuType iAcc = 0; + AccuType qAcc = 0; for (int i = 0; i < HBFIRFilterTraits::hbOrder / 4; i++) { @@ -695,8 +695,8 @@ protected: qint16 b = m_ptr + (HBFIRFilterTraits::hbOrder / 2) - 1; // go through samples in buffer - qint32 iAcc = 0; - qint32 qAcc = 0; + AccuType iAcc = 0; + AccuType qAcc = 0; for (int i = 0; i < HBFIRFilterTraits::hbOrder / 4; i++) { @@ -716,8 +716,8 @@ protected: qint16 b = m_ptr + (HBFIRFilterTraits::hbOrder / 2) - 1; // go through samples in buffer - qint32 iAcc = 0; - qint32 qAcc = 0; + AccuType iAcc = 0; + AccuType qAcc = 0; for (int i = 0; i < HBFIRFilterTraits::hbOrder / 4; i++) { @@ -732,8 +732,8 @@ protected: } }; -template -IntHalfbandFilterDB::IntHalfbandFilterDB() +template +IntHalfbandFilterDB::IntHalfbandFilterDB() { m_size = HBFIRFilterTraits::hbOrder - 1; diff --git a/sdrbase/dsp/samplesinkfifodecimator.h b/sdrbase/dsp/samplesinkfifodecimator.h index 1340b1f47..ed154ce3d 100644 --- a/sdrbase/dsp/samplesinkfifodecimator.h +++ b/sdrbase/dsp/samplesinkfifodecimator.h @@ -120,12 +120,12 @@ public: void decimate64_cen(SampleSinkFifoDoubleBuffered& fifo, const T* buf, qint32 len); private: - IntHalfbandFilter<32> m_decimator2; // 1st stages - IntHalfbandFilter<32> m_decimator4; // 2nd stages - IntHalfbandFilter<32> m_decimator8; // 3rd stages - IntHalfbandFilter<32> m_decimator16; // 4th stages - IntHalfbandFilter<32> m_decimator32; // 5th stages - IntHalfbandFilter<32> m_decimator64; // 6th stages + IntHalfbandFilter m_decimator2; // 1st stages + IntHalfbandFilter m_decimator4; // 2nd stages + IntHalfbandFilter m_decimator8; // 3rd stages + IntHalfbandFilter m_decimator16; // 4th stages + IntHalfbandFilter m_decimator32; // 5th stages + IntHalfbandFilter m_decimator64; // 6th stages }; template diff --git a/sdrbase/dsp/upchannelizer.cpp b/sdrbase/dsp/upchannelizer.cpp index d171c3d65..a59db9ad2 100644 --- a/sdrbase/dsp/upchannelizer.cpp +++ b/sdrbase/dsp/upchannelizer.cpp @@ -228,20 +228,20 @@ UpChannelizer::FilterStage::FilterStage(Mode mode) : } #else UpChannelizer::FilterStage::FilterStage(Mode mode) : - m_filter(new IntHalfbandFilterDB), + m_filter(new IntHalfbandFilterDB), m_workFunction(0) { switch(mode) { case ModeCenter: - m_workFunction = &IntHalfbandFilterDB::workInterpolateCenter; + m_workFunction = &IntHalfbandFilterDB::workInterpolateCenter; break; case ModeLowerHalf: - m_workFunction = &IntHalfbandFilterDB::workInterpolateLowerHalf; + m_workFunction = &IntHalfbandFilterDB::workInterpolateLowerHalf; break; case ModeUpperHalf: - m_workFunction = &IntHalfbandFilterDB::workInterpolateUpperHalf; + m_workFunction = &IntHalfbandFilterDB::workInterpolateUpperHalf; break; } } diff --git a/sdrbase/dsp/upchannelizer.h b/sdrbase/dsp/upchannelizer.h index 11cb2eb72..3b15f7a96 100644 --- a/sdrbase/dsp/upchannelizer.h +++ b/sdrbase/dsp/upchannelizer.h @@ -87,8 +87,8 @@ protected: typedef bool (IntHalfbandFilterEO1::*WorkFunction)(Sample* sIn, Sample *sOut); IntHalfbandFilterEO1* m_filter; #else - typedef bool (IntHalfbandFilterDB::*WorkFunction)(Sample* sIn, Sample *sOut); - IntHalfbandFilterDB* m_filter; + typedef bool (IntHalfbandFilterDB::*WorkFunction)(Sample* sIn, Sample *sOut); + IntHalfbandFilterDB* m_filter; #endif WorkFunction m_workFunction; From ad219d50cc999c5bdd7de8ac904fc59e9f62088e Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 21 Jan 2018 21:48:36 +0100 Subject: [PATCH 07/27] Implemented 24 bit internal DSP (with bugs ...) --- CMakeLists.txt | 4 ++ sdrbase/dsp/decimators.h | 103 ++++++++++++++++++++++++++++++++ sdrbase/dsp/decimatorsu.h | 85 ++++++++++++++++++++++++++ sdrbase/dsp/downchannelizer.cpp | 24 +++++++- sdrbase/dsp/downchannelizer.h | 9 +++ sdrbase/dsp/interpolators.h | 13 ++++ sdrbase/dsp/upchannelizer.cpp | 21 +++++++ sdrbase/dsp/upchannelizer.h | 9 +++ 8 files changed, 267 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b153e0148..27421bd1f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,7 @@ option(V4L-MSI "Use Linux Kernel MSI2500 Source." OFF) option(BUILD_TYPE "Build type (RELEASE, RELEASEWITHDBGINFO, DEBUG" RELEASE) option(DEBUG_OUTPUT "Print debug messages" OFF) option(HOST_RPI "Compiling on RPi" OFF) +option(SAMPLE_24BIT "Internal 24 bit DSP" OFF) list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) @@ -186,6 +187,9 @@ elseif (${ARCHITECTURE} MATCHES "aarch64") endif() # Compiler flags. +if (SAMPLE_24BIT) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSAMPLE_24BIT") +endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -fmax-errors=10 -ffast-math -ftree-vectorize ${EXTRA_FLAGS}") ############################################################################## diff --git a/sdrbase/dsp/decimators.h b/sdrbase/dsp/decimators.h index c8bbd27af..e625141af 100644 --- a/sdrbase/dsp/decimators.h +++ b/sdrbase/dsp/decimators.h @@ -18,11 +18,15 @@ #define INCLUDE_GPL_DSP_DECIMATORS_H_ #include "dsp/dsptypes.h" +#ifdef SAMPLE_24BIT +#include "dsp/inthalfbandfilterdb.h" +#else #ifdef USE_SSE4_1 #include "dsp/inthalfbandfiltereo1.h" #else #include "dsp/inthalfbandfilterdb.h" #endif +#endif #define DECIMATORS_HB_FILTER_ORDER 64 @@ -44,6 +48,42 @@ struct decimation_shifts static const uint post64 = 0; }; +template<> +struct decimation_shifts<16, 24> +{ + static const uint pre1 = 0; + static const uint pre2 = 0; + static const uint post2 = 9; + static const uint pre4 = 0; + static const uint post4 = 10; + static const uint pre8 = 0; + static const uint post8 = 11; + static const uint pre16 = 0; + static const uint post16 = 12; + static const uint pre32 = 0; + static const uint post32 = 13; + static const uint pre64 = 0; + static const uint post64 = 14; +}; + +template<> +struct decimation_shifts<24, 24> +{ + static const uint pre1 = 0; + static const uint pre2 = 0; + static const uint post2 = 1; + static const uint pre4 = 0; + static const uint post4 = 2; + static const uint pre8 = 0; + static const uint post8 = 3; + static const uint pre16 = 0; + static const uint post16 = 4; + static const uint pre32 = 0; + static const uint post32 = 5; + static const uint pre64 = 0; + static const uint post64 = 6; +}; + template<> struct decimation_shifts<16, 16> { @@ -62,6 +102,24 @@ struct decimation_shifts<16, 16> static const uint post64 = 6; }; +template<> +struct decimation_shifts<24, 16> +{ + static const uint pre1 = 8; + static const uint pre2 = 7; + static const uint post2 = 0; + static const uint pre4 = 6; + static const uint post4 = 0; + static const uint pre8 = 5; + static const uint post8 = 0; + static const uint pre16 = 4; + static const uint post16 = 0; + static const uint pre32 = 3; + static const uint post32 = 0; + static const uint pre64 = 2; + static const uint post64 = 0; +}; + template<> struct decimation_shifts<16, 12> { @@ -80,6 +138,24 @@ struct decimation_shifts<16, 12> static const uint post64 = 2; }; +template<> +struct decimation_shifts<24, 12> +{ + static const uint pre1 = 12; + static const uint pre2 = 11; + static const uint post2 = 0; + static const uint pre4 = 10; + static const uint post4 = 0; + static const uint pre8 = 9; + static const uint post8 = 0; + static const uint pre16 = 8; + static const uint post16 = 0; + static const uint pre32 = 7; + static const uint post32 = 0; + static const uint pre64 = 6; + static const uint post64 = 0; +}; + template<> struct decimation_shifts<16, 8> { @@ -98,6 +174,24 @@ struct decimation_shifts<16, 8> static const uint post64 = 0; }; +template<> +struct decimation_shifts<24, 8> +{ + static const uint pre1 = 16; + static const uint pre2 = 15; + static const uint post2 = 0; + static const uint pre4 = 14; + static const uint post4 = 0; + static const uint pre8 = 13; + static const uint post8 = 0; + static const uint pre16 = 12; + static const uint post16 = 0; + static const uint pre32 = 11; + static const uint post32 = 0; + static const uint pre64 = 10; + static const uint post64 = 0; +}; + template class Decimators { @@ -146,6 +240,14 @@ public: void decimate64_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len); private: +#ifdef SAMPLE_24BIT + IntHalfbandFilterDB m_decimator2; // 1st stages + IntHalfbandFilterDB m_decimator4; // 2nd stages + IntHalfbandFilterDB m_decimator8; // 3rd stages + IntHalfbandFilterDB m_decimator16; // 4th stages + IntHalfbandFilterDB m_decimator32; // 5th stages + IntHalfbandFilterDB m_decimator64; // 6th stages +#else #ifdef USE_SSE4_1 IntHalfbandFilterEO1 m_decimator2; // 1st stages IntHalfbandFilterEO1 m_decimator4; // 2nd stages @@ -161,6 +263,7 @@ private: IntHalfbandFilterDB m_decimator32; // 5th stages IntHalfbandFilterDB m_decimator64; // 6th stages #endif +#endif }; template diff --git a/sdrbase/dsp/decimatorsu.h b/sdrbase/dsp/decimatorsu.h index 2e0b04aaf..fe2e0aa55 100644 --- a/sdrbase/dsp/decimatorsu.h +++ b/sdrbase/dsp/decimatorsu.h @@ -24,11 +24,15 @@ #define INCLUDE_GPL_DSP_DECIMATORSU_H_ #include "dsp/dsptypes.h" +#ifdef SAMPLE_24BIT +#include "dsp/inthalfbandfilterdb.h" +#else #ifdef USE_SSE4_1 #include "dsp/inthalfbandfiltereo1.h" #else #include "dsp/inthalfbandfilterdb.h" #endif +#endif #define DECIMATORS_HB_FILTER_ORDER 64 @@ -50,6 +54,24 @@ struct decimation_shifts static const uint post64 = 0; }; +template<> +struct decimation_shifts<24, 24> +{ + static const uint pre1 = 0; + static const uint pre2 = 0; + static const uint post2 = 1; + static const uint pre4 = 0; + static const uint post4 = 2; + static const uint pre8 = 0; + static const uint post8 = 3; + static const uint pre16 = 0; + static const uint post16 = 4; + static const uint pre32 = 0; + static const uint post32 = 5; + static const uint pre64 = 0; + static const uint post64 = 6; +}; + template<> struct decimation_shifts<16, 16> { @@ -68,6 +90,24 @@ struct decimation_shifts<16, 16> static const uint post64 = 6; }; +template<> +struct decimation_shifts<24, 16> +{ + static const uint pre1 = 8; + static const uint pre2 = 7; + static const uint post2 = 0; + static const uint pre4 = 6; + static const uint post4 = 0; + static const uint pre8 = 5; + static const uint post8 = 0; + static const uint pre16 = 4; + static const uint post16 = 0; + static const uint pre32 = 3; + static const uint post32 = 0; + static const uint pre64 = 2; + static const uint post64 = 0; +}; + template<> struct decimation_shifts<16, 12> { @@ -86,6 +126,24 @@ struct decimation_shifts<16, 12> static const uint post64 = 2; }; +template<> +struct decimation_shifts<24, 12> +{ + static const uint pre1 = 12; + static const uint pre2 = 11; + static const uint post2 = 0; + static const uint pre4 = 10; + static const uint post4 = 0; + static const uint pre8 = 9; + static const uint post8 = 0; + static const uint pre16 = 8; + static const uint post16 = 0; + static const uint pre32 = 7; + static const uint post32 = 0; + static const uint pre64 = 6; + static const uint post64 = 0; +}; + template<> struct decimation_shifts<16, 8> { @@ -104,6 +162,24 @@ struct decimation_shifts<16, 8> static const uint post64 = 0; }; +template<> +struct decimation_shifts<24, 8> +{ + static const uint pre1 = 16; + static const uint pre2 = 15; + static const uint post2 = 0; + static const uint pre4 = 14; + static const uint post4 = 0; + static const uint pre8 = 13; + static const uint post8 = 0; + static const uint pre16 = 12; + static const uint post16 = 0; + static const uint pre32 = 11; + static const uint post32 = 0; + static const uint pre64 = 10; + static const uint post64 = 0; +}; + template class DecimatorsU { @@ -130,6 +206,14 @@ public: void decimate64_cen(SampleVector::iterator* it, const T* buf, qint32 len); private: +#ifdef SAMPLE_24BIT + IntHalfbandFilterDB m_decimator2; // 1st stages + IntHalfbandFilterDB m_decimator4; // 2nd stages + IntHalfbandFilterDB m_decimator8; // 3rd stages + IntHalfbandFilterDB m_decimator16; // 4th stages + IntHalfbandFilterDB m_decimator32; // 5th stages + IntHalfbandFilterDB m_decimator64; // 6th stages +#else #ifdef USE_SSE4_1 IntHalfbandFilterEO1 m_decimator2; // 1st stages IntHalfbandFilterEO1 m_decimator4; // 2nd stages @@ -145,6 +229,7 @@ private: IntHalfbandFilterDB m_decimator32; // 5th stages IntHalfbandFilterDB m_decimator64; // 6th stages #endif +#endif }; template diff --git a/sdrbase/dsp/downchannelizer.cpp b/sdrbase/dsp/downchannelizer.cpp index e39b523b8..59d27e41f 100644 --- a/sdrbase/dsp/downchannelizer.cpp +++ b/sdrbase/dsp/downchannelizer.cpp @@ -192,6 +192,28 @@ void DownChannelizer::applyConfiguration() } } +#ifdef SAMPLE_24BIT +DownChannelizer::FilterStage::FilterStage(Mode mode) : + m_filter(new IntHalfbandFilterDB), + m_workFunction(0), + m_mode(mode), + m_sse(false) +{ + switch(mode) { + case ModeCenter: + m_workFunction = &IntHalfbandFilterDB::workDecimateCenter; + break; + + case ModeLowerHalf: + m_workFunction = &IntHalfbandFilterDB::workDecimateLowerHalf; + break; + + case ModeUpperHalf: + m_workFunction = &IntHalfbandFilterDB::workDecimateUpperHalf; + break; + } +} +#else #ifdef USE_SSE4_1 DownChannelizer::FilterStage::FilterStage(Mode mode) : m_filter(new IntHalfbandFilterEO1), @@ -235,7 +257,7 @@ DownChannelizer::FilterStage::FilterStage(Mode mode) : } } #endif - +#endif DownChannelizer::FilterStage::~FilterStage() { delete m_filter; diff --git a/sdrbase/dsp/downchannelizer.h b/sdrbase/dsp/downchannelizer.h index d77c4a402..c770f2948 100644 --- a/sdrbase/dsp/downchannelizer.h +++ b/sdrbase/dsp/downchannelizer.h @@ -23,11 +23,15 @@ #include #include "util/export.h" #include "util/message.h" +#ifdef SAMPLE_24BIT +#include "dsp/inthalfbandfilterdb.h" +#else #ifdef USE_SSE4_1 #include "dsp/inthalfbandfiltereo1.h" #else #include "dsp/inthalfbandfilterdb.h" #endif +#endif #define DOWNCHANNELIZER_HB_FILTER_ORDER 48 @@ -78,12 +82,17 @@ protected: ModeUpperHalf }; +#ifdef SAMPLE_24BIT + typedef bool (IntHalfbandFilterDB::*WorkFunction)(Sample* s); + IntHalfbandFilterDB* m_filter; +#else #ifdef USE_SSE4_1 typedef bool (IntHalfbandFilterEO1::*WorkFunction)(Sample* s); IntHalfbandFilterEO1* m_filter; #else typedef bool (IntHalfbandFilterDB::*WorkFunction)(Sample* s); IntHalfbandFilterDB* m_filter; +#endif #endif WorkFunction m_workFunction; Mode m_mode; diff --git a/sdrbase/dsp/interpolators.h b/sdrbase/dsp/interpolators.h index d64619f40..f565e26a2 100644 --- a/sdrbase/dsp/interpolators.h +++ b/sdrbase/dsp/interpolators.h @@ -18,11 +18,15 @@ #define INCLUDE_GPL_DSP_INTERPOLATORS_H_ #include "dsp/dsptypes.h" +#ifdef SAMPLE_24BIT +#include "dsp/inthalfbandfilterdb.h" +#else #ifdef USE_SSE4_1 #include "dsp/inthalfbandfiltereo1.h" #else #include "dsp/inthalfbandfilterdb.h" #endif +#endif #define INTERPOLATORS_HB_FILTER_ORDER_FIRST 64 #define INTERPOLATORS_HB_FILTER_ORDER_SECOND 32 @@ -114,6 +118,14 @@ public: void interpolate64_cen(SampleVector::iterator* it, T* buf, qint32 len); private: +#ifdef SAMPLE_24BIT + IntHalfbandFilterDB m_interpolator2; // 1st stages + IntHalfbandFilterDB m_interpolator4; // 2nd stages + IntHalfbandFilterDB m_interpolator8; // 3rd stages + IntHalfbandFilterDB m_interpolator16; // 4th stages + IntHalfbandFilterDB m_interpolator32; // 5th stages + IntHalfbandFilterDB m_interpolator64; // 6th stages +#else #ifdef USE_SSE4_1 IntHalfbandFilterEO1 m_interpolator2; // 1st stages IntHalfbandFilterEO1 m_interpolator4; // 2nd stages @@ -129,6 +141,7 @@ private: IntHalfbandFilterDB m_interpolator32; // 5th stages IntHalfbandFilterDB m_interpolator64; // 6th stages #endif +#endif }; template diff --git a/sdrbase/dsp/upchannelizer.cpp b/sdrbase/dsp/upchannelizer.cpp index a59db9ad2..6ae1f045c 100644 --- a/sdrbase/dsp/upchannelizer.cpp +++ b/sdrbase/dsp/upchannelizer.cpp @@ -207,6 +207,26 @@ void UpChannelizer::applyConfiguration() } } +#ifdef SAMPLE_24BIT +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; + } +} +#else #ifdef USE_SSE4_1 UpChannelizer::FilterStage::FilterStage(Mode mode) : m_filter(new IntHalfbandFilterEO1), @@ -246,6 +266,7 @@ UpChannelizer::FilterStage::FilterStage(Mode mode) : } } #endif +#endif UpChannelizer::FilterStage::~FilterStage() { diff --git a/sdrbase/dsp/upchannelizer.h b/sdrbase/dsp/upchannelizer.h index 3b15f7a96..fbc0b63da 100644 --- a/sdrbase/dsp/upchannelizer.h +++ b/sdrbase/dsp/upchannelizer.h @@ -23,11 +23,15 @@ #include #include "util/export.h" #include "util/message.h" +#ifdef SAMPLE_24BIT +#include "dsp/inthalfbandfilterdb.h" +#else #ifdef USE_SSE4_1 #include "dsp/inthalfbandfiltereo1.h" #else #include "dsp/inthalfbandfilterdb.h" #endif +#endif #define UPCHANNELIZER_HB_FILTER_ORDER 96 @@ -83,12 +87,17 @@ protected: ModeUpperHalf }; +#ifdef SAMPLE_24BIT + typedef bool (IntHalfbandFilterDB::*WorkFunction)(Sample* sIn, Sample *sOut); + IntHalfbandFilterDB* m_filter; +#else #ifdef USE_SSE4_1 typedef bool (IntHalfbandFilterEO1::*WorkFunction)(Sample* sIn, Sample *sOut); IntHalfbandFilterEO1* m_filter; #else typedef bool (IntHalfbandFilterDB::*WorkFunction)(Sample* sIn, Sample *sOut); IntHalfbandFilterDB* m_filter; +#endif #endif WorkFunction m_workFunction; From 732561152b58aac21d49384ced7d2963e6dab989 Mon Sep 17 00:00:00 2001 From: f4exb Date: Mon, 22 Jan 2018 02:49:06 +0100 Subject: [PATCH 08/27] 24 bit DSP fix --- CMakeLists.txt | 2 +- plugins/samplesource/airspy/airspythread.h | 6 +- .../samplesource/airspyhf/airspyhfthread.h | 6 +- .../bladerfinput/bladerfinputthread.h | 6 +- .../hackrfinput/hackrfinputthread.h | 6 +- .../limesdrinput/limesdrinputthread.h | 6 +- .../plutosdrinput/plutosdrinputthread.h | 6 +- plugins/samplesource/rtlsdr/rtlsdrthread.h | 6 +- plugins/samplesource/sdrplay/sdrplaythread.h | 6 +- .../testsource/testsourcethread.h | 12 +- sdrbase/dsp/decimators.h | 457 +++++------------- sdrbase/dsp/decimatorsu.h | 116 ++--- sdrbase/dsp/downchannelizer.cpp | 2 +- sdrbase/dsp/downchannelizer.h | 4 +- sdrbase/dsp/dsptypes.h | 2 +- sdrbase/dsp/interpolators.h | 4 +- sdrbase/dsp/inthalfbandfilter.h | 64 +-- sdrbase/dsp/inthalfbandfilterdb.h | 160 +++--- sdrbase/dsp/upchannelizer.cpp | 2 +- sdrbase/dsp/upchannelizer.h | 4 +- 20 files changed, 362 insertions(+), 515 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 27421bd1f..2e5b2f1b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -188,7 +188,7 @@ endif() # Compiler flags. if (SAMPLE_24BIT) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSAMPLE_24BIT") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSDR_SAMPLE_24BIT") endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -fmax-errors=10 -ffast-math -ftree-vectorize ${EXTRA_FLAGS}") diff --git a/plugins/samplesource/airspy/airspythread.h b/plugins/samplesource/airspy/airspythread.h index 52fa601e3..a5d62feda 100644 --- a/plugins/samplesource/airspy/airspythread.h +++ b/plugins/samplesource/airspy/airspythread.h @@ -55,7 +55,11 @@ private: int m_fcPos; static AirspyThread *m_this; - Decimators m_decimators; +#ifdef SDR_SAMPLE_24BIT + Decimators m_decimators; +#else + Decimators m_decimators; +#endif void run(); void callback(const qint16* buf, qint32 len); diff --git a/plugins/samplesource/airspyhf/airspyhfthread.h b/plugins/samplesource/airspyhf/airspyhfthread.h index 0056f5f87..9f22cb6f0 100644 --- a/plugins/samplesource/airspyhf/airspyhfthread.h +++ b/plugins/samplesource/airspyhf/airspyhfthread.h @@ -53,7 +53,11 @@ private: unsigned int m_log2Decim; static AirspyHFThread *m_this; - Decimators m_decimators; +#ifdef SDR_SAMPLE_24BIT + Decimators m_decimators; +#else + Decimators m_decimators; +#endif void run(); void callback(const qint16* buf, qint32 len); diff --git a/plugins/samplesource/bladerfinput/bladerfinputthread.h b/plugins/samplesource/bladerfinput/bladerfinputthread.h index 4cebd38b9..60e21a2d7 100644 --- a/plugins/samplesource/bladerfinput/bladerfinputthread.h +++ b/plugins/samplesource/bladerfinput/bladerfinputthread.h @@ -51,7 +51,11 @@ private: unsigned int m_log2Decim; int m_fcPos; - Decimators m_decimators; +#ifdef SDR_SAMPLE_24BIT + Decimators m_decimators; +#else + Decimators m_decimators; +#endif void run(); void callback(const qint16* buf, qint32 len); diff --git a/plugins/samplesource/hackrfinput/hackrfinputthread.h b/plugins/samplesource/hackrfinput/hackrfinputthread.h index 5ef0fb32a..0f07c77df 100644 --- a/plugins/samplesource/hackrfinput/hackrfinputthread.h +++ b/plugins/samplesource/hackrfinput/hackrfinputthread.h @@ -54,7 +54,11 @@ private: unsigned int m_log2Decim; int m_fcPos; - Decimators m_decimators; +#ifdef SDR_SAMPLE_24BIT + Decimators m_decimators; +#else + Decimators m_decimators; +#endif void run(); void callback(const qint8* buf, qint32 len); diff --git a/plugins/samplesource/limesdrinput/limesdrinputthread.h b/plugins/samplesource/limesdrinput/limesdrinputthread.h index dd5fb3772..d83919c11 100644 --- a/plugins/samplesource/limesdrinput/limesdrinputthread.h +++ b/plugins/samplesource/limesdrinput/limesdrinputthread.h @@ -55,7 +55,11 @@ private: unsigned int m_log2Decim; // soft decimation - Decimators m_decimators; +#ifdef SDR_SAMPLE_24BIT + Decimators m_decimators; +#else + Decimators m_decimators; +#endif void run(); void callback(const qint16* buf, qint32 len); diff --git a/plugins/samplesource/plutosdrinput/plutosdrinputthread.h b/plugins/samplesource/plutosdrinput/plutosdrinputthread.h index f6373deb2..2e1e94fbe 100644 --- a/plugins/samplesource/plutosdrinput/plutosdrinputthread.h +++ b/plugins/samplesource/plutosdrinput/plutosdrinputthread.h @@ -59,7 +59,11 @@ private: int m_fcPos; float m_phasor; - Decimators m_decimators; +#ifdef SDR_SAMPLE_24BIT + Decimators m_decimators; +#else + Decimators m_decimators; +#endif void run(); void convert(const qint16* buf, qint32 len); diff --git a/plugins/samplesource/rtlsdr/rtlsdrthread.h b/plugins/samplesource/rtlsdr/rtlsdrthread.h index 5c4d7ed9f..a3ef61c02 100644 --- a/plugins/samplesource/rtlsdr/rtlsdrthread.h +++ b/plugins/samplesource/rtlsdr/rtlsdrthread.h @@ -52,7 +52,11 @@ private: unsigned int m_log2Decim; int m_fcPos; - DecimatorsU m_decimators; +#ifdef SDR_SAMPLE_24BIT + DecimatorsU m_decimators; +#else + DecimatorsU m_decimators; +#endif void run(); void callback(const quint8* buf, qint32 len); diff --git a/plugins/samplesource/sdrplay/sdrplaythread.h b/plugins/samplesource/sdrplay/sdrplaythread.h index 2882f4a44..d11a11145 100644 --- a/plugins/samplesource/sdrplay/sdrplaythread.h +++ b/plugins/samplesource/sdrplay/sdrplaythread.h @@ -52,7 +52,11 @@ private: unsigned int m_log2Decim; int m_fcPos; - Decimators m_decimators; +#ifdef SDR_SAMPLE_24BIT + Decimators m_decimators; +#else + Decimators m_decimators; +#endif void run(); void callback(const qint16* buf, qint32 len); diff --git a/plugins/samplesource/testsource/testsourcethread.h b/plugins/samplesource/testsource/testsourcethread.h index d7f237cb6..b1759c90e 100644 --- a/plugins/samplesource/testsource/testsourcethread.h +++ b/plugins/samplesource/testsource/testsourcethread.h @@ -85,9 +85,15 @@ private: bool m_throttleToggle; QMutex m_mutex; - Decimators m_decimators_8; - Decimators m_decimators_12; - Decimators m_decimators_16; +#ifdef SDR_SAMPLE_24BIT + Decimators m_decimators_8; + Decimators m_decimators_12; + Decimators m_decimators_16; +#else + Decimators m_decimators_8; + Decimators m_decimators_12; + Decimators m_decimators_16; +#endif void run(); void callback(const qint16* buf, qint32 len); diff --git a/sdrbase/dsp/decimators.h b/sdrbase/dsp/decimators.h index e625141af..589d08b82 100644 --- a/sdrbase/dsp/decimators.h +++ b/sdrbase/dsp/decimators.h @@ -18,7 +18,7 @@ #define INCLUDE_GPL_DSP_DECIMATORS_H_ #include "dsp/dsptypes.h" -#ifdef SAMPLE_24BIT +#ifdef SDR_SAMPLE_24BIT #include "dsp/inthalfbandfilterdb.h" #else #ifdef USE_SSE4_1 @@ -192,7 +192,7 @@ struct decimation_shifts<24, 8> static const uint post64 = 0; }; -template +template class Decimators { public: @@ -240,7 +240,7 @@ public: void decimate64_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len); private: -#ifdef SAMPLE_24BIT +#ifdef SDR_SAMPLE_24BIT IntHalfbandFilterDB m_decimator2; // 1st stages IntHalfbandFilterDB m_decimator4; // 2nd stages IntHalfbandFilterDB m_decimator8; // 3rd stages @@ -266,8 +266,8 @@ private: #endif }; -template -void Decimators::decimate1(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate1(SampleVector::iterator* it, const T* buf, qint32 len) { qint32 xreal, yimag; @@ -281,8 +281,8 @@ void Decimators::decimate1(SampleVector::iterator* it, co } } -template -void Decimators::decimate1(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate1(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { qint32 xreal, yimag; @@ -296,10 +296,10 @@ void Decimators::decimate1(SampleVector::iterator* it, co } } -template -void Decimators::decimate2_u(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate2_u(SampleVector::iterator* it, const T* buf, qint32 len) { - qint32 xreal, yimag; + AccuType xreal, yimag; for (int pos = 0; pos < len - 7; pos += 8) { @@ -317,10 +317,10 @@ void Decimators::decimate2_u(SampleVector::iterator* it, } } -template -void Decimators::decimate2_u(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate2_u(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - qint32 xreal, yimag; + AccuType xreal, yimag; for (int pos = 0; pos < len - 3; pos += 4) { @@ -340,10 +340,10 @@ void Decimators::decimate2_u(SampleVector::iterator* it, } } -template -void Decimators::decimate2_inf(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate2_inf(SampleVector::iterator* it, const T* buf, qint32 len) { - qint32 xreal, yimag; + AccuType xreal, yimag; for (int pos = 0; pos < len - 7; pos += 8) { @@ -361,10 +361,10 @@ void Decimators::decimate2_inf(SampleVector::iterator* it } } -template -void Decimators::decimate2_inf(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate2_inf(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - qint32 xreal, yimag; + AccuType xreal, yimag; for (int pos = 0; pos < len - 3; pos += 4) { @@ -384,10 +384,10 @@ void Decimators::decimate2_inf(SampleVector::iterator* it } } -template -void Decimators::decimate2_sup(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate2_sup(SampleVector::iterator* it, const T* buf, qint32 len) { - qint32 xreal, yimag; + AccuType xreal, yimag; for (int pos = 0; pos < len - 7; pos += 8) { @@ -405,10 +405,10 @@ void Decimators::decimate2_sup(SampleVector::iterator* it } } -template -void Decimators::decimate2_sup(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate2_sup(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - qint32 xreal, yimag; + AccuType xreal, yimag; for (int pos = 0; pos < len - 3; pos += 4) { @@ -428,10 +428,10 @@ void Decimators::decimate2_sup(SampleVector::iterator* it } } -template -void Decimators::decimate4_inf(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate4_inf(SampleVector::iterator* it, const T* buf, qint32 len) { - qint32 xreal, yimag; + AccuType xreal, yimag; for (int pos = 0; pos < len - 7; pos += 8) { @@ -445,10 +445,10 @@ void Decimators::decimate4_inf(SampleVector::iterator* it } } -template -void Decimators::decimate4_inf(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate4_inf(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - qint32 xreal, yimag; + AccuType xreal, yimag; for (int pos = 0; pos < len - 3; pos += 4) { @@ -462,8 +462,8 @@ void Decimators::decimate4_inf(SampleVector::iterator* it } } -template -void Decimators::decimate4_sup(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate4_sup(SampleVector::iterator* it, const T* buf, qint32 len) { // Sup (USB): // x y x y x y x y / x -> 1,-2,-5,6 / y -> -0,-3,4,7 @@ -471,7 +471,7 @@ void Decimators::decimate4_sup(SampleVector::iterator* it // Inf (LSB): // x y x y x y x y / x -> 0,-3,-4,7 / y -> 1,2,-5,-6 // [ rotate: 0, 1, -3, 2, -4, -5, 7, -6] - qint32 xreal, yimag; + AccuType xreal, yimag; for (int pos = 0; pos < len - 7; pos += 8) { @@ -485,10 +485,10 @@ void Decimators::decimate4_sup(SampleVector::iterator* it } } -template -void Decimators::decimate4_sup(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate4_sup(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - qint32 xreal, yimag; + AccuType xreal, yimag; for (int pos = 0; pos < len - 3; pos += 4) { @@ -502,10 +502,10 @@ void Decimators::decimate4_sup(SampleVector::iterator* it } } -template -void Decimators::decimate8_inf(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate8_inf(SampleVector::iterator* it, const T* buf, qint32 len) { - qint32 xreal[2], yimag[2]; + AccuType xreal[2], yimag[2]; for (int pos = 0; pos < len - 15; pos += 8) { @@ -525,10 +525,10 @@ void Decimators::decimate8_inf(SampleVector::iterator* it } } -template -void Decimators::decimate8_inf(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate8_inf(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - qint32 xreal[2], yimag[2]; + AccuType xreal[2], yimag[2]; for (int pos = 0; pos < len - 7; pos += 4) { @@ -548,10 +548,10 @@ void Decimators::decimate8_inf(SampleVector::iterator* it } } -template -void Decimators::decimate8_sup(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate8_sup(SampleVector::iterator* it, const T* buf, qint32 len) { - qint32 xreal[2], yimag[2]; + AccuType xreal[2], yimag[2]; for (int pos = 0; pos < len - 15; pos += 8) { @@ -571,10 +571,10 @@ void Decimators::decimate8_sup(SampleVector::iterator* it } } -template -void Decimators::decimate8_sup(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate8_sup(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - qint32 xreal[2], yimag[2]; + AccuType xreal[2], yimag[2]; for (int pos = 0; pos < len - 7; pos += 4) { @@ -594,12 +594,12 @@ void Decimators::decimate8_sup(SampleVector::iterator* it } } -template -void Decimators::decimate16_inf(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate16_inf(SampleVector::iterator* it, const T* buf, qint32 len) { // Offset tuning: 4x downsample and rotate, then // downsample 4x more. [ rotate: 0, 1, -3, 2, -4, -5, 7, -6] - qint32 xreal[4], yimag[4]; + AccuType xreal[4], yimag[4]; for (int pos = 0; pos < len - 31; ) { @@ -622,12 +622,12 @@ void Decimators::decimate16_inf(SampleVector::iterator* i } } -template -void Decimators::decimate16_inf(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate16_inf(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { // Offset tuning: 4x downsample and rotate, then // downsample 4x more. [ rotate: 0, 1, -3, 2, -4, -5, 7, -6] - qint32 xreal[4], yimag[4]; + AccuType xreal[4], yimag[4]; for (int pos = 0; pos < len - 15; ) { @@ -650,12 +650,12 @@ void Decimators::decimate16_inf(SampleVector::iterator* i } } -template -void Decimators::decimate16_sup(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate16_sup(SampleVector::iterator* it, const T* buf, qint32 len) { // Offset tuning: 4x downsample and rotate, then // downsample 4x more. [ rotate: 1, 0, -2, 3, -5, -4, 6, -7] - qint32 xreal[4], yimag[4]; + AccuType xreal[4], yimag[4]; for (int pos = 0; pos < len - 31; ) { @@ -678,12 +678,12 @@ void Decimators::decimate16_sup(SampleVector::iterator* i } } -template -void Decimators::decimate16_sup(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate16_sup(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { // Offset tuning: 4x downsample and rotate, then // downsample 4x more. [ rotate: 1, 0, -2, 3, -5, -4, 6, -7] - qint32 xreal[4], yimag[4]; + AccuType xreal[4], yimag[4]; for (int pos = 0; pos < len - 15; ) { @@ -706,10 +706,10 @@ void Decimators::decimate16_sup(SampleVector::iterator* i } } -template -void Decimators::decimate32_inf(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate32_inf(SampleVector::iterator* it, const T* buf, qint32 len) { - qint32 xreal[8], yimag[8]; + AccuType xreal[8], yimag[8]; for (int pos = 0; pos < len - 63; ) { @@ -737,10 +737,10 @@ void Decimators::decimate32_inf(SampleVector::iterator* i } } -template -void Decimators::decimate32_inf(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate32_inf(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - qint32 xreal[8], yimag[8]; + AccuType xreal[8], yimag[8]; for (int pos = 0; pos < len - 31; ) { @@ -768,10 +768,10 @@ void Decimators::decimate32_inf(SampleVector::iterator* i } } -template -void Decimators::decimate32_sup(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate32_sup(SampleVector::iterator* it, const T* buf, qint32 len) { - qint32 xreal[8], yimag[8]; + AccuType xreal[8], yimag[8]; for (int pos = 0; pos < len - 63; ) { @@ -799,10 +799,10 @@ void Decimators::decimate32_sup(SampleVector::iterator* i } } -template -void Decimators::decimate32_sup(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate32_sup(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - qint32 xreal[8], yimag[8]; + AccuType xreal[8], yimag[8]; for (int pos = 0; pos < len - 31; ) { @@ -830,10 +830,10 @@ void Decimators::decimate32_sup(SampleVector::iterator* i } } -template -void Decimators::decimate64_inf(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate64_inf(SampleVector::iterator* it, const T* buf, qint32 len) { - qint32 xreal[16], yimag[16]; + AccuType xreal[16], yimag[16]; for (int pos = 0; pos < len - 127; ) { @@ -870,10 +870,10 @@ void Decimators::decimate64_inf(SampleVector::iterator* i } } -template -void Decimators::decimate64_inf(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate64_inf(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - qint32 xreal[16], yimag[16]; + AccuType xreal[16], yimag[16]; for (int pos = 0; pos < len - 63; ) { @@ -910,10 +910,10 @@ void Decimators::decimate64_inf(SampleVector::iterator* i } } -template -void Decimators::decimate64_sup(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate64_sup(SampleVector::iterator* it, const T* buf, qint32 len) { - qint32 xreal[16], yimag[16]; + AccuType xreal[16], yimag[16]; for (int pos = 0; pos < len - 127; ) { @@ -950,10 +950,10 @@ void Decimators::decimate64_sup(SampleVector::iterator* i } } -template -void Decimators::decimate64_sup(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate64_sup(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - qint32 xreal[16], yimag[16]; + AccuType xreal[16], yimag[16]; for (int pos = 0; pos < len - 63; ) { @@ -990,10 +990,10 @@ void Decimators::decimate64_sup(SampleVector::iterator* i } } -template -void Decimators::decimate2_cen(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate2_cen(SampleVector::iterator* it, const T* buf, qint32 len) { - qint32 intbuf[2]; + AccuType intbuf[2]; for (int pos = 0; pos < len - 3; pos += 4) { @@ -1008,14 +1008,15 @@ void Decimators::decimate2_cen(SampleVector::iterator* it (**it).setReal(intbuf[0] >> decimation_shifts::post2); (**it).setImag(intbuf[1] >> decimation_shifts::post2); + ++(*it); } } -template -void Decimators::decimate2_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate2_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - qint32 intbuf[2]; + AccuType intbuf[2]; for (int pos = 0; pos < len - 1; pos += 2) { @@ -1034,10 +1035,10 @@ void Decimators::decimate2_cen(SampleVector::iterator* it } } -template -void Decimators::decimate4_cen(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate4_cen(SampleVector::iterator* it, const T* buf, qint32 len) { - qint32 intbuf[4]; + AccuType intbuf[4]; for (int pos = 0; pos < len - 7; pos += 8) { @@ -1069,10 +1070,10 @@ void Decimators::decimate4_cen(SampleVector::iterator* it } } -template -void Decimators::decimate4_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate4_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - qint32 intbuf[4]; + AccuType intbuf[4]; for (int pos = 0; pos < len - 3; pos += 4) { @@ -1104,10 +1105,10 @@ void Decimators::decimate4_cen(SampleVector::iterator* it } } -template -void Decimators::decimate8_cen(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate8_cen(SampleVector::iterator* it, const T* buf, qint32 len) { - qint32 intbuf[8]; + AccuType intbuf[8]; for (int pos = 0; pos < len - 15; pos += 16) { @@ -1164,10 +1165,10 @@ void Decimators::decimate8_cen(SampleVector::iterator* it } } -template -void Decimators::decimate8_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate8_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - qint32 intbuf[8]; + AccuType intbuf[8]; for (int pos = 0; pos < len - 7; pos += 8) { @@ -1224,10 +1225,10 @@ void Decimators::decimate8_cen(SampleVector::iterator* it } } -template -void Decimators::decimate16_cen(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate16_cen(SampleVector::iterator* it, const T* buf, qint32 len) { - qint32 intbuf[16]; + AccuType intbuf[16]; for (int pos = 0; pos < len - 31; pos += 32) { @@ -1333,10 +1334,10 @@ void Decimators::decimate16_cen(SampleVector::iterator* i } } -template -void Decimators::decimate16_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate16_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - qint32 intbuf[16]; + AccuType intbuf[16]; for (int pos = 0; pos < len - 15; pos += 16) { @@ -1442,10 +1443,10 @@ void Decimators::decimate16_cen(SampleVector::iterator* i } } -template -void Decimators::decimate32_cen(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate32_cen(SampleVector::iterator* it, const T* buf, qint32 len) { - qint32 intbuf[32]; + AccuType intbuf[32]; for (int pos = 0; pos < len - 63; pos += 64) { @@ -1648,10 +1649,10 @@ void Decimators::decimate32_cen(SampleVector::iterator* i } } -template -void Decimators::decimate32_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate32_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - qint32 intbuf[32]; + AccuType intbuf[32]; for (int pos = 0; pos < len - 31; pos += 32) { @@ -1854,10 +1855,10 @@ void Decimators::decimate32_cen(SampleVector::iterator* i } } -template -void Decimators::decimate64_cen(SampleVector::iterator* it, const T* buf, qint32 len) +template +void Decimators::decimate64_cen(SampleVector::iterator* it, const T* buf, qint32 len) { - qint32 intbuf[64]; + AccuType intbuf[64]; for (int pos = 0; pos < len - 127; pos += 128) { @@ -2254,10 +2255,10 @@ void Decimators::decimate64_cen(SampleVector::iterator* i } } -template -void Decimators::decimate64_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) +template +void Decimators::decimate64_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len) { - qint32 intbuf[64]; + AccuType intbuf[64]; for (int pos = 0; pos < len - 63; pos += 64) { @@ -2654,218 +2655,4 @@ void Decimators::decimate64_cen(SampleVector::iterator* i } } -/* -template -void Decimators::decimate2_cen(SampleVector::iterator* it, const T* buf, qint32 len) -{ - int pos = 0; - - while (pos < len - 1) - { - qint32 x0 = buf[pos+0] << decimation_shifts::pre2; - qint32 y0 = buf[pos+1] << decimation_shifts::pre2; - pos += 2; - - if (m_decimator2.workDecimateCenter(&x0, &y0)) - { - (**it).setReal(x0 >> decimation_shifts::post2); - (**it).setImag(y0 >> decimation_shifts::post2); - ++(*it); - } - } -} - -template -void Decimators::decimate4_cen(SampleVector::iterator* it, const T* buf, qint32 len) -{ - int pos = 0; - - while (pos < len - 1) - { - qint32 x0 = buf[pos+0] << decimation_shifts::pre4; - qint32 y0 = buf[pos+1] << decimation_shifts::pre4; - pos += 2; - - if (m_decimator2.workDecimateCenter(&x0, &y0)) - { - qint32 x1 = x0; - qint32 y1 = y0; - - if (m_decimator4.workDecimateCenter(&x1, &y1)) - { - (**it).setReal(x0 >> decimation_shifts::post4); - (**it).setImag(y0 >> decimation_shifts::post4); - ++(*it); - } - } - } -} - -template -void Decimators::decimate8_cen(SampleVector::iterator* it, const T* buf, qint32 len) -{ - int pos = 0; - - while (pos < len - 1) - { - qint32 x0 = buf[pos+0] << decimation_shifts::pre8; - qint32 y0 = buf[pos+1] << decimation_shifts::pre8; - pos += 2; - - if (m_decimator2.workDecimateCenter(&x0, &y0)) - { - qint32 x1 = x0; - qint32 y1 = y0; - - if (m_decimator4.workDecimateCenter(&x1, &y1)) - { - qint32 x2 = x1; - qint32 y2 = y1; - - if (m_decimator8.workDecimateCenter(&x2, &y2)) - { - (**it).setReal(x2 >> decimation_shifts::post8); - (**it).setImag(y2 >> decimation_shifts::post8); - ++(*it); - } - } - } - } -} - -template -void Decimators::decimate16_cen(SampleVector::iterator* it, const T* buf, qint32 len) -{ - int pos = 0; - - while (pos < len - 1) - { - qint32 x0 = buf[pos+0] << decimation_shifts::pre16; - qint32 y0 = buf[pos+1] << decimation_shifts::pre16; - pos += 2; - - if (m_decimator2.workDecimateCenter(&x0, &y0)) - { - qint32 x1 = x0; - qint32 y1 = y0; - - if (m_decimator4.workDecimateCenter(&x1, &y1)) - { - qint32 x2 = x1; - qint32 y2 = y1; - - if (m_decimator8.workDecimateCenter(&x2, &y2)) - { - qint32 x3 = x2; - qint32 y3 = y2; - - if (m_decimator16.workDecimateCenter(&x3, &y3)) - { - (**it).setReal(x3 >> decimation_shifts::post16); - (**it).setImag(y3 >> decimation_shifts::post16); - ++(*it); - } - } - } - } - } -} - -template -void Decimators::decimate32_cen(SampleVector::iterator* it, const T* buf, qint32 len) -{ - int pos = 0; - - while (pos < len - 1) - { - qint32 x0 = buf[pos+0] << decimation_shifts::pre32; - qint32 y0 = buf[pos+1] << decimation_shifts::pre32; - pos += 2; - - if (m_decimator2.workDecimateCenter(&x0, &y0)) - { - qint32 x1 = x0; - qint32 y1 = y0; - - if (m_decimator4.workDecimateCenter(&x1, &y1)) - { - qint32 x2 = x1; - qint32 y2 = y1; - - if (m_decimator8.workDecimateCenter(&x2, &y2)) - { - qint32 x3 = x2; - qint32 y3 = y2; - - if (m_decimator16.workDecimateCenter(&x3, &y3)) - { - qint32 x4 = x3; - qint32 y4 = y3; - - if (m_decimator32.workDecimateCenter(&x4, &y4)) - { - (**it).setReal(x4 >> decimation_shifts::post32); - (**it).setImag(y4 >> decimation_shifts::post32); - ++(*it); - } - } - } - } - } - } -} - - -template -void Decimators::decimate64_cen(SampleVector::iterator* it, const T* buf, qint32 len) -{ - int pos = 0; - - while (pos < len - 1) - { - qint32 x0 = buf[pos+0] << decimation_shifts::pre64; - qint32 y0 = buf[pos+1] << decimation_shifts::pre64; - pos += 2; - - if (m_decimator2.workDecimateCenter(&x0, &y0)) - { - qint32 x1 = x0; - qint32 y1 = y0; - - if (m_decimator4.workDecimateCenter(&x1, &y1)) - { - qint32 x2 = x1; - qint32 y2 = y1; - - if (m_decimator8.workDecimateCenter(&x2, &y2)) - { - qint32 x3 = x2; - qint32 y3 = y2; - - if (m_decimator16.workDecimateCenter(&x3, &y3)) - { - qint32 x4 = x3; - qint32 y4 = y3; - - if (m_decimator32.workDecimateCenter(&x4, &y4)) - { - qint32 x5 = x4; - qint32 y5 = y4; - - if (m_decimator64.workDecimateCenter(&x5, &y5)) - { - (**it).setReal(x5 >> decimation_shifts::post64); - (**it).setImag(y5 >> decimation_shifts::post64); - ++(*it); - } - } - } - } - } - } - } -} - - */ - #endif /* INCLUDE_GPL_DSP_DECIMATORS_H_ */ diff --git a/sdrbase/dsp/decimatorsu.h b/sdrbase/dsp/decimatorsu.h index fe2e0aa55..2f028b2f5 100644 --- a/sdrbase/dsp/decimatorsu.h +++ b/sdrbase/dsp/decimatorsu.h @@ -24,7 +24,7 @@ #define INCLUDE_GPL_DSP_DECIMATORSU_H_ #include "dsp/dsptypes.h" -#ifdef SAMPLE_24BIT +#ifdef SDR_SAMPLE_24BIT #include "dsp/inthalfbandfilterdb.h" #else #ifdef USE_SSE4_1 @@ -180,7 +180,7 @@ struct decimation_shifts<24, 8> static const uint post64 = 0; }; -template +template class DecimatorsU { public: @@ -206,7 +206,7 @@ public: void decimate64_cen(SampleVector::iterator* it, const T* buf, qint32 len); private: -#ifdef SAMPLE_24BIT +#ifdef SDR_SAMPLE_24BIT IntHalfbandFilterDB m_decimator2; // 1st stages IntHalfbandFilterDB m_decimator4; // 2nd stages IntHalfbandFilterDB m_decimator8; // 3rd stages @@ -232,8 +232,8 @@ private: #endif }; -template -void DecimatorsU::decimate1(SampleVector::iterator* it, const T* buf, qint32 len) +template +void DecimatorsU::decimate1(SampleVector::iterator* it, const T* buf, qint32 len) { qint32 xreal, yimag; @@ -247,8 +247,8 @@ void DecimatorsU::decimate1(SampleVector::iterator } } -template -void DecimatorsU::decimate2_inf(SampleVector::iterator* it, const T* buf, qint32 len) +template +void DecimatorsU::decimate2_inf(SampleVector::iterator* it, const T* buf, qint32 len) { qint32 xreal, yimag; @@ -268,10 +268,10 @@ void DecimatorsU::decimate2_inf(SampleVector::iter } } -template -void DecimatorsU::decimate2_sup(SampleVector::iterator* it, const T* buf, qint32 len) +template +void DecimatorsU::decimate2_sup(SampleVector::iterator* it, const T* buf, qint32 len) { - qint32 xreal, yimag; + AccuType xreal, yimag; for (int pos = 0; pos < len - 7; pos += 8) { @@ -289,10 +289,10 @@ void DecimatorsU::decimate2_sup(SampleVector::iter } } -template -void DecimatorsU::decimate4_inf(SampleVector::iterator* it, const T* buf, qint32 len) +template +void DecimatorsU::decimate4_inf(SampleVector::iterator* it, const T* buf, qint32 len) { - qint32 xreal, yimag; + AccuType xreal, yimag; for (int pos = 0; pos < len - 7; pos += 8) { @@ -306,8 +306,8 @@ void DecimatorsU::decimate4_inf(SampleVector::iter } } -template -void DecimatorsU::decimate4_sup(SampleVector::iterator* it, const T* buf, qint32 len) +template +void DecimatorsU::decimate4_sup(SampleVector::iterator* it, const T* buf, qint32 len) { // Sup (USB): // x y x y x y x y / x -> 1,-2,-5,6 / y -> -0,-3,4,7 @@ -315,7 +315,7 @@ void DecimatorsU::decimate4_sup(SampleVector::iter // Inf (LSB): // x y x y x y x y / x -> 0,-3,-4,7 / y -> 1,2,-5,-6 // [ rotate: 0, 1, -3, 2, -4, -5, 7, -6] - qint32 xreal, yimag; + AccuType xreal, yimag; for (int pos = 0; pos < len - 7; pos += 8) { @@ -329,10 +329,10 @@ void DecimatorsU::decimate4_sup(SampleVector::iter } } -template -void DecimatorsU::decimate8_inf(SampleVector::iterator* it, const T* buf, qint32 len) +template +void DecimatorsU::decimate8_inf(SampleVector::iterator* it, const T* buf, qint32 len) { - qint32 xreal[2], yimag[2]; + AccuType xreal[2], yimag[2]; for (int pos = 0; pos < len - 15; pos += 8) { @@ -352,10 +352,10 @@ void DecimatorsU::decimate8_inf(SampleVector::iter } } -template -void DecimatorsU::decimate8_sup(SampleVector::iterator* it, const T* buf, qint32 len) +template +void DecimatorsU::decimate8_sup(SampleVector::iterator* it, const T* buf, qint32 len) { - qint32 xreal[2], yimag[2]; + AccuType xreal[2], yimag[2]; for (int pos = 0; pos < len - 15; pos += 8) { @@ -375,12 +375,12 @@ void DecimatorsU::decimate8_sup(SampleVector::iter } } -template -void DecimatorsU::decimate16_inf(SampleVector::iterator* it, const T* buf, qint32 len) +template +void DecimatorsU::decimate16_inf(SampleVector::iterator* it, const T* buf, qint32 len) { // Offset tuning: 4x downsample and rotate, then // downsample 4x more. [ rotate: 0, 1, -3, 2, -4, -5, 7, -6] - qint32 xreal[4], yimag[4]; + AccuType xreal[4], yimag[4]; for (int pos = 0; pos < len - 31; ) { @@ -403,12 +403,12 @@ void DecimatorsU::decimate16_inf(SampleVector::ite } } -template -void DecimatorsU::decimate16_sup(SampleVector::iterator* it, const T* buf, qint32 len) +template +void DecimatorsU::decimate16_sup(SampleVector::iterator* it, const T* buf, qint32 len) { // Offset tuning: 4x downsample and rotate, then // downsample 4x more. [ rotate: 1, 0, -2, 3, -5, -4, 6, -7] - qint32 xreal[4], yimag[4]; + AccuType xreal[4], yimag[4]; for (int pos = 0; pos < len - 31; ) { @@ -431,10 +431,10 @@ void DecimatorsU::decimate16_sup(SampleVector::ite } } -template -void DecimatorsU::decimate32_inf(SampleVector::iterator* it, const T* buf, qint32 len) +template +void DecimatorsU::decimate32_inf(SampleVector::iterator* it, const T* buf, qint32 len) { - qint32 xreal[8], yimag[8]; + AccuType xreal[8], yimag[8]; for (int pos = 0; pos < len - 63; ) { @@ -462,10 +462,10 @@ void DecimatorsU::decimate32_inf(SampleVector::ite } } -template -void DecimatorsU::decimate32_sup(SampleVector::iterator* it, const T* buf, qint32 len) +template +void DecimatorsU::decimate32_sup(SampleVector::iterator* it, const T* buf, qint32 len) { - qint32 xreal[8], yimag[8]; + AccuType xreal[8], yimag[8]; for (int pos = 0; pos < len - 63; ) { @@ -493,10 +493,10 @@ void DecimatorsU::decimate32_sup(SampleVector::ite } } -template -void DecimatorsU::decimate64_inf(SampleVector::iterator* it, const T* buf, qint32 len) +template +void DecimatorsU::decimate64_inf(SampleVector::iterator* it, const T* buf, qint32 len) { - qint32 xreal[16], yimag[16]; + AccuType xreal[16], yimag[16]; for (int pos = 0; pos < len - 127; ) { @@ -533,10 +533,10 @@ void DecimatorsU::decimate64_inf(SampleVector::ite } } -template -void DecimatorsU::decimate64_sup(SampleVector::iterator* it, const T* buf, qint32 len) +template +void DecimatorsU::decimate64_sup(SampleVector::iterator* it, const T* buf, qint32 len) { - qint32 xreal[16], yimag[16]; + AccuType xreal[16], yimag[16]; for (int pos = 0; pos < len - 127; ) { @@ -573,10 +573,10 @@ void DecimatorsU::decimate64_sup(SampleVector::ite } } -template -void DecimatorsU::decimate2_cen(SampleVector::iterator* it, const T* buf, qint32 len) +template +void DecimatorsU::decimate2_cen(SampleVector::iterator* it, const T* buf, qint32 len) { - qint32 intbuf[2]; + AccuType intbuf[2]; for (int pos = 0; pos < len - 3; pos += 4) { @@ -595,10 +595,10 @@ void DecimatorsU::decimate2_cen(SampleVector::iter } } -template -void DecimatorsU::decimate4_cen(SampleVector::iterator* it, const T* buf, qint32 len) +template +void DecimatorsU::decimate4_cen(SampleVector::iterator* it, const T* buf, qint32 len) { - qint32 intbuf[4]; + AccuType intbuf[4]; for (int pos = 0; pos < len - 7; pos += 8) { @@ -630,10 +630,10 @@ void DecimatorsU::decimate4_cen(SampleVector::iter } } -template -void DecimatorsU::decimate8_cen(SampleVector::iterator* it, const T* buf, qint32 len) +template +void DecimatorsU::decimate8_cen(SampleVector::iterator* it, const T* buf, qint32 len) { - qint32 intbuf[8]; + AccuType intbuf[8]; for (int pos = 0; pos < len - 15; pos += 16) { @@ -690,10 +690,10 @@ void DecimatorsU::decimate8_cen(SampleVector::iter } } -template -void DecimatorsU::decimate16_cen(SampleVector::iterator* it, const T* buf, qint32 len) +template +void DecimatorsU::decimate16_cen(SampleVector::iterator* it, const T* buf, qint32 len) { - qint32 intbuf[16]; + AccuType intbuf[16]; for (int pos = 0; pos < len - 31; pos += 32) { @@ -799,10 +799,10 @@ void DecimatorsU::decimate16_cen(SampleVector::ite } } -template -void DecimatorsU::decimate32_cen(SampleVector::iterator* it, const T* buf, qint32 len) +template +void DecimatorsU::decimate32_cen(SampleVector::iterator* it, const T* buf, qint32 len) { - qint32 intbuf[32]; + AccuType intbuf[32]; for (int pos = 0; pos < len - 63; pos += 64) { @@ -1005,10 +1005,10 @@ void DecimatorsU::decimate32_cen(SampleVector::ite } } -template -void DecimatorsU::decimate64_cen(SampleVector::iterator* it, const T* buf, qint32 len) +template +void DecimatorsU::decimate64_cen(SampleVector::iterator* it, const T* buf, qint32 len) { - qint32 intbuf[64]; + AccuType intbuf[64]; for (int pos = 0; pos < len - 127; pos += 128) { diff --git a/sdrbase/dsp/downchannelizer.cpp b/sdrbase/dsp/downchannelizer.cpp index 59d27e41f..8b73f34de 100644 --- a/sdrbase/dsp/downchannelizer.cpp +++ b/sdrbase/dsp/downchannelizer.cpp @@ -192,7 +192,7 @@ void DownChannelizer::applyConfiguration() } } -#ifdef SAMPLE_24BIT +#ifdef SDR_SAMPLE_24BIT DownChannelizer::FilterStage::FilterStage(Mode mode) : m_filter(new IntHalfbandFilterDB), m_workFunction(0), diff --git a/sdrbase/dsp/downchannelizer.h b/sdrbase/dsp/downchannelizer.h index c770f2948..da9ce6d80 100644 --- a/sdrbase/dsp/downchannelizer.h +++ b/sdrbase/dsp/downchannelizer.h @@ -23,7 +23,7 @@ #include #include "util/export.h" #include "util/message.h" -#ifdef SAMPLE_24BIT +#ifdef SDR_SAMPLE_24BIT #include "dsp/inthalfbandfilterdb.h" #else #ifdef USE_SSE4_1 @@ -82,7 +82,7 @@ protected: ModeUpperHalf }; -#ifdef SAMPLE_24BIT +#ifdef SDR_SAMPLE_24BIT typedef bool (IntHalfbandFilterDB::*WorkFunction)(Sample* s); IntHalfbandFilterDB* m_filter; #else diff --git a/sdrbase/dsp/dsptypes.h b/sdrbase/dsp/dsptypes.h index b6462e48d..7300c9dae 100644 --- a/sdrbase/dsp/dsptypes.h +++ b/sdrbase/dsp/dsptypes.h @@ -22,7 +22,7 @@ #include #include -#ifdef SAMPLE_24BIT +#ifdef SDR_SAMPLE_24BIT #define SDR_SAMP_SZ 24 // internal fixed arithmetic sample size #define SDR_SCALEF 8388608.0f #define SDR_SCALED 8388608.0 diff --git a/sdrbase/dsp/interpolators.h b/sdrbase/dsp/interpolators.h index f565e26a2..0188cfb30 100644 --- a/sdrbase/dsp/interpolators.h +++ b/sdrbase/dsp/interpolators.h @@ -18,7 +18,7 @@ #define INCLUDE_GPL_DSP_INTERPOLATORS_H_ #include "dsp/dsptypes.h" -#ifdef SAMPLE_24BIT +#ifdef SDR_SAMPLE_24BIT #include "dsp/inthalfbandfilterdb.h" #else #ifdef USE_SSE4_1 @@ -118,7 +118,7 @@ public: void interpolate64_cen(SampleVector::iterator* it, T* buf, qint32 len); private: -#ifdef SAMPLE_24BIT +#ifdef SDR_SAMPLE_24BIT IntHalfbandFilterDB m_interpolator2; // 1st stages IntHalfbandFilterDB m_interpolator4; // 2nd stages IntHalfbandFilterDB m_interpolator8; // 3rd stages diff --git a/sdrbase/dsp/inthalfbandfilter.h b/sdrbase/dsp/inthalfbandfilter.h index f21f12d87..2a0eec627 100644 --- a/sdrbase/dsp/inthalfbandfilter.h +++ b/sdrbase/dsp/inthalfbandfilter.h @@ -146,38 +146,38 @@ public: } } - bool workDecimateCenter(qint32 *x, qint32 *y) - { - // insert sample into ring-buffer - m_samples[m_ptr][0] = *x; - m_samples[m_ptr][1] = *y; - - switch(m_state) - { - case 0: - // advance write-pointer - m_ptr = (m_ptr + HBFIRFilterTraits::hbOrder) % (HBFIRFilterTraits::hbOrder + 1); - - // next state - m_state = 1; - - // tell caller we don't have a new sample - return false; - - default: - // save result - doFIR(x, y); - - // advance write-pointer - m_ptr = (m_ptr + HBFIRFilterTraits::hbOrder) % (HBFIRFilterTraits::hbOrder + 1); - - // next state - m_state = 0; - - // tell caller we have a new sample - return true; - } - } +// bool workDecimateCenter(qint32 *x, qint32 *y) +// { +// // insert sample into ring-buffer +// m_samples[m_ptr][0] = *x; +// m_samples[m_ptr][1] = *y; +// +// switch(m_state) +// { +// case 0: +// // advance write-pointer +// m_ptr = (m_ptr + HBFIRFilterTraits::hbOrder) % (HBFIRFilterTraits::hbOrder + 1); +// +// // next state +// m_state = 1; +// +// // tell caller we don't have a new sample +// return false; +// +// default: +// // save result +// doFIR(x, y); +// +// // advance write-pointer +// m_ptr = (m_ptr + HBFIRFilterTraits::hbOrder) % (HBFIRFilterTraits::hbOrder + 1); +// +// // next state +// m_state = 0; +// +// // tell caller we have a new sample +// return true; +// } +// } // downsample by 2, return edges of spectrum rotated into center - unused // bool workDecimateFullRotate(Sample* sample) diff --git a/sdrbase/dsp/inthalfbandfilterdb.h b/sdrbase/dsp/inthalfbandfilterdb.h index 4a153edc8..e65dfa59c 100644 --- a/sdrbase/dsp/inthalfbandfilterdb.h +++ b/sdrbase/dsp/inthalfbandfilterdb.h @@ -35,7 +35,7 @@ public: bool workDecimateCenter(Sample* sample) { // insert sample into ring-buffer - storeSample((FixReal) sample->real(), (FixReal) sample->imag()); + storeSampleFixReal((FixReal) sample->real(), (FixReal) sample->imag()); switch(m_state) { @@ -67,7 +67,7 @@ public: { case 0: // insert sample into ring-buffer - storeSample((FixReal) 0, (FixReal) 0); + storeSampleFixReal((FixReal) 0, (FixReal) 0); // save result doFIR(SampleOut); // advance write-pointer @@ -79,7 +79,7 @@ public: default: // insert sample into ring-buffer - storeSample((FixReal) sampleIn->real(), (FixReal) sampleIn->imag()); + storeSampleFixReal((FixReal) sampleIn->real(), (FixReal) sampleIn->imag()); // save result doFIR(SampleOut); // advance write-pointer @@ -125,32 +125,32 @@ public: } } - bool workDecimateCenter(qint32 *x, qint32 *y) - { - // insert sample into ring-buffer - storeSample32(*x, *y); - - switch(m_state) - { - case 0: - // advance write-pointer - advancePointer(); - // next state - m_state = 1; - // tell caller we don't have a new sample - return false; - - default: - // save result - doFIR(x, y); - // advance write-pointer - advancePointer(); - // next state - m_state = 0; - // tell caller we have a new sample - return true; - } - } +// bool workDecimateCenter(qint32 *x, qint32 *y) +// { +// // insert sample into ring-buffer +// storeSample32(*x, *y); +// +// switch (m_state) +// { +// case 0: +// // advance write-pointer +// advancePointer(); +// // next state +// m_state = 1; +// // tell caller we don't have a new sample +// return false; +// +// default: +// // save result +// doFIR(x, y); +// // advance write-pointer +// advancePointer(); +// // next state +// m_state = 0; +// // tell caller we have a new sample +// return true; +// } +// } // downsample by 2, return lower half of original spectrum bool workDecimateLowerHalf(Sample* sample) @@ -159,7 +159,7 @@ public: { case 0: // insert sample into ring-buffer - storeSample((FixReal) -sample->imag(), (FixReal) sample->real()); + storeSampleFixReal((FixReal) -sample->imag(), (FixReal) sample->real()); // advance write-pointer advancePointer(); // next state @@ -169,7 +169,7 @@ public: case 1: // insert sample into ring-buffer - storeSample((FixReal) -sample->real(), (FixReal) -sample->imag()); + storeSampleFixReal((FixReal) -sample->real(), (FixReal) -sample->imag()); // save result doFIR(sample); // advance write-pointer @@ -181,7 +181,7 @@ public: case 2: // insert sample into ring-buffer - storeSample((FixReal) sample->imag(), (FixReal) -sample->real()); + storeSampleFixReal((FixReal) sample->imag(), (FixReal) -sample->real()); // advance write-pointer advancePointer(); // next state @@ -191,7 +191,7 @@ public: default: // insert sample into ring-buffer - storeSample((FixReal) sample->real(), (FixReal) sample->imag()); + storeSampleFixReal((FixReal) sample->real(), (FixReal) sample->imag()); // save result doFIR(sample); // advance write-pointer @@ -279,7 +279,7 @@ public: { case 0: // insert sample into ring-buffer - storeSample((FixReal) 0, (FixReal) 0); + storeSampleFixReal((FixReal) 0, (FixReal) 0); // save result doFIR(&s); @@ -297,7 +297,7 @@ public: case 1: // insert sample into ring-buffer - storeSample((FixReal) sampleIn->real(), (FixReal) sampleIn->imag()); + storeSampleFixReal((FixReal) sampleIn->real(), (FixReal) sampleIn->imag()); // save result doFIR(&s); @@ -315,7 +315,7 @@ public: case 2: // insert sample into ring-buffer - storeSample((FixReal) 0, (FixReal) 0); + storeSampleFixReal((FixReal) 0, (FixReal) 0); // save result doFIR(&s); @@ -333,7 +333,7 @@ public: default: // insert sample into ring-buffer - storeSample((FixReal) sampleIn->real(), (FixReal) sampleIn->imag()); + storeSampleFixReal((FixReal) sampleIn->real(), (FixReal) sampleIn->imag()); // save result doFIR(&s); @@ -358,7 +358,7 @@ public: { case 0: // insert sample into ring-buffer - storeSample((FixReal) sample->imag(), (FixReal) -sample->real()); + storeSampleFixReal((FixReal) sample->imag(), (FixReal) -sample->real()); // advance write-pointer advancePointer(); // next state @@ -368,7 +368,7 @@ public: case 1: // insert sample into ring-buffer - storeSample((FixReal) -sample->real(), (FixReal) -sample->imag()); + storeSampleFixReal((FixReal) -sample->real(), (FixReal) -sample->imag()); // save result doFIR(sample); // advance write-pointer @@ -380,7 +380,7 @@ public: case 2: // insert sample into ring-buffer - storeSample((FixReal) -sample->imag(), (FixReal) sample->real()); + storeSampleFixReal((FixReal) -sample->imag(), (FixReal) sample->real()); // advance write-pointer advancePointer(); // next state @@ -390,7 +390,7 @@ public: default: // insert sample into ring-buffer - storeSample((FixReal) sample->real(), (FixReal) sample->imag()); + storeSampleFixReal((FixReal) sample->real(), (FixReal) sample->imag()); // save result doFIR(sample); // advance write-pointer @@ -478,7 +478,7 @@ public: { case 0: // insert sample into ring-buffer - storeSample((FixReal) 0, (FixReal) 0); + storeSampleFixReal((FixReal) 0, (FixReal) 0); // save result doFIR(&s); @@ -496,7 +496,7 @@ public: case 1: // insert sample into ring-buffer - storeSample((FixReal) sampleIn->real(), (FixReal) sampleIn->imag()); + storeSampleFixReal((FixReal) sampleIn->real(), (FixReal) sampleIn->imag()); // save result doFIR(&s); @@ -514,7 +514,7 @@ public: case 2: // insert sample into ring-buffer - storeSample((FixReal) 0, (FixReal) 0); + storeSampleFixReal((FixReal) 0, (FixReal) 0); // save result doFIR(&s); @@ -532,7 +532,7 @@ public: default: // insert sample into ring-buffer - storeSample((FixReal) sampleIn->real(), (FixReal) sampleIn->imag()); + storeSampleFixReal((FixReal) sampleIn->real(), (FixReal) sampleIn->imag()); // save result doFIR(&s); @@ -552,47 +552,47 @@ public: void myDecimate(const Sample* sample1, Sample* sample2) { - storeSample((FixReal) sample1->real(), (FixReal) sample1->imag()); + storeSampleFixReal((FixReal) sample1->real(), (FixReal) sample1->imag()); advancePointer(); - storeSample((FixReal) sample2->real(), (FixReal) sample2->imag()); + storeSampleFixReal((FixReal) sample2->real(), (FixReal) sample2->imag()); doFIR(sample2); advancePointer(); } - void myDecimate(qint32 x1, qint32 y1, qint32 *x2, qint32 *y2) + void myDecimate(AccuType x1, AccuType y1, AccuType *x2, AccuType *y2) { - storeSample32(x1, y1); + storeSampleAccu(x1, y1); advancePointer(); - storeSample32(*x2, *y2); - doFIR(x2, y2); + storeSampleAccu(*x2, *y2); + doFIRAccu(x2, y2); advancePointer(); } /** Simple zero stuffing and filter */ void myInterpolateZeroStuffing(Sample* sample1, Sample* sample2) { - storeSample((FixReal) sample1->real(), (FixReal) sample1->imag()); + storeSampleFixReal((FixReal) sample1->real(), (FixReal) sample1->imag()); doFIR(sample1); advancePointer(); - storeSample((FixReal) 0, (FixReal) 0); + storeSampleFixReal((FixReal) 0, (FixReal) 0); doFIR(sample2); advancePointer(); } /** Simple zero stuffing and filter */ - void myInterpolateZeroStuffing(qint32 *x1, qint32 *y1, qint32 *x2, qint32 *y2) - { - storeSample32(*x1, *y1); - doFIR(x1, y1); - advancePointer(); - - storeSample32(0, 0); - doFIR(x2, y2); - advancePointer(); - } +// void myInterpolateZeroStuffing(qint32 *x1, qint32 *y1, qint32 *x2, qint32 *y2) +// { +// storeSampleAccu(*x1, *y1); +// doFIR(x1, y1); +// advancePointer(); +// +// storeSampleAccu(0, 0); +// doFIR(x2, y2); +// advancePointer(); +// } /** Optimized upsampler by 2 not calculating FIR with inserted null samples */ void myInterpolate(qint32 *x1, qint32 *y1, qint32 *x2, qint32 *y2) @@ -624,7 +624,7 @@ protected: int m_size; int m_state; - void storeSample(const FixReal& sampleI, const FixReal& sampleQ) + void storeSampleFixReal(const FixReal& sampleI, const FixReal& sampleQ) { m_samplesDB[m_ptr][0] = sampleI; m_samplesDB[m_ptr][1] = sampleQ; @@ -632,7 +632,7 @@ protected: m_samplesDB[m_ptr + m_size][1] = sampleQ; } - void storeSample32(qint32 x, qint32 y) + void storeSampleAccu(AccuType x, AccuType y) { m_samplesDB[m_ptr][0] = x; m_samplesDB[m_ptr][1] = y; @@ -660,8 +660,8 @@ protected: b += 2; } - iAcc += ((qint32)m_samplesDB[b-1][0]) << (HBFIRFilterTraits::hbShift - 1); - qAcc += ((qint32)m_samplesDB[b-1][1]) << (HBFIRFilterTraits::hbShift - 1); + iAcc += m_samplesDB[b-1][0] << (HBFIRFilterTraits::hbShift - 1); + qAcc += m_samplesDB[b-1][1] << (HBFIRFilterTraits::hbShift - 1); sample->setReal(iAcc >> (HBFIRFilterTraits::hbShift -1)); sample->setImag(qAcc >> (HBFIRFilterTraits::hbShift -1)); @@ -682,8 +682,30 @@ protected: b += 2; } - iAcc += ((qint32)m_samplesDB[b-1][0]) << (HBFIRFilterTraits::hbShift - 1); - qAcc += ((qint32)m_samplesDB[b-1][1]) << (HBFIRFilterTraits::hbShift - 1); + iAcc += m_samplesDB[b-1][0] << (HBFIRFilterTraits::hbShift - 1); + qAcc += m_samplesDB[b-1][1] << (HBFIRFilterTraits::hbShift - 1); + + *x = iAcc >> (HBFIRFilterTraits::hbShift -1); // HB_SHIFT incorrect do not loose the gained bit + *y = qAcc >> (HBFIRFilterTraits::hbShift -1); + } + + void doFIRAccu(AccuType *x, AccuType *y) + { + int a = m_ptr + m_size; // tip pointer + int b = m_ptr + 1; // tail pointer + AccuType iAcc = 0; + AccuType qAcc = 0; + + for (int i = 0; i < HBFIRFilterTraits::hbOrder / 4; i++) + { + iAcc += (m_samplesDB[a][0] + m_samplesDB[b][0]) * HBFIRFilterTraits::hbCoeffs[i]; + qAcc += (m_samplesDB[a][1] + m_samplesDB[b][1]) * HBFIRFilterTraits::hbCoeffs[i]; + a -= 2; + b += 2; + } + + iAcc += m_samplesDB[b-1][0] << (HBFIRFilterTraits::hbShift - 1); + qAcc += m_samplesDB[b-1][1] << (HBFIRFilterTraits::hbShift - 1); *x = iAcc >> (HBFIRFilterTraits::hbShift -1); // HB_SHIFT incorrect do not loose the gained bit *y = qAcc >> (HBFIRFilterTraits::hbShift -1); diff --git a/sdrbase/dsp/upchannelizer.cpp b/sdrbase/dsp/upchannelizer.cpp index 6ae1f045c..c2415a186 100644 --- a/sdrbase/dsp/upchannelizer.cpp +++ b/sdrbase/dsp/upchannelizer.cpp @@ -207,7 +207,7 @@ void UpChannelizer::applyConfiguration() } } -#ifdef SAMPLE_24BIT +#ifdef SDR_SAMPLE_24BIT UpChannelizer::FilterStage::FilterStage(Mode mode) : m_filter(new IntHalfbandFilterDB), m_workFunction(0) diff --git a/sdrbase/dsp/upchannelizer.h b/sdrbase/dsp/upchannelizer.h index fbc0b63da..ee6f5fa35 100644 --- a/sdrbase/dsp/upchannelizer.h +++ b/sdrbase/dsp/upchannelizer.h @@ -23,7 +23,7 @@ #include #include "util/export.h" #include "util/message.h" -#ifdef SAMPLE_24BIT +#ifdef SDR_SAMPLE_24BIT #include "dsp/inthalfbandfilterdb.h" #else #ifdef USE_SSE4_1 @@ -87,7 +87,7 @@ protected: ModeUpperHalf }; -#ifdef SAMPLE_24BIT +#ifdef SDR_SAMPLE_24BIT typedef bool (IntHalfbandFilterDB::*WorkFunction)(Sample* sIn, Sample *sOut); IntHalfbandFilterDB* m_filter; #else From bacc6659b0f7e5c9ba25109f68af052642fbd113 Mon Sep 17 00:00:00 2001 From: f4exb Date: Mon, 22 Jan 2018 03:00:08 +0100 Subject: [PATCH 09/27] 24 bit DSP: use a different define for Tx chain so that it can stay on 16 bit DSP --- sdrbase/dsp/interpolators.h | 4 ++-- sdrbase/dsp/upchannelizer.cpp | 2 +- sdrbase/dsp/upchannelizer.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sdrbase/dsp/interpolators.h b/sdrbase/dsp/interpolators.h index 0188cfb30..42e7640f3 100644 --- a/sdrbase/dsp/interpolators.h +++ b/sdrbase/dsp/interpolators.h @@ -18,7 +18,7 @@ #define INCLUDE_GPL_DSP_INTERPOLATORS_H_ #include "dsp/dsptypes.h" -#ifdef SDR_SAMPLE_24BIT +#ifdef SDR_TX_SAMPLE_24BIT #include "dsp/inthalfbandfilterdb.h" #else #ifdef USE_SSE4_1 @@ -118,7 +118,7 @@ public: void interpolate64_cen(SampleVector::iterator* it, T* buf, qint32 len); private: -#ifdef SDR_SAMPLE_24BIT +#ifdef SDR_TX_SAMPLE_24BIT IntHalfbandFilterDB m_interpolator2; // 1st stages IntHalfbandFilterDB m_interpolator4; // 2nd stages IntHalfbandFilterDB m_interpolator8; // 3rd stages diff --git a/sdrbase/dsp/upchannelizer.cpp b/sdrbase/dsp/upchannelizer.cpp index c2415a186..fa1e26b52 100644 --- a/sdrbase/dsp/upchannelizer.cpp +++ b/sdrbase/dsp/upchannelizer.cpp @@ -207,7 +207,7 @@ void UpChannelizer::applyConfiguration() } } -#ifdef SDR_SAMPLE_24BIT +#ifdef SDR_TX_SAMPLE_24BIT UpChannelizer::FilterStage::FilterStage(Mode mode) : m_filter(new IntHalfbandFilterDB), m_workFunction(0) diff --git a/sdrbase/dsp/upchannelizer.h b/sdrbase/dsp/upchannelizer.h index ee6f5fa35..dc6bb3015 100644 --- a/sdrbase/dsp/upchannelizer.h +++ b/sdrbase/dsp/upchannelizer.h @@ -23,7 +23,7 @@ #include #include "util/export.h" #include "util/message.h" -#ifdef SDR_SAMPLE_24BIT +#ifdef SDR_TX_SAMPLE_24BIT #include "dsp/inthalfbandfilterdb.h" #else #ifdef USE_SSE4_1 @@ -87,7 +87,7 @@ protected: ModeUpperHalf }; -#ifdef SDR_SAMPLE_24BIT +#ifdef SDR_TX_SAMPLE_24BIT typedef bool (IntHalfbandFilterDB::*WorkFunction)(Sample* sIn, Sample *sOut); IntHalfbandFilterDB* m_filter; #else From 2ddcb8c358be355a126671cba268fce3098f0ce9 Mon Sep 17 00:00:00 2001 From: f4exb Date: Mon, 22 Jan 2018 08:46:05 +0100 Subject: [PATCH 10/27] Differentiate Rx and Tx DSP sample sizes --- CMakeLists.txt | 6 ++-- devices/plutosdr/deviceplutosdrbox.cpp | 2 +- plugins/channelrx/chanalyzer/chanalyzer.cpp | 4 +-- plugins/channelrx/chanalyzerng/chanalyzerng.h | 4 +-- plugins/channelrx/demodam/amdemod.h | 6 ++-- plugins/channelrx/demodatv/atvdemod.cpp | 2 +- plugins/channelrx/demodatv/atvdemodgui.cpp | 2 +- plugins/channelrx/demodbfm/bfmdemod.cpp | 6 ++-- plugins/channelrx/demoddsd/dsddemod.cpp | 6 ++-- plugins/channelrx/demodlora/lorademod.cpp | 2 +- plugins/channelrx/demodnfm/nfmdemod.cpp | 2 +- plugins/channelrx/demodssb/ssbdemod.cpp | 6 ++-- plugins/channelrx/demodwfm/wfmdemod.cpp | 2 +- plugins/channelrx/tcpsrc/tcpsrc.cpp | 4 +-- plugins/channelrx/udpsrc/udpsrc.cpp | 28 +++++++++---------- plugins/channeltx/modam/ammod.cpp | 2 +- plugins/channeltx/modatv/atvmod.cpp | 2 +- plugins/channeltx/modatv/atvmodsettings.cpp | 2 +- plugins/channeltx/modnfm/nfmmod.cpp | 6 ++-- plugins/channeltx/modssb/ssbmod.cpp | 20 ++++++------- plugins/channeltx/modwfm/wfmmod.cpp | 6 ++-- plugins/channeltx/udpsink/udpsink.cpp | 26 ++++++++--------- .../bladerfoutput/bladerfoutputthread.h | 2 +- plugins/samplesink/filesink/filesinkthread.h | 2 +- .../hackrfoutput/hackrfoutputthread.h | 2 +- .../limesdroutput/limesdroutputthread.h | 2 +- .../plutosdroutput/plutosdroutputthread.h | 2 +- plugins/samplesource/airspy/airspythread.h | 6 ++-- .../samplesource/airspyhf/airspyhfthread.h | 6 ++-- .../bladerfinput/bladerfinputthread.h | 6 ++-- .../hackrfinput/hackrfinputthread.h | 6 ++-- .../limesdrinput/limesdrinputthread.h | 6 ++-- .../plutosdrinput/plutosdrinputthread.h | 6 ++-- plugins/samplesource/rtlsdr/rtlsdrthread.h | 6 ++-- plugins/samplesource/sdrplay/sdrplaythread.h | 6 ++-- .../testsource/testsourcethread.h | 14 +++++----- sdrbase/dsp/decimators.h | 4 +-- sdrbase/dsp/decimatorsu.h | 4 +-- sdrbase/dsp/downchannelizer.cpp | 2 +- sdrbase/dsp/downchannelizer.h | 4 +-- sdrbase/dsp/dsptypes.h | 18 +++++++----- sdrgui/dsp/scopevis.cpp | 6 ++-- sdrgui/dsp/scopevismulti.h | 4 +-- sdrgui/dsp/scopevisng.h | 4 +-- sdrgui/dsp/spectrumvis.cpp | 4 +-- 45 files changed, 136 insertions(+), 132 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e5b2f1b1..8e6359a87 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,7 @@ option(V4L-MSI "Use Linux Kernel MSI2500 Source." OFF) option(BUILD_TYPE "Build type (RELEASE, RELEASEWITHDBGINFO, DEBUG" RELEASE) option(DEBUG_OUTPUT "Print debug messages" OFF) option(HOST_RPI "Compiling on RPi" OFF) -option(SAMPLE_24BIT "Internal 24 bit DSP" OFF) +option(RX_SAMPLE_24BIT "Internal 24 bit Rx DSP" OFF) list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) @@ -187,8 +187,8 @@ elseif (${ARCHITECTURE} MATCHES "aarch64") endif() # Compiler flags. -if (SAMPLE_24BIT) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSDR_SAMPLE_24BIT") +if (RX_SAMPLE_24BIT) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSDR_RX_SAMPLE_24BIT") endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -fmax-errors=10 -ffast-math -ftree-vectorize ${EXTRA_FLAGS}") diff --git a/devices/plutosdr/deviceplutosdrbox.cpp b/devices/plutosdr/deviceplutosdrbox.cpp index 0ac0c7203..e5690c17e 100644 --- a/devices/plutosdr/deviceplutosdrbox.cpp +++ b/devices/plutosdr/deviceplutosdrbox.cpp @@ -639,7 +639,7 @@ void DevicePlutoSDRBox::formatFIRCoefficients(std::ostringstream& ostr, uint32_t WFIR::BasicFIR(fcoeffs, nbTaps, WFIR::LPF, normalizedBW, 0.0, normalizedBW < 0.2 ? WFIR::wtHAMMING : WFIR::wtBLACKMAN_HARRIS, 0.0); for (unsigned int i = 0; i < nbTaps; i++) { - ostr << (int16_t) (fcoeffs[i] * SDR_SCALEF) << ", " << (int16_t) (fcoeffs[i] * SDR_SCALEF) << std::endl; + ostr << (int16_t) (fcoeffs[i] * 32768.0f) << ", " << (int16_t) (fcoeffs[i] * 32768.0f) << std::endl; } delete[] fcoeffs; diff --git a/plugins/channelrx/chanalyzer/chanalyzer.cpp b/plugins/channelrx/chanalyzer/chanalyzer.cpp index cb4e627bd..c8f80498f 100644 --- a/plugins/channelrx/chanalyzer/chanalyzer.cpp +++ b/plugins/channelrx/chanalyzer/chanalyzer.cpp @@ -114,8 +114,8 @@ void ChannelAnalyzer::feed(const SampleVector::const_iterator& begin, const Samp if (!(m_undersampleCount++ & decim_mask)) { m_sum /= decim; - Real re = m_sum.real() / SDR_SCALED; - Real im = m_sum.imag() / SDR_SCALED; + Real re = m_sum.real() / SDR_RX_SCALED; + Real im = m_sum.imag() / SDR_RX_SCALED; m_magsq = re*re + im*im; if (m_ssb & !m_usb) diff --git a/plugins/channelrx/chanalyzerng/chanalyzerng.h b/plugins/channelrx/chanalyzerng/chanalyzerng.h index 5734ee235..aea652558 100644 --- a/plugins/channelrx/chanalyzerng/chanalyzerng.h +++ b/plugins/channelrx/chanalyzerng/chanalyzerng.h @@ -229,8 +229,8 @@ private: if (!(m_undersampleCount++ & (decim - 1))) // counter LSB bit mask for decimation by 2^(m_scaleLog2 - 1) { m_sum /= decim; - Real re = m_sum.real() / SDR_SCALED; - Real im = m_sum.imag() / SDR_SCALED; + Real re = m_sum.real() / SDR_RX_SCALED; + Real im = m_sum.imag() / SDR_RX_SCALED; m_magsq = re*re + im*im; if (m_running.m_ssb & !m_usb) diff --git a/plugins/channelrx/demodam/amdemod.h b/plugins/channelrx/demodam/amdemod.h index 01ebe092a..ccbab6fb5 100644 --- a/plugins/channelrx/demodam/amdemod.h +++ b/plugins/channelrx/demodam/amdemod.h @@ -161,8 +161,8 @@ private: void processOneSample(Complex &ci) { - Real re = ci.real() / SDR_SCALED; - Real im = ci.imag() / SDR_SCALED; + Real re = ci.real() / SDR_RX_SCALED; + Real im = ci.imag() / SDR_RX_SCALED; Real magsq = re*re + im*im; m_movingAverage.feed(magsq); m_magsq = m_movingAverage.average(); @@ -210,7 +210,7 @@ private: Real attack = (m_squelchCount - 0.05f * m_settings.m_audioSampleRate) / (0.05f * m_settings.m_audioSampleRate); sample = demod * attack * 2048 * m_settings.m_volume; - if (m_settings.m_copyAudioToUDP) m_udpBufferAudio->write(demod * attack * SDR_SCALEF); + if (m_settings.m_copyAudioToUDP) m_udpBufferAudio->write(demod * attack * SDR_RX_SCALEF); m_squelchOpen = true; } diff --git a/plugins/channelrx/demodatv/atvdemod.cpp b/plugins/channelrx/demodatv/atvdemod.cpp index d1acb0355..1eb83fa25 100644 --- a/plugins/channelrx/demodatv/atvdemod.cpp +++ b/plugins/channelrx/demodatv/atvdemod.cpp @@ -338,7 +338,7 @@ void ATVDemod::demod(Complex& c) magSq = fltI*fltI + fltQ*fltQ; m_objMagSqAverage.feed(magSq); fltNorm = sqrt(magSq); - fltVal = fltNorm / SDR_SCALEF; + fltVal = fltNorm / SDR_RX_SCALEF; //********** Mini and Maxi Amplitude tracking ********** diff --git a/plugins/channelrx/demodatv/atvdemodgui.cpp b/plugins/channelrx/demodatv/atvdemodgui.cpp index 586f79d52..530f9e95f 100644 --- a/plugins/channelrx/demodatv/atvdemodgui.cpp +++ b/plugins/channelrx/demodatv/atvdemodgui.cpp @@ -474,7 +474,7 @@ void ATVDemodGUI::tick() if (m_atvDemod) { m_objMagSqAverage.feed(m_atvDemod->getMagSq()); - double magSqDB = CalcDb::dbPower(m_objMagSqAverage.average() / (SDR_SCALED*SDR_SCALED)); + double magSqDB = CalcDb::dbPower(m_objMagSqAverage.average() / (SDR_RX_SCALED*SDR_RX_SCALED)); ui->channePowerText->setText(tr("%1 dB").arg(magSqDB, 0, 'f', 1)); if (m_atvDemod->getBFOLocked()) { diff --git a/plugins/channelrx/demodbfm/bfmdemod.cpp b/plugins/channelrx/demodbfm/bfmdemod.cpp index 4f1a54774..8e432c33a 100644 --- a/plugins/channelrx/demodbfm/bfmdemod.cpp +++ b/plugins/channelrx/demodbfm/bfmdemod.cpp @@ -125,7 +125,7 @@ void BFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto for (SampleVector::const_iterator it = begin; it != end; ++it) { - Complex c(it->real() / SDR_SCALEF, it->imag() / SDR_SCALEF); + Complex c(it->real() / SDR_RX_SCALEF, it->imag() / SDR_RX_SCALEF); c *= m_nco.nextIQ(); rf_out = m_rfFilter->runFilt(c, &rf); // filter RF before demod @@ -163,7 +163,7 @@ void BFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto if (!m_settings.m_showPilot) { - m_sampleBuffer.push_back(Sample(demod * SDR_SCALEF, 0.0)); + m_sampleBuffer.push_back(Sample(demod * SDR_RX_SCALEF, 0.0)); } if (m_settings.m_rdsActive) @@ -197,7 +197,7 @@ void BFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto if (m_settings.m_showPilot) { - m_sampleBuffer.push_back(Sample(m_pilotPLLSamples[1] * SDR_SCALEF, 0.0)); // debug 38 kHz pilot + m_sampleBuffer.push_back(Sample(m_pilotPLLSamples[1] * SDR_RX_SCALEF, 0.0)); // debug 38 kHz pilot } if (m_settings.m_lsbStereo) diff --git a/plugins/channelrx/demoddsd/dsddemod.cpp b/plugins/channelrx/demoddsd/dsddemod.cpp index 451e21497..d067bfa4e 100644 --- a/plugins/channelrx/demoddsd/dsddemod.cpp +++ b/plugins/channelrx/demoddsd/dsddemod.cpp @@ -128,8 +128,8 @@ void DSDDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto { qint16 sample, delayedSample; - Real re = ci.real() / SDR_SCALED; - Real im = ci.imag() / SDR_SCALED; + Real re = ci.real() / SDR_RX_SCALED; + Real im = ci.imag() / SDR_RX_SCALED; Real magsq = re*re + im*im; m_movingAverage.feed(magsq); @@ -142,7 +142,7 @@ void DSDDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto m_magsqCount++; - Real demod = SDR_SCALEF * m_phaseDiscri.phaseDiscriminator(ci) * m_settings.m_demodGain; + Real demod = SDR_RX_SCALEF * m_phaseDiscri.phaseDiscriminator(ci) * m_settings.m_demodGain; m_sampleCount++; // AF processing diff --git a/plugins/channelrx/demodlora/lorademod.cpp b/plugins/channelrx/demodlora/lorademod.cpp index cd30f01a6..b0b397279 100644 --- a/plugins/channelrx/demodlora/lorademod.cpp +++ b/plugins/channelrx/demodlora/lorademod.cpp @@ -261,7 +261,7 @@ void LoRaDemod::feed(const SampleVector::const_iterator& begin, const SampleVect for(SampleVector::const_iterator it = begin; it < end; ++it) { - Complex c(it->real() / SDR_SCALEF, it->imag() / SDR_SCALEF); + Complex c(it->real() / SDR_RX_SCALEF, it->imag() / SDR_RX_SCALEF); c *= m_nco.nextIQ(); if(m_interpolator.decimate(&m_sampleDistanceRemain, c, &ci)) diff --git a/plugins/channelrx/demodnfm/nfmdemod.cpp b/plugins/channelrx/demodnfm/nfmdemod.cpp index 7fdcb54eb..db7243800 100644 --- a/plugins/channelrx/demodnfm/nfmdemod.cpp +++ b/plugins/channelrx/demodnfm/nfmdemod.cpp @@ -153,7 +153,7 @@ void NFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto Real demod = m_phaseDiscri.phaseDiscriminatorDelta(ci, magsqRaw, deviation); - Real magsq = magsqRaw / (SDR_SCALED*SDR_SCALED); + Real magsq = magsqRaw / (SDR_RX_SCALED*SDR_RX_SCALED); m_movingAverage.feed(magsq); m_magsqSum += magsq; diff --git a/plugins/channelrx/demodssb/ssbdemod.cpp b/plugins/channelrx/demodssb/ssbdemod.cpp index 44f880e98..743985adb 100644 --- a/plugins/channelrx/demodssb/ssbdemod.cpp +++ b/plugins/channelrx/demodssb/ssbdemod.cpp @@ -77,7 +77,7 @@ SSBDemod::SSBDemod(DeviceSourceAPI *deviceAPI) : m_magsqPeak = 0.0f; m_magsqCount = 0; - m_agc.setClampMax(SDR_SCALED*SDR_SCALED); + m_agc.setClampMax(SDR_RX_SCALED*SDR_RX_SCALED); m_agc.setClamping(m_agcClamping); SSBFilter = new fftfilt(m_LowCutoff / m_audioSampleRate, m_Bandwidth / m_audioSampleRate, ssbFftLen); @@ -186,7 +186,7 @@ void SSBDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto { Real avgr = m_sum.real() / decim; Real avgi = m_sum.imag() / decim; - m_magsq = (avgr * avgr + avgi * avgi) / (SDR_SCALED*SDR_SCALED); + m_magsq = (avgr * avgr + avgi * avgi) / (SDR_RX_SCALED*SDR_RX_SCALED); m_magsqSum += m_magsq; @@ -427,7 +427,7 @@ void SSBDemod::applySettings(const SSBDemodSettings& settings, bool force) { int agcNbSamples = 48 * (1< 0)) { for(SampleVector::const_iterator it = m_sampleBuffer.begin(); it != m_sampleBuffer.end(); ++it) { - Complex cj(it->real() / SDR_SCALEF, it->imag() / SDR_SCALEF); + Complex cj(it->real() / SDR_RX_SCALEF, it->imag() / SDR_RX_SCALEF); // An FFT filter here is overkill, but was already set up for SSB int n_out = TCPFilter->runFilt(cj, &sideband); if (n_out) { diff --git a/plugins/channelrx/udpsrc/udpsrc.cpp b/plugins/channelrx/udpsrc/udpsrc.cpp index 6652c53ab..01b45a35a 100644 --- a/plugins/channelrx/udpsrc/udpsrc.cpp +++ b/plugins/channelrx/udpsrc/udpsrc.cpp @@ -92,7 +92,7 @@ UDPSrc::UDPSrc(DeviceSourceAPI *deviceAPI) : qWarning("UDPSrc::UDPSrc: cannot bind audio port"); } - m_agc.setClampMax(SDR_SCALED*SDR_SCALED); + m_agc.setClampMax(SDR_RX_SCALED*SDR_RX_SCALED); m_agc.setClamping(true); //DSPEngine::instance()->addAudioSink(&m_audioFifo); @@ -158,7 +158,7 @@ void UDPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector: inMagSq = ci.real()*ci.real() + ci.imag()*ci.imag(); } - m_inMovingAverage.feed(inMagSq / (SDR_SCALED*SDR_SCALED)); + m_inMovingAverage.feed(inMagSq / (SDR_RX_SCALED*SDR_RX_SCALED)); m_inMagsq = m_inMovingAverage.average(); Sample ss(ci.real(), ci.imag()); @@ -180,7 +180,7 @@ void UDPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector: l = m_squelchOpen ? sideband[i].real() * m_settings.m_gain : 0; r = m_squelchOpen ? sideband[i].imag() * m_settings.m_gain : 0; m_udpBuffer->write(Sample(l, r)); - m_outMovingAverage.feed((l*l + r*r) / (SDR_SCALED*SDR_SCALED)); + m_outMovingAverage.feed((l*l + r*r) / (SDR_RX_SCALED*SDR_RX_SCALED)); } } } @@ -196,21 +196,21 @@ void UDPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector: l = m_squelchOpen ? sideband[i].real() * m_settings.m_gain : 0; r = m_squelchOpen ? sideband[i].imag() * m_settings.m_gain : 0; m_udpBuffer->write(Sample(l, r)); - m_outMovingAverage.feed((l*l + r*r) / (SDR_SCALED*SDR_SCALED)); + m_outMovingAverage.feed((l*l + r*r) / (SDR_RX_SCALED*SDR_RX_SCALED)); } } } else if (m_settings.m_sampleFormat == UDPSrcSettings::FormatNFM) { - double demod = m_squelchOpen ? SDR_SCALED * m_phaseDiscri.phaseDiscriminator(ci) * m_settings.m_gain : 0; + double demod = m_squelchOpen ? SDR_RX_SCALED * m_phaseDiscri.phaseDiscriminator(ci) * m_settings.m_gain : 0; m_udpBuffer->write(Sample(demod, demod)); - m_outMovingAverage.feed((demod * demod) / (SDR_SCALED*SDR_SCALED)); + m_outMovingAverage.feed((demod * demod) / (SDR_RX_SCALED*SDR_RX_SCALED)); } else if (m_settings.m_sampleFormat == UDPSrcSettings::FormatNFMMono) { - FixReal demod = m_squelchOpen ? (FixReal) (SDR_SCALEF * m_phaseDiscri.phaseDiscriminator(ci) * m_settings.m_gain) : 0; + FixReal demod = m_squelchOpen ? (FixReal) (SDR_RX_SCALEF * m_phaseDiscri.phaseDiscriminator(ci) * m_settings.m_gain) : 0; m_udpBufferMono->write(demod); - m_outMovingAverage.feed((demod * demod) / 1073741824.0); + m_outMovingAverage.feed((demod * demod) / SDR_RX_SCALED*SDR_RX_SCALED); } else if (m_settings.m_sampleFormat == UDPSrcSettings::FormatLSBMono) // Monaural LSB { @@ -223,7 +223,7 @@ void UDPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector: { l = m_squelchOpen ? (sideband[i].real() + sideband[i].imag()) * 0.7 * m_settings.m_gain : 0; m_udpBufferMono->write(l); - m_outMovingAverage.feed((l * l) / (SDR_SCALED*SDR_SCALED)); + m_outMovingAverage.feed((l * l) / (SDR_RX_SCALED*SDR_RX_SCALED)); } } } @@ -238,7 +238,7 @@ void UDPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector: { l = m_squelchOpen ? (sideband[i].real() + sideband[i].imag()) * 0.7 * m_settings.m_gain : 0; m_udpBufferMono->write(l); - m_outMovingAverage.feed((l * l) / (SDR_SCALED*SDR_SCALED)); + m_outMovingAverage.feed((l * l) / (SDR_RX_SCALED*SDR_RX_SCALED)); } } } @@ -246,7 +246,7 @@ void UDPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector: { FixReal demod = m_squelchOpen ? (FixReal) (sqrt(inMagSq) * agcFactor * m_settings.m_gain) : 0; m_udpBufferMono->write(demod); - m_outMovingAverage.feed((demod * demod) / 1073741824.0); + m_outMovingAverage.feed((demod * demod) / SDR_RX_SCALED*SDR_RX_SCALED); } else if (m_settings.m_sampleFormat == UDPSrcSettings::FormatAMNoDCMono) { @@ -256,7 +256,7 @@ void UDPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector: m_amMovingAverage.feed(demodf); FixReal demod = (FixReal) ((demodf - m_amMovingAverage.average()) * agcFactor * m_settings.m_gain); m_udpBufferMono->write(demod); - m_outMovingAverage.feed((demod * demod) / 1073741824.0); + m_outMovingAverage.feed((demod * demod) / SDR_RX_SCALED*SDR_RX_SCALED); } else { @@ -273,7 +273,7 @@ void UDPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector: demodf /= 301.0; FixReal demod = (FixReal) (demodf * agcFactor * m_settings.m_gain); m_udpBufferMono->write(demod); - m_outMovingAverage.feed((demod * demod) / 1073741824.0); + m_outMovingAverage.feed((demod * demod) / SDR_RX_SCALED*SDR_RX_SCALED); } else { @@ -287,7 +287,7 @@ void UDPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector: { Sample s(ci.real() * m_settings.m_gain, ci.imag() * m_settings.m_gain); m_udpBuffer->write(s); - m_outMovingAverage.feed((inMagSq*m_settings.m_gain*m_settings.m_gain) / (SDR_SCALED*SDR_SCALED)); + m_outMovingAverage.feed((inMagSq*m_settings.m_gain*m_settings.m_gain) / (SDR_RX_SCALED*SDR_RX_SCALED)); } else { diff --git a/plugins/channeltx/modam/ammod.cpp b/plugins/channeltx/modam/ammod.cpp index 17672a523..479eb39c2 100644 --- a/plugins/channeltx/modam/ammod.cpp +++ b/plugins/channeltx/modam/ammod.cpp @@ -130,7 +130,7 @@ void AMMod::pull(Sample& sample) m_settingsMutex.unlock(); double magsq = ci.real() * ci.real() + ci.imag() * ci.imag(); - magsq /= (SDR_SCALED*SDR_SCALED); + magsq /= (SDR_TX_SCALED*SDR_TX_SCALED); m_movingAverage.feed(magsq); m_magsq = m_movingAverage.average(); diff --git a/plugins/channeltx/modatv/atvmod.cpp b/plugins/channeltx/modatv/atvmod.cpp index bbc079a25..35dc83fdf 100644 --- a/plugins/channeltx/modatv/atvmod.cpp +++ b/plugins/channeltx/modatv/atvmod.cpp @@ -164,7 +164,7 @@ void ATVMod::pullFinalize(Complex& ci, Sample& sample) m_settingsMutex.unlock(); double magsq = ci.real() * ci.real() + ci.imag() * ci.imag(); - magsq /= (SDR_SCALED*SDR_SCALED); + magsq /= (SDR_TX_SCALED*SDR_TX_SCALED); m_movingAverage.feed(magsq); sample.m_real = (FixReal) ci.real(); diff --git a/plugins/channeltx/modatv/atvmodsettings.cpp b/plugins/channeltx/modatv/atvmodsettings.cpp index 192c98db9..dc32d0371 100644 --- a/plugins/channeltx/modatv/atvmodsettings.cpp +++ b/plugins/channeltx/modatv/atvmodsettings.cpp @@ -43,7 +43,7 @@ void ATVModSettings::resetToDefaults() m_cameraPlay = false; m_channelMute = false; m_invertedVideo = false; - m_rfScalingFactor = 0.891235351562f * SDR_SCALEF; // -1dB + m_rfScalingFactor = 0.891235351562f * SDR_TX_SCALEF; // -1dB m_fmExcursion = 0.5f; // half bandwidth m_forceDecimator = false; m_overlayText = "ATV"; diff --git a/plugins/channeltx/modnfm/nfmmod.cpp b/plugins/channeltx/modnfm/nfmmod.cpp index 812e52332..2d49ef740 100644 --- a/plugins/channeltx/modnfm/nfmmod.cpp +++ b/plugins/channeltx/modnfm/nfmmod.cpp @@ -136,7 +136,7 @@ void NFMMod::pull(Sample& sample) m_settingsMutex.unlock(); double magsq = ci.real() * ci.real() + ci.imag() * ci.imag(); - magsq /= (SDR_SCALED*SDR_SCALED); + magsq /= (SDR_TX_SCALED*SDR_TX_SCALED); m_movingAverage.feed(magsq); m_magsq = m_movingAverage.average(); @@ -175,8 +175,8 @@ void NFMMod::modulateSample() m_modPhasor += (m_settings.m_fmDeviation / (float) m_settings.m_audioSampleRate) * m_bandpass.filter(t) * (M_PI / 378.0f); } - m_modSample.real(cos(m_modPhasor) * 0.891235351562f * SDR_SCALEF); // -1 dB - m_modSample.imag(sin(m_modPhasor) * 0.891235351562f * SDR_SCALEF); + m_modSample.real(cos(m_modPhasor) * 0.891235351562f * SDR_TX_SCALEF); // -1 dB + m_modSample.imag(sin(m_modPhasor) * 0.891235351562f * SDR_TX_SCALEF); } void NFMMod::pullAF(Real& sample) diff --git a/plugins/channeltx/modssb/ssbmod.cpp b/plugins/channeltx/modssb/ssbmod.cpp index 84d8e7a72..662abc634 100644 --- a/plugins/channeltx/modssb/ssbmod.cpp +++ b/plugins/channeltx/modssb/ssbmod.cpp @@ -160,12 +160,12 @@ void SSBMod::pull(Sample& sample) m_interpolatorDistanceRemain += m_interpolatorDistance; ci *= m_carrierNco.nextIQ(); // shift to carrier frequency - ci *= 0.891235351562f * SDR_SCALEF; //scaling at -1 dB to account for possible filter overshoot + ci *= 0.891235351562f * SDR_TX_SCALEF; //scaling at -1 dB to account for possible filter overshoot m_settingsMutex.unlock(); double magsq = ci.real() * ci.real() + ci.imag() * ci.imag(); - magsq /= (SDR_SCALED*SDR_SCALED); + magsq /= (SDR_TX_SCALED*SDR_TX_SCALED); m_movingAverage.feed(magsq); m_magsq = m_movingAverage.average(); @@ -298,13 +298,13 @@ void SSBMod::pullAF(Complex& sample) { if (m_settings.m_audioFlipChannels) { - ci.real((m_audioBuffer[m_audioBufferFill].r / SDR_SCALEF) * m_settings.m_volumeFactor); - ci.imag((m_audioBuffer[m_audioBufferFill].l / SDR_SCALEF) * m_settings.m_volumeFactor); + ci.real((m_audioBuffer[m_audioBufferFill].r / SDR_TX_SCALEF) * m_settings.m_volumeFactor); + ci.imag((m_audioBuffer[m_audioBufferFill].l / SDR_TX_SCALEF) * m_settings.m_volumeFactor); } else { - ci.real((m_audioBuffer[m_audioBufferFill].l / SDR_SCALEF) * m_settings.m_volumeFactor); - ci.imag((m_audioBuffer[m_audioBufferFill].r / SDR_SCALEF) * m_settings.m_volumeFactor); + ci.real((m_audioBuffer[m_audioBufferFill].l / SDR_TX_SCALEF) * m_settings.m_volumeFactor); + ci.imag((m_audioBuffer[m_audioBufferFill].r / SDR_TX_SCALEF) * m_settings.m_volumeFactor); } } else @@ -419,8 +419,8 @@ void SSBMod::pullAF(Complex& sample) if (!(m_undersampleCount++ & decim_mask)) { - Real avgr = (m_sum.real() / decim) * 0.891235351562f * SDR_SCALEF; //scaling at -1 dB to account for possible filter overshoot - Real avgi = (m_sum.imag() / decim) * 0.891235351562f * SDR_SCALEF; + Real avgr = (m_sum.real() / decim) * 0.891235351562f * SDR_TX_SCALEF; //scaling at -1 dB to account for possible filter overshoot + Real avgi = (m_sum.imag() / decim) * 0.891235351562f * SDR_TX_SCALEF; if (!m_settings.m_dsb & !m_settings.m_usb) { // invert spectrum for LSB @@ -443,8 +443,8 @@ void SSBMod::pullAF(Complex& sample) if (!(m_undersampleCount++ & decim_mask)) { - Real avgr = (m_sum.real() / decim) * 0.891235351562f * SDR_SCALEF; //scaling at -1 dB to account for possible filter overshoot - Real avgi = (m_sum.imag() / decim) * 0.891235351562f * SDR_SCALEF; + Real avgr = (m_sum.real() / decim) * 0.891235351562f * SDR_TX_SCALEF; //scaling at -1 dB to account for possible filter overshoot + Real avgi = (m_sum.imag() / decim) * 0.891235351562f * SDR_TX_SCALEF; if (!m_settings.m_dsb & !m_settings.m_usb) { // invert spectrum for LSB diff --git a/plugins/channeltx/modwfm/wfmmod.cpp b/plugins/channeltx/modwfm/wfmmod.cpp index 7492b6a77..87bf31fc6 100644 --- a/plugins/channeltx/modwfm/wfmmod.cpp +++ b/plugins/channeltx/modwfm/wfmmod.cpp @@ -139,8 +139,8 @@ void WFMMod::pull(Sample& sample) } m_modPhasor += (m_settings.m_fmDeviation / (float) m_outputSampleRate) * ri.real() * M_PI * 2.0f; - ci.real(cos(m_modPhasor) * 0.891235351562f * SDR_SCALEF); // -1 dB - ci.imag(sin(m_modPhasor) * 0.891235351562f * SDR_SCALEF); + ci.real(cos(m_modPhasor) * 0.891235351562f * SDR_TX_SCALEF); // -1 dB + ci.imag(sin(m_modPhasor) * 0.891235351562f * SDR_TX_SCALEF); // RF filtering rf_out = m_rfFilter->runFilt(ci, &rf); @@ -158,7 +158,7 @@ void WFMMod::pull(Sample& sample) m_settingsMutex.unlock(); double magsq = ci.real() * ci.real() + ci.imag() * ci.imag(); - magsq /= (SDR_SCALED*SDR_SCALED); + magsq /= (SDR_TX_SCALED*SDR_TX_SCALED); m_movingAverage.feed(magsq); m_magsq = m_movingAverage.average(); diff --git a/plugins/channeltx/udpsink/udpsink.cpp b/plugins/channeltx/udpsink/udpsink.cpp index f36fd1737..3915fabf4 100644 --- a/plugins/channeltx/udpsink/udpsink.cpp +++ b/plugins/channeltx/udpsink/udpsink.cpp @@ -134,7 +134,7 @@ void UDPSink::pull(Sample& sample) m_settingsMutex.unlock(); double magsq = ci.real() * ci.real() + ci.imag() * ci.imag(); - magsq /= (SDR_SCALED*SDR_SCALED); + magsq /= (SDR_TX_SCALED*SDR_TX_SCALED); m_movingAverage.feed(magsq); m_magsq = m_movingAverage.average(); @@ -151,7 +151,7 @@ void UDPSink::modulateSample() m_udpHandler.readSample(s); uint64_t magsq = s.m_real * s.m_real + s.m_imag * s.m_imag; - m_inMovingAverage.feed(magsq/1073741824.0); + m_inMovingAverage.feed(magsq/(SDR_TX_SCALED*SDR_TX_SCALED)); m_inMagsq = m_inMovingAverage.average(); calculateSquelch(m_inMagsq); @@ -180,9 +180,9 @@ void UDPSink::modulateSample() if (m_squelchOpen) { - m_modPhasor += (m_settings.m_fmDeviation / m_settings.m_inputSampleRate) * (t / SDR_SCALEF) * M_PI * 2.0f; - m_modSample.real(cos(m_modPhasor) * 0.3162292f * SDR_SCALEF * m_settings.m_gainOut); - m_modSample.imag(sin(m_modPhasor) * 0.3162292f * SDR_SCALEF * m_settings.m_gainOut); + m_modPhasor += (m_settings.m_fmDeviation / m_settings.m_inputSampleRate) * (t / SDR_TX_SCALEF) * M_PI * 2.0f; + m_modSample.real(cos(m_modPhasor) * 0.3162292f * SDR_TX_SCALEF * m_settings.m_gainOut); + m_modSample.imag(sin(m_modPhasor) * 0.3162292f * SDR_TX_SCALEF * m_settings.m_gainOut); calculateLevel(m_modSample); } else @@ -195,14 +195,14 @@ void UDPSink::modulateSample() { FixReal t; readMonoSample(t); - m_inMovingAverage.feed((t*t)/(SDR_SCALED*SDR_SCALED)); + m_inMovingAverage.feed((t*t)/(SDR_TX_SCALED*SDR_TX_SCALED)); m_inMagsq = m_inMovingAverage.average(); calculateSquelch(m_inMagsq); if (m_squelchOpen) { - m_modSample.real(((t / SDR_SCALEF)*m_settings.m_amModFactor*m_settings.m_gainOut + 1.0f) * (SDR_SCALEF/2)); // modulate and scale zero frequency carrier + m_modSample.real(((t / SDR_TX_SCALEF)*m_settings.m_amModFactor*m_settings.m_gainOut + 1.0f) * (SDR_TX_SCALEF/2)); // modulate and scale zero frequency carrier m_modSample.imag(0.0f); calculateLevel(m_modSample); } @@ -220,14 +220,14 @@ void UDPSink::modulateSample() int n_out = 0; readMonoSample(t); - m_inMovingAverage.feed((t*t)/1073741824.0); + m_inMovingAverage.feed((t*t)/(SDR_TX_SCALED*SDR_TX_SCALED)); m_inMagsq = m_inMovingAverage.average(); calculateSquelch(m_inMagsq); if (m_squelchOpen) { - ci.real((t / SDR_SCALEF) * m_settings.m_gainOut); + ci.real((t / SDR_TX_SCALEF) * m_settings.m_gainOut); ci.imag(0.0f); n_out = m_SSBFilter->runSSB(ci, &filtered, (m_settings.m_sampleFormat == UDPSinkSettings::FormatUSB)); @@ -239,8 +239,8 @@ void UDPSink::modulateSample() } c = m_SSBFilterBuffer[m_SSBFilterBufferIndex]; - m_modSample.real(m_SSBFilterBuffer[m_SSBFilterBufferIndex].real() * SDR_SCALEF); - m_modSample.imag(m_SSBFilterBuffer[m_SSBFilterBufferIndex].imag() * SDR_SCALEF); + m_modSample.real(m_SSBFilterBuffer[m_SSBFilterBufferIndex].real() * SDR_TX_SCALEF); + m_modSample.imag(m_SSBFilterBuffer[m_SSBFilterBufferIndex].imag() * SDR_TX_SCALEF); m_SSBFilterBufferIndex++; calculateLevel(m_modSample); @@ -305,8 +305,8 @@ void UDPSink::calculateLevel(Complex sample) } else { - qreal rmsLevel = m_levelSum > 0.0 ? sqrt((m_levelSum/(SDR_SCALED*SDR_SCALED)) / m_levelNbSamples) : 0.0; - emit levelChanged(rmsLevel, m_peakLevel / SDR_SCALEF, m_levelNbSamples); + qreal rmsLevel = m_levelSum > 0.0 ? sqrt((m_levelSum/(SDR_TX_SCALED*SDR_TX_SCALED)) / m_levelNbSamples) : 0.0; + emit levelChanged(rmsLevel, m_peakLevel / SDR_TX_SCALEF, m_levelNbSamples); m_peakLevel = 0.0f; m_levelSum = 0.0f; m_levelCalcCount = 0; diff --git a/plugins/samplesink/bladerfoutput/bladerfoutputthread.h b/plugins/samplesink/bladerfoutput/bladerfoutputthread.h index 7a973161b..4a93140e0 100644 --- a/plugins/samplesink/bladerfoutput/bladerfoutputthread.h +++ b/plugins/samplesink/bladerfoutput/bladerfoutputthread.h @@ -51,7 +51,7 @@ private: unsigned int m_log2Interp; int m_fcPos; - Interpolators m_interpolators; + Interpolators m_interpolators; void run(); void callback(qint16* buf, qint32 len); diff --git a/plugins/samplesink/filesink/filesinkthread.h b/plugins/samplesink/filesink/filesinkthread.h index e408d0b39..3c7b820f7 100644 --- a/plugins/samplesink/filesink/filesinkthread.h +++ b/plugins/samplesink/filesink/filesinkthread.h @@ -70,7 +70,7 @@ private: QElapsedTimer m_elapsedTimer; bool m_throttleToggle; - Interpolators m_interpolators; + Interpolators m_interpolators; int16_t *m_buf; void run(); diff --git a/plugins/samplesink/hackrfoutput/hackrfoutputthread.h b/plugins/samplesink/hackrfoutput/hackrfoutputthread.h index 5e51cff2d..f44139a0e 100644 --- a/plugins/samplesink/hackrfoutput/hackrfoutputthread.h +++ b/plugins/samplesink/hackrfoutput/hackrfoutputthread.h @@ -49,7 +49,7 @@ private: unsigned int m_log2Interp; - Interpolators m_interpolators; + Interpolators m_interpolators; void run(); void callback(qint8* buf, qint32 len); diff --git a/plugins/samplesink/limesdroutput/limesdroutputthread.h b/plugins/samplesink/limesdroutput/limesdroutputthread.h index 7acd125cc..e543d510c 100644 --- a/plugins/samplesink/limesdroutput/limesdroutputthread.h +++ b/plugins/samplesink/limesdroutput/limesdroutputthread.h @@ -56,7 +56,7 @@ private: unsigned int m_log2Interp; // soft decimation int m_fcPos; - Interpolators m_interpolators; + Interpolators m_interpolators; void run(); void callback(qint16* buf, qint32 len); diff --git a/plugins/samplesink/plutosdroutput/plutosdroutputthread.h b/plugins/samplesink/plutosdroutput/plutosdroutputthread.h index 7669fceca..782c6e389 100644 --- a/plugins/samplesink/plutosdroutput/plutosdroutputthread.h +++ b/plugins/samplesink/plutosdroutput/plutosdroutputthread.h @@ -54,7 +54,7 @@ private: unsigned int m_log2Interp; // soft interpolation - Interpolators m_interpolators; + Interpolators m_interpolators; void run(); void convert(qint16* buf, qint32 len); diff --git a/plugins/samplesource/airspy/airspythread.h b/plugins/samplesource/airspy/airspythread.h index a5d62feda..b21c894d3 100644 --- a/plugins/samplesource/airspy/airspythread.h +++ b/plugins/samplesource/airspy/airspythread.h @@ -55,10 +55,10 @@ private: int m_fcPos; static AirspyThread *m_this; -#ifdef SDR_SAMPLE_24BIT - Decimators m_decimators; +#ifdef SDR_RX_SAMPLE_24BIT + Decimators m_decimators; #else - Decimators m_decimators; + Decimators m_decimators; #endif void run(); diff --git a/plugins/samplesource/airspyhf/airspyhfthread.h b/plugins/samplesource/airspyhf/airspyhfthread.h index 9f22cb6f0..615bf8275 100644 --- a/plugins/samplesource/airspyhf/airspyhfthread.h +++ b/plugins/samplesource/airspyhf/airspyhfthread.h @@ -53,10 +53,10 @@ private: unsigned int m_log2Decim; static AirspyHFThread *m_this; -#ifdef SDR_SAMPLE_24BIT - Decimators m_decimators; +#ifdef SDR_RX_SAMPLE_24BIT + Decimators m_decimators; #else - Decimators m_decimators; + Decimators m_decimators; #endif void run(); diff --git a/plugins/samplesource/bladerfinput/bladerfinputthread.h b/plugins/samplesource/bladerfinput/bladerfinputthread.h index 60e21a2d7..8230c5c90 100644 --- a/plugins/samplesource/bladerfinput/bladerfinputthread.h +++ b/plugins/samplesource/bladerfinput/bladerfinputthread.h @@ -51,10 +51,10 @@ private: unsigned int m_log2Decim; int m_fcPos; -#ifdef SDR_SAMPLE_24BIT - Decimators m_decimators; +#ifdef SDR_RX_SAMPLE_24BIT + Decimators m_decimators; #else - Decimators m_decimators; + Decimators m_decimators; #endif void run(); diff --git a/plugins/samplesource/hackrfinput/hackrfinputthread.h b/plugins/samplesource/hackrfinput/hackrfinputthread.h index 0f07c77df..32df49077 100644 --- a/plugins/samplesource/hackrfinput/hackrfinputthread.h +++ b/plugins/samplesource/hackrfinput/hackrfinputthread.h @@ -54,10 +54,10 @@ private: unsigned int m_log2Decim; int m_fcPos; -#ifdef SDR_SAMPLE_24BIT - Decimators m_decimators; +#ifdef SDR_RX_SAMPLE_24BIT + Decimators m_decimators; #else - Decimators m_decimators; + Decimators m_decimators; #endif void run(); diff --git a/plugins/samplesource/limesdrinput/limesdrinputthread.h b/plugins/samplesource/limesdrinput/limesdrinputthread.h index d83919c11..096083ac8 100644 --- a/plugins/samplesource/limesdrinput/limesdrinputthread.h +++ b/plugins/samplesource/limesdrinput/limesdrinputthread.h @@ -55,10 +55,10 @@ private: unsigned int m_log2Decim; // soft decimation -#ifdef SDR_SAMPLE_24BIT - Decimators m_decimators; +#ifdef SDR_RX_SAMPLE_24BIT + Decimators m_decimators; #else - Decimators m_decimators; + Decimators m_decimators; #endif void run(); diff --git a/plugins/samplesource/plutosdrinput/plutosdrinputthread.h b/plugins/samplesource/plutosdrinput/plutosdrinputthread.h index 2e1e94fbe..e79630334 100644 --- a/plugins/samplesource/plutosdrinput/plutosdrinputthread.h +++ b/plugins/samplesource/plutosdrinput/plutosdrinputthread.h @@ -59,10 +59,10 @@ private: int m_fcPos; float m_phasor; -#ifdef SDR_SAMPLE_24BIT - Decimators m_decimators; +#ifdef SDR_RX_SAMPLE_24BIT + Decimators m_decimators; #else - Decimators m_decimators; + Decimators m_decimators; #endif void run(); diff --git a/plugins/samplesource/rtlsdr/rtlsdrthread.h b/plugins/samplesource/rtlsdr/rtlsdrthread.h index a3ef61c02..97f3ed56d 100644 --- a/plugins/samplesource/rtlsdr/rtlsdrthread.h +++ b/plugins/samplesource/rtlsdr/rtlsdrthread.h @@ -52,10 +52,10 @@ private: unsigned int m_log2Decim; int m_fcPos; -#ifdef SDR_SAMPLE_24BIT - DecimatorsU m_decimators; +#ifdef SDR_RX_SAMPLE_24BIT + DecimatorsU m_decimators; #else - DecimatorsU m_decimators; + DecimatorsU m_decimators; #endif void run(); diff --git a/plugins/samplesource/sdrplay/sdrplaythread.h b/plugins/samplesource/sdrplay/sdrplaythread.h index d11a11145..807db699c 100644 --- a/plugins/samplesource/sdrplay/sdrplaythread.h +++ b/plugins/samplesource/sdrplay/sdrplaythread.h @@ -52,10 +52,10 @@ private: unsigned int m_log2Decim; int m_fcPos; -#ifdef SDR_SAMPLE_24BIT - Decimators m_decimators; +#ifdef SDR_RX_SAMPLE_24BIT + Decimators m_decimators; #else - Decimators m_decimators; + Decimators m_decimators; #endif void run(); diff --git a/plugins/samplesource/testsource/testsourcethread.h b/plugins/samplesource/testsource/testsourcethread.h index b1759c90e..d8a8f219c 100644 --- a/plugins/samplesource/testsource/testsourcethread.h +++ b/plugins/samplesource/testsource/testsourcethread.h @@ -85,14 +85,14 @@ private: bool m_throttleToggle; QMutex m_mutex; -#ifdef SDR_SAMPLE_24BIT - Decimators m_decimators_8; - Decimators m_decimators_12; - Decimators m_decimators_16; +#ifdef SDR_RX_SAMPLE_24BIT + Decimators m_decimators_8; + Decimators m_decimators_12; + Decimators m_decimators_16; #else - Decimators m_decimators_8; - Decimators m_decimators_12; - Decimators m_decimators_16; + Decimators m_decimators_8; + Decimators m_decimators_12; + Decimators m_decimators_16; #endif void run(); diff --git a/sdrbase/dsp/decimators.h b/sdrbase/dsp/decimators.h index 589d08b82..9abd7350c 100644 --- a/sdrbase/dsp/decimators.h +++ b/sdrbase/dsp/decimators.h @@ -18,7 +18,7 @@ #define INCLUDE_GPL_DSP_DECIMATORS_H_ #include "dsp/dsptypes.h" -#ifdef SDR_SAMPLE_24BIT +#ifdef SDR_RX_SAMPLE_24BIT #include "dsp/inthalfbandfilterdb.h" #else #ifdef USE_SSE4_1 @@ -240,7 +240,7 @@ public: void decimate64_cen(SampleVector::iterator* it, const T* bufI, const T* bufQ, qint32 len); private: -#ifdef SDR_SAMPLE_24BIT +#ifdef SDR_RX_SAMPLE_24BIT IntHalfbandFilterDB m_decimator2; // 1st stages IntHalfbandFilterDB m_decimator4; // 2nd stages IntHalfbandFilterDB m_decimator8; // 3rd stages diff --git a/sdrbase/dsp/decimatorsu.h b/sdrbase/dsp/decimatorsu.h index 2f028b2f5..059e7dcf3 100644 --- a/sdrbase/dsp/decimatorsu.h +++ b/sdrbase/dsp/decimatorsu.h @@ -24,7 +24,7 @@ #define INCLUDE_GPL_DSP_DECIMATORSU_H_ #include "dsp/dsptypes.h" -#ifdef SDR_SAMPLE_24BIT +#ifdef SDR_RX_SAMPLE_24BIT #include "dsp/inthalfbandfilterdb.h" #else #ifdef USE_SSE4_1 @@ -206,7 +206,7 @@ public: void decimate64_cen(SampleVector::iterator* it, const T* buf, qint32 len); private: -#ifdef SDR_SAMPLE_24BIT +#ifdef SDR_RX_SAMPLE_24BIT IntHalfbandFilterDB m_decimator2; // 1st stages IntHalfbandFilterDB m_decimator4; // 2nd stages IntHalfbandFilterDB m_decimator8; // 3rd stages diff --git a/sdrbase/dsp/downchannelizer.cpp b/sdrbase/dsp/downchannelizer.cpp index 8b73f34de..cfbec834d 100644 --- a/sdrbase/dsp/downchannelizer.cpp +++ b/sdrbase/dsp/downchannelizer.cpp @@ -192,7 +192,7 @@ void DownChannelizer::applyConfiguration() } } -#ifdef SDR_SAMPLE_24BIT +#ifdef SDR_RX_SAMPLE_24BIT DownChannelizer::FilterStage::FilterStage(Mode mode) : m_filter(new IntHalfbandFilterDB), m_workFunction(0), diff --git a/sdrbase/dsp/downchannelizer.h b/sdrbase/dsp/downchannelizer.h index da9ce6d80..96d031354 100644 --- a/sdrbase/dsp/downchannelizer.h +++ b/sdrbase/dsp/downchannelizer.h @@ -23,7 +23,7 @@ #include #include "util/export.h" #include "util/message.h" -#ifdef SDR_SAMPLE_24BIT +#ifdef SDR_RX_SAMPLE_24BIT #include "dsp/inthalfbandfilterdb.h" #else #ifdef USE_SSE4_1 @@ -82,7 +82,7 @@ protected: ModeUpperHalf }; -#ifdef SDR_SAMPLE_24BIT +#ifdef SDR_RX_SAMPLE_24BIT typedef bool (IntHalfbandFilterDB::*WorkFunction)(Sample* s); IntHalfbandFilterDB* m_filter; #else diff --git a/sdrbase/dsp/dsptypes.h b/sdrbase/dsp/dsptypes.h index 7300c9dae..e3913a785 100644 --- a/sdrbase/dsp/dsptypes.h +++ b/sdrbase/dsp/dsptypes.h @@ -22,18 +22,22 @@ #include #include -#ifdef SDR_SAMPLE_24BIT -#define SDR_SAMP_SZ 24 // internal fixed arithmetic sample size -#define SDR_SCALEF 8388608.0f -#define SDR_SCALED 8388608.0 +#ifdef SDR_RX_SAMPLE_24BIT +#define SDR_RX_SAMP_SZ 24 // internal fixed arithmetic sample size +#define SDR_RX_SCALEF 8388608.0f +#define SDR_RX_SCALED 8388608.0 typedef qint32 FixReal; #else -#define SDR_SAMP_SZ 16 // internal fixed arithmetic sample size -#define SDR_SCALEF 32768.0f -#define SDR_SCALED 32768.0 +#define SDR_RX_SAMP_SZ 16 // internal fixed arithmetic sample size +#define SDR_RX_SCALEF 32768.0f +#define SDR_RX_SCALED 32768.0 typedef qint16 FixReal; #endif +#define SDR_TX_SAMP_SZ 16 +#define SDR_TX_SCALEF 32768.0f +#define SDR_TX_SCALED 32768.0 + typedef float Real; typedef std::complex Complex; diff --git a/sdrgui/dsp/scopevis.cpp b/sdrgui/dsp/scopevis.cpp index 02fd0066c..1ee974efe 100644 --- a/sdrgui/dsp/scopevis.cpp +++ b/sdrgui/dsp/scopevis.cpp @@ -111,7 +111,7 @@ void ScopeVis::feed(const SampleVector::const_iterator& cbegin, const SampleVect for(int i = 0; i < count; ++i) { - *it++ = Complex(begin->real() / SDR_SCALEF, begin->imag() / SDR_SCALEF); + *it++ = Complex(begin->real() / SDR_RX_SCALEF, begin->imag() / SDR_RX_SCALEF); ++begin; } @@ -234,7 +234,7 @@ void ScopeVis::feed(const SampleVector::const_iterator& cbegin, const SampleVect for(int i = 0; i < count; ++i) { - *it++ = Complex(begin->real() / SDR_SCALEF, begin->imag() / SDR_SCALEF); + *it++ = Complex(begin->real() / SDR_RX_SCALEF, begin->imag() / SDR_RX_SCALEF); ++begin; } @@ -341,7 +341,7 @@ void ScopeVis::setSampleRate(int sampleRate) bool ScopeVis::triggerCondition(SampleVector::const_iterator& it) { - Complex c(it->real()/SDR_SCALEF, it->imag()/SDR_SCALEF); + Complex c(it->real()/SDR_RX_SCALEF, it->imag()/SDR_RX_SCALEF); m_traceback.push_back(c); // store into trace memory FIFO if (m_tracebackCount < m_traceback.size()) diff --git a/sdrgui/dsp/scopevismulti.h b/sdrgui/dsp/scopevismulti.h index c05656a8c..3ae2a5e7f 100644 --- a/sdrgui/dsp/scopevismulti.h +++ b/sdrgui/dsp/scopevismulti.h @@ -556,7 +556,7 @@ private: switch (m_projectionType) { case ProjectionImag: - v = s.m_imag / SDR_SCALEF; + v = s.m_imag / SDR_RX_SCALEF; break; case ProjectionMagLin: { @@ -590,7 +590,7 @@ private: break; case ProjectionReal: default: - v = s.m_real / SDR_SCALEF; + v = s.m_real / SDR_RX_SCALEF; break; } diff --git a/sdrgui/dsp/scopevisng.h b/sdrgui/dsp/scopevisng.h index 3687f7d20..d31b8ce9a 100644 --- a/sdrgui/dsp/scopevisng.h +++ b/sdrgui/dsp/scopevisng.h @@ -545,7 +545,7 @@ private: switch (m_projectionType) { case ProjectionImag: - v = s.m_imag / SDR_SCALEF; + v = s.m_imag / SDR_RX_SCALEF; break; case ProjectionMagLin: { @@ -579,7 +579,7 @@ private: break; case ProjectionReal: default: - v = s.m_real / SDR_SCALEF; + v = s.m_real / SDR_RX_SCALEF; break; } diff --git a/sdrgui/dsp/spectrumvis.cpp b/sdrgui/dsp/spectrumvis.cpp index 779436130..ff1f569a1 100644 --- a/sdrgui/dsp/spectrumvis.cpp +++ b/sdrgui/dsp/spectrumvis.cpp @@ -85,7 +85,7 @@ void SpectrumVis::feed(const SampleVector::const_iterator& cbegin, const SampleV for (std::size_t i = 0; i < samplesNeeded; ++i, ++begin) { - *it++ = Complex(begin->real() / SDR_SCALEF, begin->imag() / SDR_SCALEF); + *it++ = Complex(begin->real() / SDR_RX_SCALEF, begin->imag() / SDR_RX_SCALEF); } // apply fft window (and copy from m_fftBuffer to m_fftIn) @@ -144,7 +144,7 @@ void SpectrumVis::feed(const SampleVector::const_iterator& cbegin, const SampleV // not enough samples for FFT - just fill in new data and return for(std::vector::iterator it = m_fftBuffer.begin() + m_fftBufferFill; begin < end; ++begin) { - *it++ = Complex(begin->real() / SDR_SCALEF, begin->imag() / SDR_SCALEF); + *it++ = Complex(begin->real() / SDR_RX_SCALEF, begin->imag() / SDR_RX_SCALEF); } m_fftBufferFill += todo; From 61a16eade96445db68cdd87a4395d30623e34a67 Mon Sep 17 00:00:00 2001 From: f4exb Date: Mon, 22 Jan 2018 10:46:57 +0100 Subject: [PATCH 11/27] Use always 16 bit DSP on Tx side --- sdrbase/dsp/interpolators.h | 13 ------------- sdrbase/dsp/upchannelizer.cpp | 21 --------------------- sdrbase/dsp/upchannelizer.h | 9 --------- 3 files changed, 43 deletions(-) diff --git a/sdrbase/dsp/interpolators.h b/sdrbase/dsp/interpolators.h index 42e7640f3..d64619f40 100644 --- a/sdrbase/dsp/interpolators.h +++ b/sdrbase/dsp/interpolators.h @@ -18,15 +18,11 @@ #define INCLUDE_GPL_DSP_INTERPOLATORS_H_ #include "dsp/dsptypes.h" -#ifdef SDR_TX_SAMPLE_24BIT -#include "dsp/inthalfbandfilterdb.h" -#else #ifdef USE_SSE4_1 #include "dsp/inthalfbandfiltereo1.h" #else #include "dsp/inthalfbandfilterdb.h" #endif -#endif #define INTERPOLATORS_HB_FILTER_ORDER_FIRST 64 #define INTERPOLATORS_HB_FILTER_ORDER_SECOND 32 @@ -118,14 +114,6 @@ public: void interpolate64_cen(SampleVector::iterator* it, T* buf, qint32 len); private: -#ifdef SDR_TX_SAMPLE_24BIT - IntHalfbandFilterDB m_interpolator2; // 1st stages - IntHalfbandFilterDB m_interpolator4; // 2nd stages - IntHalfbandFilterDB m_interpolator8; // 3rd stages - IntHalfbandFilterDB m_interpolator16; // 4th stages - IntHalfbandFilterDB m_interpolator32; // 5th stages - IntHalfbandFilterDB m_interpolator64; // 6th stages -#else #ifdef USE_SSE4_1 IntHalfbandFilterEO1 m_interpolator2; // 1st stages IntHalfbandFilterEO1 m_interpolator4; // 2nd stages @@ -141,7 +129,6 @@ private: IntHalfbandFilterDB m_interpolator32; // 5th stages IntHalfbandFilterDB m_interpolator64; // 6th stages #endif -#endif }; template diff --git a/sdrbase/dsp/upchannelizer.cpp b/sdrbase/dsp/upchannelizer.cpp index fa1e26b52..a59db9ad2 100644 --- a/sdrbase/dsp/upchannelizer.cpp +++ b/sdrbase/dsp/upchannelizer.cpp @@ -207,26 +207,6 @@ void UpChannelizer::applyConfiguration() } } -#ifdef SDR_TX_SAMPLE_24BIT -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; - } -} -#else #ifdef USE_SSE4_1 UpChannelizer::FilterStage::FilterStage(Mode mode) : m_filter(new IntHalfbandFilterEO1), @@ -266,7 +246,6 @@ UpChannelizer::FilterStage::FilterStage(Mode mode) : } } #endif -#endif UpChannelizer::FilterStage::~FilterStage() { diff --git a/sdrbase/dsp/upchannelizer.h b/sdrbase/dsp/upchannelizer.h index dc6bb3015..3b15f7a96 100644 --- a/sdrbase/dsp/upchannelizer.h +++ b/sdrbase/dsp/upchannelizer.h @@ -23,15 +23,11 @@ #include #include "util/export.h" #include "util/message.h" -#ifdef SDR_TX_SAMPLE_24BIT -#include "dsp/inthalfbandfilterdb.h" -#else #ifdef USE_SSE4_1 #include "dsp/inthalfbandfiltereo1.h" #else #include "dsp/inthalfbandfilterdb.h" #endif -#endif #define UPCHANNELIZER_HB_FILTER_ORDER 96 @@ -87,17 +83,12 @@ protected: ModeUpperHalf }; -#ifdef SDR_TX_SAMPLE_24BIT - typedef bool (IntHalfbandFilterDB::*WorkFunction)(Sample* sIn, Sample *sOut); - IntHalfbandFilterDB* m_filter; -#else #ifdef USE_SSE4_1 typedef bool (IntHalfbandFilterEO1::*WorkFunction)(Sample* sIn, Sample *sOut); IntHalfbandFilterEO1* m_filter; #else typedef bool (IntHalfbandFilterDB::*WorkFunction)(Sample* sIn, Sample *sOut); IntHalfbandFilterDB* m_filter; -#endif #endif WorkFunction m_workFunction; From a47587e16f42480bbae3eec6e0d56b75fc80f2b8 Mon Sep 17 00:00:00 2001 From: f4exb Date: Mon, 22 Jan 2018 14:07:24 +0100 Subject: [PATCH 12/27] Specify Scope and Spectrum Vis floating point sample scale --- plugins/channelrx/chanalyzer/chanalyzergui.cpp | 4 ++-- plugins/channelrx/chanalyzerng/chanalyzernggui.cpp | 2 +- plugins/channelrx/demodbfm/bfmdemodgui.cpp | 2 +- plugins/channelrx/demoddsd/dsddemodgui.cpp | 2 +- plugins/channelrx/demodlora/lorademodgui.cpp | 2 +- plugins/channelrx/demodssb/ssbdemodgui.cpp | 2 +- plugins/channelrx/tcpsrc/tcpsrcgui.cpp | 2 +- plugins/channelrx/udpsrc/udpsrcgui.cpp | 2 +- plugins/channeltx/modssb/ssbmodgui.cpp | 2 +- plugins/channeltx/udpsink/udpsinkgui.cpp | 2 +- sdrgui/device/deviceuiset.cpp | 6 +++++- sdrgui/dsp/scopevis.cpp | 9 +++++---- sdrgui/dsp/scopevis.h | 3 ++- sdrgui/dsp/scopevismulti.h | 12 ++++++++---- sdrgui/dsp/scopevisng.h | 12 ++++++++---- sdrgui/dsp/spectrumvis.cpp | 7 ++++--- sdrgui/dsp/spectrumvis.h | 3 ++- 17 files changed, 45 insertions(+), 29 deletions(-) diff --git a/plugins/channelrx/chanalyzer/chanalyzergui.cpp b/plugins/channelrx/chanalyzer/chanalyzergui.cpp index d68e7b01e..cb3d7ef23 100644 --- a/plugins/channelrx/chanalyzer/chanalyzergui.cpp +++ b/plugins/channelrx/chanalyzer/chanalyzergui.cpp @@ -338,8 +338,8 @@ ChannelAnalyzerGUI::ChannelAnalyzerGUI(PluginAPI* pluginAPI, DeviceUISet *device setAttribute(Qt::WA_DeleteOnClose, true); connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); - m_spectrumVis = new SpectrumVis(ui->glSpectrum); - m_scopeVis = new ScopeVis(ui->glScope); + m_spectrumVis = new SpectrumVis(SDR_RX_SCALEF, ui->glSpectrum); + m_scopeVis = new ScopeVis(SDR_RX_SCALEF, ui->glScope); m_spectrumScopeComboVis = new SpectrumScopeComboVis(m_spectrumVis, m_scopeVis); m_channelAnalyzer = (ChannelAnalyzer*) rxChannel; //new ChannelAnalyzer(m_deviceUISet->m_deviceSourceAPI); m_channelAnalyzer->setSampleSink(m_spectrumScopeComboVis); diff --git a/plugins/channelrx/chanalyzerng/chanalyzernggui.cpp b/plugins/channelrx/chanalyzerng/chanalyzernggui.cpp index b290020ef..3441cb265 100644 --- a/plugins/channelrx/chanalyzerng/chanalyzernggui.cpp +++ b/plugins/channelrx/chanalyzerng/chanalyzernggui.cpp @@ -395,7 +395,7 @@ ChannelAnalyzerNGGUI::ChannelAnalyzerNGGUI(PluginAPI* pluginAPI, DeviceUISet *de setAttribute(Qt::WA_DeleteOnClose, true); connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); - m_spectrumVis = new SpectrumVis(ui->glSpectrum); + m_spectrumVis = new SpectrumVis(SDR_RX_SCALEF, ui->glSpectrum); m_scopeVis = new ScopeVisNG(ui->glScope); m_spectrumScopeComboVis = new SpectrumScopeNGComboVis(m_spectrumVis, m_scopeVis); m_channelAnalyzer = (ChannelAnalyzerNG*) rxChannel; //new ChannelAnalyzerNG(m_deviceUISet->m_deviceSourceAPI); diff --git a/plugins/channelrx/demodbfm/bfmdemodgui.cpp b/plugins/channelrx/demodbfm/bfmdemodgui.cpp index 0a298aa90..fdce5b17d 100644 --- a/plugins/channelrx/demodbfm/bfmdemodgui.cpp +++ b/plugins/channelrx/demodbfm/bfmdemodgui.cpp @@ -344,7 +344,7 @@ BFMDemodGUI::BFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &))); connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); - m_spectrumVis = new SpectrumVis(ui->glSpectrum); + m_spectrumVis = new SpectrumVis(SDR_RX_SCALEF, ui->glSpectrum); m_bfmDemod = (BFMDemod*) rxChannel; //new BFMDemod(m_deviceUISet->m_deviceSourceAPI); m_bfmDemod->setMessageQueueToGUI(getInputMessageQueue()); m_bfmDemod->setSampleSink(m_spectrumVis); diff --git a/plugins/channelrx/demoddsd/dsddemodgui.cpp b/plugins/channelrx/demoddsd/dsddemodgui.cpp index bff4ce0a8..863a7ff6b 100644 --- a/plugins/channelrx/demoddsd/dsddemodgui.cpp +++ b/plugins/channelrx/demoddsd/dsddemodgui.cpp @@ -269,7 +269,7 @@ DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &))); - m_scopeVis = new ScopeVis(ui->glScope); + m_scopeVis = new ScopeVis(SDR_RX_SCALEF, ui->glScope); m_dsdDemod = (DSDDemod*) rxChannel; //new DSDDemod(m_deviceUISet->m_deviceSourceAPI); m_dsdDemod->setScopeSink(m_scopeVis); m_dsdDemod->setMessageQueueToGUI(getInputMessageQueue()); diff --git a/plugins/channelrx/demodlora/lorademodgui.cpp b/plugins/channelrx/demodlora/lorademodgui.cpp index 82dfa464d..f70abc72c 100644 --- a/plugins/channelrx/demodlora/lorademodgui.cpp +++ b/plugins/channelrx/demodlora/lorademodgui.cpp @@ -117,7 +117,7 @@ LoRaDemodGUI::LoRaDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb setAttribute(Qt::WA_DeleteOnClose, true); connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); - m_spectrumVis = new SpectrumVis(ui->glSpectrum); + m_spectrumVis = new SpectrumVis(SDR_RX_SCALEF, ui->glSpectrum); m_LoRaDemod = (LoRaDemod*) rxChannel; //new LoRaDemod(m_deviceUISet->m_deviceSourceAPI); m_LoRaDemod->setSpectrumSink(m_spectrumVis); diff --git a/plugins/channelrx/demodssb/ssbdemodgui.cpp b/plugins/channelrx/demodssb/ssbdemodgui.cpp index 9a26e88a2..e967bad44 100644 --- a/plugins/channelrx/demodssb/ssbdemodgui.cpp +++ b/plugins/channelrx/demodssb/ssbdemodgui.cpp @@ -244,7 +244,7 @@ SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &))); - m_spectrumVis = new SpectrumVis(ui->glSpectrum); + m_spectrumVis = new SpectrumVis(SDR_RX_SCALEF, ui->glSpectrum); m_ssbDemod = (SSBDemod*) rxChannel; //new SSBDemod(m_deviceUISet->m_deviceSourceAPI); m_ssbDemod->setMessageQueueToGUI(getInputMessageQueue()); m_ssbDemod->setSampleSink(m_spectrumVis); diff --git a/plugins/channelrx/tcpsrc/tcpsrcgui.cpp b/plugins/channelrx/tcpsrc/tcpsrcgui.cpp index 0f2b5fad9..5e0cc50eb 100644 --- a/plugins/channelrx/tcpsrc/tcpsrcgui.cpp +++ b/plugins/channelrx/tcpsrc/tcpsrcgui.cpp @@ -132,7 +132,7 @@ TCPSrcGUI::TCPSrcGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); setAttribute(Qt::WA_DeleteOnClose, true); - m_spectrumVis = new SpectrumVis(ui->glSpectrum); + m_spectrumVis = new SpectrumVis(SDR_RX_SCALEF, ui->glSpectrum); m_tcpSrc = (TCPSrc*) rxChannel; //new TCPSrc(m_deviceUISet->m_deviceSourceAPI); m_tcpSrc->setSpectrum(m_spectrumVis); diff --git a/plugins/channelrx/udpsrc/udpsrcgui.cpp b/plugins/channelrx/udpsrc/udpsrcgui.cpp index 48918ad19..2ec35bc8d 100644 --- a/plugins/channelrx/udpsrc/udpsrcgui.cpp +++ b/plugins/channelrx/udpsrc/udpsrcgui.cpp @@ -147,7 +147,7 @@ UDPSrcGUI::UDPSrcGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &))); setAttribute(Qt::WA_DeleteOnClose, true); - m_spectrumVis = new SpectrumVis(ui->glSpectrum); + m_spectrumVis = new SpectrumVis(SDR_RX_SCALEF, ui->glSpectrum); m_udpSrc = (UDPSrc*) rxChannel; //new UDPSrc(m_deviceUISet->m_deviceSourceAPI); m_udpSrc->setSpectrum(m_spectrumVis); diff --git a/plugins/channeltx/modssb/ssbmodgui.cpp b/plugins/channeltx/modssb/ssbmodgui.cpp index 2ba54f94c..3f093e40e 100644 --- a/plugins/channeltx/modssb/ssbmodgui.cpp +++ b/plugins/channeltx/modssb/ssbmodgui.cpp @@ -364,7 +364,7 @@ SSBModGUI::SSBModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam setAttribute(Qt::WA_DeleteOnClose, true); connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); - m_spectrumVis = new SpectrumVis(ui->glSpectrum); + m_spectrumVis = new SpectrumVis(SDR_TX_SCALEF, ui->glSpectrum); m_ssbMod = (SSBMod*) channelTx; //new SSBMod(m_deviceUISet->m_deviceSinkAPI); m_ssbMod->setSpectrumSampleSink(m_spectrumVis); m_ssbMod->setMessageQueueToGUI(getInputMessageQueue()); diff --git a/plugins/channeltx/udpsink/udpsinkgui.cpp b/plugins/channeltx/udpsink/udpsinkgui.cpp index d408c0b9b..36ef4dbbf 100644 --- a/plugins/channeltx/udpsink/udpsinkgui.cpp +++ b/plugins/channeltx/udpsink/udpsinkgui.cpp @@ -119,7 +119,7 @@ UDPSinkGUI::UDPSinkGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandS connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &))); setAttribute(Qt::WA_DeleteOnClose, true); - m_spectrumVis = new SpectrumVis(ui->glSpectrum); + m_spectrumVis = new SpectrumVis(SDR_TX_SCALEF, ui->glSpectrum); m_udpSink = (UDPSink*) channelTx; //new UDPSink(m_deviceUISet->m_deviceSinkAPI); m_udpSink->setSpectrumSink(m_spectrumVis); m_udpSink->setMessageQueueToGUI(getInputMessageQueue()); diff --git a/sdrgui/device/deviceuiset.cpp b/sdrgui/device/deviceuiset.cpp index 708e92408..d34d7a74a 100644 --- a/sdrgui/device/deviceuiset.cpp +++ b/sdrgui/device/deviceuiset.cpp @@ -35,7 +35,11 @@ DeviceUISet::DeviceUISet(int tabIndex, bool rxElseTx, QTimer& timer) { m_spectrum = new GLSpectrum; - m_spectrumVis = new SpectrumVis(m_spectrum); + if (rxElseTx) { + m_spectrumVis = new SpectrumVis(SDR_RX_SCALEF, m_spectrum); + } else { + m_spectrumVis = new SpectrumVis(SDR_TX_SCALEF, m_spectrum); + } m_spectrum->connectTimer(timer); m_spectrumGUI = new GLSpectrumGUI; m_spectrumGUI->setBuddies(m_spectrumVis->getInputMessageQueue(), m_spectrumVis, m_spectrum); diff --git a/sdrgui/dsp/scopevis.cpp b/sdrgui/dsp/scopevis.cpp index 1ee974efe..0fd0426e5 100644 --- a/sdrgui/dsp/scopevis.cpp +++ b/sdrgui/dsp/scopevis.cpp @@ -17,8 +17,9 @@ MESSAGE_CLASS_DEFINITION(ScopeVis::MsgConfigureScopeVis, Message) const uint ScopeVis::m_traceChunkSize = 4800; -ScopeVis::ScopeVis(GLScope* glScope) : +ScopeVis::ScopeVis(Real scalef, GLScope* glScope) : m_glScope(glScope), + m_scalef(scalef), m_tracebackCount(0), m_fill(0), m_triggerState(Untriggered), @@ -111,7 +112,7 @@ void ScopeVis::feed(const SampleVector::const_iterator& cbegin, const SampleVect for(int i = 0; i < count; ++i) { - *it++ = Complex(begin->real() / SDR_RX_SCALEF, begin->imag() / SDR_RX_SCALEF); + *it++ = Complex(begin->real() / m_scalef, begin->imag() / m_scalef); ++begin; } @@ -234,7 +235,7 @@ void ScopeVis::feed(const SampleVector::const_iterator& cbegin, const SampleVect for(int i = 0; i < count; ++i) { - *it++ = Complex(begin->real() / SDR_RX_SCALEF, begin->imag() / SDR_RX_SCALEF); + *it++ = Complex(begin->real() / m_scalef, begin->imag() / m_scalef); ++begin; } @@ -341,7 +342,7 @@ void ScopeVis::setSampleRate(int sampleRate) bool ScopeVis::triggerCondition(SampleVector::const_iterator& it) { - Complex c(it->real()/SDR_RX_SCALEF, it->imag()/SDR_RX_SCALEF); + Complex c(it->real()/m_scalef, it->imag()/m_scalef); m_traceback.push_back(c); // store into trace memory FIFO if (m_tracebackCount < m_traceback.size()) diff --git a/sdrgui/dsp/scopevis.h b/sdrgui/dsp/scopevis.h index 8cdfe9232..311642984 100644 --- a/sdrgui/dsp/scopevis.h +++ b/sdrgui/dsp/scopevis.h @@ -24,7 +24,7 @@ public: static const uint m_traceChunkSize; static const uint m_nbTriggers = 10; - ScopeVis(GLScope* glScope = NULL); + ScopeVis(Real scalef, GLScope* glScope = 0); virtual ~ScopeVis(); void configure(MessageQueue* msgQueue, @@ -140,6 +140,7 @@ private: }; GLScope* m_glScope; + Real m_scalef; //!< Sample scale factor from [-1,+1] to integer sample size range std::vector m_trace; //!< Raw trace to be used by GLScope boost::circular_buffer m_traceback; //!< FIFO for samples prior to triggering point to support pre-trigger (when in triggered mode) uint m_tracebackCount; //!< Count of samples stored into trace memory since triggering is active up to trace memory size diff --git a/sdrgui/dsp/scopevismulti.h b/sdrgui/dsp/scopevismulti.h index 3ae2a5e7f..a2f5af8de 100644 --- a/sdrgui/dsp/scopevismulti.h +++ b/sdrgui/dsp/scopevismulti.h @@ -560,14 +560,18 @@ private: break; case ProjectionMagLin: { - uint32_t magsq = s.m_real*s.m_real + s.m_imag*s.m_imag; - v = std::sqrt(magsq/1073741824.0f); + Real re = s.m_real / SDR_RX_SCALEF; + Real im = s.m_imag / SDR_RX_SCALEF; + Real magsq = re*re + im*im; + v = std::sqrt(magsq); } break; case ProjectionMagDB: { - uint32_t magsq = s.m_real*s.m_real + s.m_imag*s.m_imag; - v = log10f(magsq/1073741824.0f) * 10.0f; + Real re = s.m_real / SDR_RX_SCALEF; + Real im = s.m_imag / SDR_RX_SCALEF; + Real magsq = re*re + im*im; + v = log10f(magsq) * 10.0f; } break; case ProjectionPhase: diff --git a/sdrgui/dsp/scopevisng.h b/sdrgui/dsp/scopevisng.h index d31b8ce9a..c31435fc8 100644 --- a/sdrgui/dsp/scopevisng.h +++ b/sdrgui/dsp/scopevisng.h @@ -549,14 +549,18 @@ private: break; case ProjectionMagLin: { - uint32_t magsq = s.m_real*s.m_real + s.m_imag*s.m_imag; - v = std::sqrt(magsq/1073741824.0f); + Real re = s.m_real / SDR_RX_SCALEF; + Real im = s.m_imag / SDR_RX_SCALEF; + Real magsq = re*re + im*im; + v = std::sqrt(magsq); } break; case ProjectionMagDB: { - uint32_t magsq = s.m_real*s.m_real + s.m_imag*s.m_imag; - v = log10f(magsq/1073741824.0f) * 10.0f; + Real re = s.m_real / SDR_RX_SCALEF; + Real im = s.m_imag / SDR_RX_SCALEF; + Real magsq = re*re + im*im; + v = log10f(magsq) * 10.0f; } break; case ProjectionPhase: diff --git a/sdrgui/dsp/spectrumvis.cpp b/sdrgui/dsp/spectrumvis.cpp index ff1f569a1..0dc92f0d5 100644 --- a/sdrgui/dsp/spectrumvis.cpp +++ b/sdrgui/dsp/spectrumvis.cpp @@ -14,13 +14,14 @@ inline double log2f(double n) MESSAGE_CLASS_DEFINITION(SpectrumVis::MsgConfigureSpectrumVis, Message) -SpectrumVis::SpectrumVis(GLSpectrum* glSpectrum) : +SpectrumVis::SpectrumVis(Real scalef, GLSpectrum* glSpectrum) : BasebandSampleSink(), m_fft(FFTEngine::create()), m_fftBuffer(MAX_FFT_SIZE), m_logPowerSpectrum(MAX_FFT_SIZE), m_fftBufferFill(0), m_needMoreSamples(false), + m_scalef(scalef), m_glSpectrum(glSpectrum), m_mutex(QMutex::Recursive) { @@ -85,7 +86,7 @@ void SpectrumVis::feed(const SampleVector::const_iterator& cbegin, const SampleV for (std::size_t i = 0; i < samplesNeeded; ++i, ++begin) { - *it++ = Complex(begin->real() / SDR_RX_SCALEF, begin->imag() / SDR_RX_SCALEF); + *it++ = Complex(begin->real() / m_scalef, begin->imag() / m_scalef); } // apply fft window (and copy from m_fftBuffer to m_fftIn) @@ -144,7 +145,7 @@ void SpectrumVis::feed(const SampleVector::const_iterator& cbegin, const SampleV // not enough samples for FFT - just fill in new data and return for(std::vector::iterator it = m_fftBuffer.begin() + m_fftBufferFill; begin < end; ++begin) { - *it++ = Complex(begin->real() / SDR_RX_SCALEF, begin->imag() / SDR_RX_SCALEF); + *it++ = Complex(begin->real() / m_scalef, begin->imag() / m_scalef); } m_fftBufferFill += todo; diff --git a/sdrgui/dsp/spectrumvis.h b/sdrgui/dsp/spectrumvis.h index b411956a0..3f3f58ff4 100644 --- a/sdrgui/dsp/spectrumvis.h +++ b/sdrgui/dsp/spectrumvis.h @@ -35,7 +35,7 @@ public: FFTWindow::Function m_window; }; - SpectrumVis(GLSpectrum* glSpectrum = NULL); + SpectrumVis(Real scalef, GLSpectrum* glSpectrum = 0); virtual ~SpectrumVis(); void configure(MessageQueue* msgQueue, int fftSize, int overlapPercent, FFTWindow::Function window); @@ -60,6 +60,7 @@ private: std::size_t m_fftBufferFill; bool m_needMoreSamples; + Real m_scalef; GLSpectrum* m_glSpectrum; QMutex m_mutex; From 9bafb2d9b32c7e1e1a07e90be442f0ad8570926f Mon Sep 17 00:00:00 2001 From: f4exb Date: Mon, 22 Jan 2018 23:29:09 +0100 Subject: [PATCH 13/27] 24 bit DSP: document in log and Web API. Adding PID information --- app/main.cpp | 15 ++++-- appsrv/main.cpp | 23 +++++---- sdrbase/resources/index.html | 16 ++++++- sdrgui/gui/aboutdialog.cpp | 7 ++- sdrgui/gui/aboutdialog.ui | 48 +++++++++++++++---- sdrgui/mainwindow.cpp | 14 ++++-- sdrgui/webapi/webapiadaptergui.cpp | 3 ++ sdrsrv/maincore.cpp | 22 +++++---- sdrsrv/webapi/webapiadaptersrv.cpp | 7 ++- swagger/sdrangel/api/swagger/swagger.yaml | 12 +++++ swagger/sdrangel/code/html2/index.html | 16 ++++++- .../qt5/client/SWGInstanceSummaryResponse.cpp | 42 ++++++++++++++++ .../qt5/client/SWGInstanceSummaryResponse.h | 12 +++++ 13 files changed, 196 insertions(+), 41 deletions(-) diff --git a/app/main.cpp b/app/main.cpp index 7565508cd..f1f4cc56d 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -24,6 +24,7 @@ #include "loggerwithfile.h" #include "mainwindow.h" +#include "dsp/dsptypes.h" static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *logger) { @@ -95,19 +96,25 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo parser.parse(*qApp); #if QT_VERSION >= 0x050400 - qInfo("%s %s Qt %s %db %s %s", + qInfo("%s %s Qt %s %db %s %s DSP Rx:%db Tx:%db PID %lld", qPrintable(qApp->applicationName()), qPrintable(qApp->applicationVersion()), qPrintable(QString(QT_VERSION_STR)), QT_POINTER_SIZE*8, qPrintable(QSysInfo::currentCpuArchitecture()), - qPrintable(QSysInfo::prettyProductName())); + qPrintable(QSysInfo::prettyProductName()), + SDR_RX_SAMP_SZ, + SDR_TX_SAMP_SZ, + qApp->applicationPid()); #else - qInfo("%s %s Qt %s %db", + qInfo("%s %s Qt %s %db DSP Rx:%db Tx:%db PID: %lld", qPrintable(qApp->applicationName()), qPrintable((qApp->applicationVersion()), qPrintable(QString(QT_VERSION_STR)), - QT_POINTER_SIZE*8); + QT_POINTER_SIZE*8, + SDR_RX_SAMP_SZ, + SDR_TX_SAMP_SZ, + applicationPid); #endif MainWindow w(logger, parser); diff --git a/appsrv/main.cpp b/appsrv/main.cpp index ce68f1319..3cf3a05a0 100644 --- a/appsrv/main.cpp +++ b/appsrv/main.cpp @@ -25,6 +25,7 @@ #include "loggerwithfile.h" #include "maincore.h" +#include "dsp/dsptypes.h" void handler(int sig) { fprintf(stderr, "quit the application by signal(%d).\n", sig); @@ -65,19 +66,25 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo parser.parse(a); #if QT_VERSION >= 0x050400 - qInfo("%s %s Qt %s %db %s %s", - qPrintable(qApp->applicationName()), - qPrintable(qApp->applicationVersion()), + qInfo("%s %s Qt %s %db %s %s DSP Rx:%db Tx:%db PID %lld", + qPrintable(QCoreApplication::applicationName()), + qPrintable(QCoreApplication::applicationVersion()), qPrintable(QString(QT_VERSION_STR)), QT_POINTER_SIZE*8, qPrintable(QSysInfo::currentCpuArchitecture()), - qPrintable(QSysInfo::prettyProductName())); + qPrintable(QSysInfo::prettyProductName()), + SDR_RX_SAMP_SZ, + SDR_TX_SAMP_SZ, + QCoreApplication::applicationPid()); #else - qInfo("%s %s Qt %s %db", - qPrintable(qApp->applicationName()), - qPrintable((qApp->applicationVersion()), + qInfo("%s %s Qt %s %db DSP Rx:%db Tx:%db PID %lld", + qPrintable(QCoreApplication::applicationName()), + qPrintable((QCoreApplication::>applicationVersion()), qPrintable(QString(QT_VERSION_STR)), - QT_POINTER_SIZE*8); + QT_POINTER_SIZE*8, + SDR_RX_SAMP_SZ, + SDR_TX_SAMP_SZ, + QCoreApplication::applicationPid()); #endif MainCore m(logger, parser, &a); diff --git a/sdrbase/resources/index.html b/sdrbase/resources/index.html index 3fa9fbdbf..5a5f896b4 100644 --- a/sdrbase/resources/index.html +++ b/sdrbase/resources/index.html @@ -1137,7 +1137,7 @@ margin-bottom: 20px; "description" : "Summarized information about logical devices from hardware devices attached to this SDRangel instance" }; defs.InstanceSummaryResponse = { - "required" : [ "appname", "devicesetlist", "qtVersion", "version" ], + "required" : [ "appname", "devicesetlist", "dspRxBits", "dspTxBits", "pid", "qtVersion", "version" ], "properties" : { "version" : { "type" : "string", @@ -1147,6 +1147,18 @@ margin-bottom: 20px; "type" : "string", "description" : "Qt version with which the software was compiled" }, + "dspRxBits" : { + "type" : "integer", + "description" : "Number of samples significant bits in software Rx DSP" + }, + "dspTxBits" : { + "type" : "integer", + "description" : "Number of samples significant bits in software Tx DSP" + }, + "pid" : { + "type" : "integer", + "description" : "PID of the SDRangel instance" + }, "appname" : { "type" : "string", "description" : "Application name: SDRangel for a GUI instance and SDRangelSrv for a server instance" @@ -16909,7 +16921,7 @@ except ApiException as e:
- Generated 2018-01-16T19:54:59.982+01:00 + Generated 2018-01-22T23:06:33.396+01:00
diff --git a/sdrgui/gui/aboutdialog.cpp b/sdrgui/gui/aboutdialog.cpp index 80b227602..57b0f3729 100644 --- a/sdrgui/gui/aboutdialog.cpp +++ b/sdrgui/gui/aboutdialog.cpp @@ -1,5 +1,6 @@ #include "gui/aboutdialog.h" #include "ui_aboutdialog.h" +#include "dsp/dsptypes.h" AboutDialog::AboutDialog(const QString& apiHost, int apiPort, QWidget* parent) : QDialog(parent), @@ -8,7 +9,11 @@ AboutDialog::AboutDialog(const QString& apiHost, int apiPort, QWidget* parent) : ui->setupUi(this); ui->version->setText(QString("Version %1 - Copyright (C) 2015-2018 Edouard Griffiths, F4EXB.").arg(qApp->applicationVersion())); ui->build->setText(QString("Build info: Qt %1 %2 bits").arg(QT_VERSION_STR).arg(QT_POINTER_SIZE*8)); - ui->restApiUrl->setText(QString("REST API base URL: http://%1:%2/sdrangel").arg(apiHost).arg(apiPort)); + ui->dspBits->setText(QString("DSP Rx %1 bits Tx %2 bits").arg(SDR_RX_SAMP_SZ).arg(SDR_TX_SAMP_SZ)); + ui->pid->setText(QString("PID: %1").arg(qApp->applicationPid())); + QString apiUrl = QString("http://%1:%2/sdrangel").arg(apiHost).arg(apiPort); + ui->restApiUrl->setText(QString("REST API base URL: %2").arg(apiUrl).arg(apiUrl)); + ui->restApiUrl->setOpenExternalLinks(true); } AboutDialog::~AboutDialog() diff --git a/sdrgui/gui/aboutdialog.ui b/sdrgui/gui/aboutdialog.ui index a09acee10..086bc56e0 100644 --- a/sdrgui/gui/aboutdialog.ui +++ b/sdrgui/gui/aboutdialog.ui @@ -89,18 +89,46 @@ - - - Here goes the build info - - + + + + + Here goes the build info + + + + + + + DSP Rx 24 bits Tx 16 bits + + + + - - - Here goes the REST API URL - - + + + + + Here goes the REST API URL + + + + + + + + 80 + 16777215 + + + + PID: 00000 + + + + diff --git a/sdrgui/mainwindow.cpp b/sdrgui/mainwindow.cpp index 428006433..017c0cb07 100644 --- a/sdrgui/mainwindow.cpp +++ b/sdrgui/mainwindow.cpp @@ -1731,19 +1731,25 @@ void MainWindow::setLoggingOptions() if (m_settings.getUseLogFile()) { #if QT_VERSION >= 0x050400 - QString appInfoStr(tr("%1 %2 Qt %3 %4b %5 %6") + QString appInfoStr(tr("%1 %2 Qt %3 %4b %5 %6 DSP Rx:%7b Tx:%8b PID %9") .arg(qApp->applicationName()) .arg(qApp->applicationVersion()) .arg(QT_VERSION_STR) .arg(QT_POINTER_SIZE*8) .arg(QSysInfo::currentCpuArchitecture()) - .arg(QSysInfo::prettyProductName())); + .arg(QSysInfo::prettyProductName()) + .arg(SDR_RX_SAMP_SZ) + .arg(SDR_TX_SAMP_SZ) + .arg(qApp->applicationPid())); #else - QString appInfoStr(tr("%1 %2 Qt %3 %4b") + QString appInfoStr(tr("%1 %2 Qt %3 %4b DSP Rx:%5b Tx:%6b PID %7") .arg(qApp->applicationName()) .arg(qApp->applicationVersion()) .arg(QT_VERSION_STR) - .arg(QT_POINTER_SIZE*8)); + .arg(QT_POINTER_SIZE*8) + .arg(SDR_RX_SAMP_SZ) + .arg(SDR_TX_SAMP_SZ) + .arg(qApp->applicationPid())); #endif m_logger->logToFile(QtInfoMsg, appInfoStr); } diff --git a/sdrgui/webapi/webapiadaptergui.cpp b/sdrgui/webapi/webapiadaptergui.cpp index d8ed6b395..016d7b0c6 100644 --- a/sdrgui/webapi/webapiadaptergui.cpp +++ b/sdrgui/webapi/webapiadaptergui.cpp @@ -76,6 +76,9 @@ int WebAPIAdapterGUI::instanceSummary( *response.getAppname() = qApp->applicationName(); *response.getVersion() = qApp->applicationVersion(); *response.getQtVersion() = QString(QT_VERSION_STR); + response.setDspRxBits(SDR_RX_SAMP_SZ); + response.setDspTxBits(SDR_TX_SAMP_SZ); + response.setPid(qApp->applicationPid()); #if QT_VERSION >= 0x050400 *response.getArchitecture() = QString(QSysInfo::currentCpuArchitecture()); *response.getOs() = QString(QSysInfo::prettyProductName()); diff --git a/sdrsrv/maincore.cpp b/sdrsrv/maincore.cpp index 13e724aea..bae083d60 100644 --- a/sdrsrv/maincore.cpp +++ b/sdrsrv/maincore.cpp @@ -221,19 +221,25 @@ void MainCore::setLoggingOptions() if (m_settings.getUseLogFile()) { #if QT_VERSION >= 0x050400 - QString appInfoStr(tr("%1 %2 Qt %3 %4b %5 %6") - .arg(qApp->applicationName()) - .arg(qApp->applicationVersion()) + QString appInfoStr(tr("%1 %2 Qt %3 %4b %5 %6 DSP Rx:%7b Tx:%8b PID %9") + .arg(QCoreApplication::applicationName()) + .arg(QCoreApplication::applicationVersion()) .arg(QT_VERSION_STR) .arg(QT_POINTER_SIZE*8) .arg(QSysInfo::currentCpuArchitecture()) - .arg(QSysInfo::prettyProductName())); + .arg(QSysInfo::prettyProductName()) + .arg(SDR_RX_SAMP_SZ) + .arg(SDR_TX_SAMP_SZ) + .arg(QCoreApplication::applicationPid())); #else - QString appInfoStr(tr("%1 %2 Qt %3 %4b") - .arg(qApp->applicationName()) - .arg(qApp->applicationVersion()) + QString appInfoStr(tr("%1 %2 Qt %3 %4b DSP Rx:%5b Tx:%6b PID %7") + .arg(QCoreApplication::applicationName()) + .arg(QCoreApplication::applicationVersion()) .arg(QT_VERSION_STR) - .arg(QT_POINTER_SIZE*8)); + .arg(QT_POINTER_SIZE*8) + .arg(SDR_RX_SAMP_SZ) + .arg(SDR_RX_SAMP_SZ) + .arg(QCoreApplication::applicationPid()); #endif m_logger->logToFile(QtInfoMsg, appInfoStr); } diff --git a/sdrsrv/webapi/webapiadaptersrv.cpp b/sdrsrv/webapi/webapiadaptersrv.cpp index 606abac67..cbffcdad6 100644 --- a/sdrsrv/webapi/webapiadaptersrv.cpp +++ b/sdrsrv/webapi/webapiadaptersrv.cpp @@ -69,9 +69,12 @@ int WebAPIAdapterSrv::instanceSummary( SWGSDRangel::SWGErrorResponse& error __attribute__((unused))) { - *response.getAppname() = QCoreApplication::instance()->applicationName(); - *response.getVersion() = QCoreApplication::instance()->applicationVersion(); + *response.getAppname() = QCoreApplication::applicationName(); + *response.getVersion() = QCoreApplication::applicationVersion(); *response.getQtVersion() = QString(QT_VERSION_STR); + response.setDspRxBits(SDR_RX_SAMP_SZ); + response.setDspTxBits(SDR_TX_SAMP_SZ); + response.setPid(QCoreApplication::applicationPid()); #if QT_VERSION >= 0x050400 *response.getArchitecture() = QString(QSysInfo::currentCpuArchitecture()); *response.getOs() = QString(QSysInfo::prettyProductName()); diff --git a/swagger/sdrangel/api/swagger/swagger.yaml b/swagger/sdrangel/api/swagger/swagger.yaml index 65b6fb9b2..3e3191f8f 100644 --- a/swagger/sdrangel/api/swagger/swagger.yaml +++ b/swagger/sdrangel/api/swagger/swagger.yaml @@ -1010,6 +1010,9 @@ definitions: required: - version - qtVersion + - dspRxBits + - dspTxBits + - pid - appname - devicesetlist properties: @@ -1019,6 +1022,15 @@ definitions: qtVersion: description: "Qt version with which the software was compiled" type: string + dspRxBits: + description: "Number of samples significant bits in software Rx DSP" + type: integer + dspTxBits: + description: "Number of samples significant bits in software Tx DSP" + type: integer + pid: + description: "PID of the SDRangel instance" + type: integer appname: description: "Application name: SDRangel for a GUI instance and SDRangelSrv for a server instance" type: string diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index 3fa9fbdbf..5a5f896b4 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -1137,7 +1137,7 @@ margin-bottom: 20px; "description" : "Summarized information about logical devices from hardware devices attached to this SDRangel instance" }; defs.InstanceSummaryResponse = { - "required" : [ "appname", "devicesetlist", "qtVersion", "version" ], + "required" : [ "appname", "devicesetlist", "dspRxBits", "dspTxBits", "pid", "qtVersion", "version" ], "properties" : { "version" : { "type" : "string", @@ -1147,6 +1147,18 @@ margin-bottom: 20px; "type" : "string", "description" : "Qt version with which the software was compiled" }, + "dspRxBits" : { + "type" : "integer", + "description" : "Number of samples significant bits in software Rx DSP" + }, + "dspTxBits" : { + "type" : "integer", + "description" : "Number of samples significant bits in software Tx DSP" + }, + "pid" : { + "type" : "integer", + "description" : "PID of the SDRangel instance" + }, "appname" : { "type" : "string", "description" : "Application name: SDRangel for a GUI instance and SDRangelSrv for a server instance" @@ -16909,7 +16921,7 @@ except ApiException as e:
- Generated 2018-01-16T19:54:59.982+01:00 + Generated 2018-01-22T23:06:33.396+01:00
diff --git a/swagger/sdrangel/code/qt5/client/SWGInstanceSummaryResponse.cpp b/swagger/sdrangel/code/qt5/client/SWGInstanceSummaryResponse.cpp index ffb0441e7..76af23bcb 100644 --- a/swagger/sdrangel/code/qt5/client/SWGInstanceSummaryResponse.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGInstanceSummaryResponse.cpp @@ -39,6 +39,9 @@ void SWGInstanceSummaryResponse::init() { version = new QString(""); qt_version = new QString(""); + dsp_rx_bits = 0; + dsp_tx_bits = 0; + pid = 0; appname = new QString(""); architecture = new QString(""); os = new QString(""); @@ -57,6 +60,9 @@ SWGInstanceSummaryResponse::cleanup() { delete qt_version; } + + + if(appname != nullptr) { delete appname; } @@ -91,6 +97,9 @@ void SWGInstanceSummaryResponse::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&version, pJson["version"], "QString", "QString"); ::SWGSDRangel::setValue(&qt_version, pJson["qtVersion"], "QString", "QString"); + ::SWGSDRangel::setValue(&dsp_rx_bits, pJson["dspRxBits"], "qint32", ""); + ::SWGSDRangel::setValue(&dsp_tx_bits, pJson["dspTxBits"], "qint32", ""); + ::SWGSDRangel::setValue(&pid, pJson["pid"], "qint32", ""); ::SWGSDRangel::setValue(&appname, pJson["appname"], "QString", "QString"); ::SWGSDRangel::setValue(&architecture, pJson["architecture"], "QString", "QString"); ::SWGSDRangel::setValue(&os, pJson["os"], "QString", "QString"); @@ -116,6 +125,12 @@ SWGInstanceSummaryResponse::asJsonObject() { toJsonValue(QString("qtVersion"), qt_version, obj, QString("QString")); + obj->insert("dspRxBits", QJsonValue(dsp_rx_bits)); + + obj->insert("dspTxBits", QJsonValue(dsp_tx_bits)); + + obj->insert("pid", QJsonValue(pid)); + toJsonValue(QString("appname"), appname, obj, QString("QString")); toJsonValue(QString("architecture"), architecture, obj, QString("QString")); @@ -147,6 +162,33 @@ SWGInstanceSummaryResponse::setQtVersion(QString* qt_version) { this->qt_version = qt_version; } +qint32 +SWGInstanceSummaryResponse::getDspRxBits() { + return dsp_rx_bits; +} +void +SWGInstanceSummaryResponse::setDspRxBits(qint32 dsp_rx_bits) { + this->dsp_rx_bits = dsp_rx_bits; +} + +qint32 +SWGInstanceSummaryResponse::getDspTxBits() { + return dsp_tx_bits; +} +void +SWGInstanceSummaryResponse::setDspTxBits(qint32 dsp_tx_bits) { + this->dsp_tx_bits = dsp_tx_bits; +} + +qint32 +SWGInstanceSummaryResponse::getPid() { + return pid; +} +void +SWGInstanceSummaryResponse::setPid(qint32 pid) { + this->pid = pid; +} + QString* SWGInstanceSummaryResponse::getAppname() { return appname; diff --git a/swagger/sdrangel/code/qt5/client/SWGInstanceSummaryResponse.h b/swagger/sdrangel/code/qt5/client/SWGInstanceSummaryResponse.h index b644fbe85..3fff4b4fb 100644 --- a/swagger/sdrangel/code/qt5/client/SWGInstanceSummaryResponse.h +++ b/swagger/sdrangel/code/qt5/client/SWGInstanceSummaryResponse.h @@ -50,6 +50,15 @@ public: QString* getQtVersion(); void setQtVersion(QString* qt_version); + qint32 getDspRxBits(); + void setDspRxBits(qint32 dsp_rx_bits); + + qint32 getDspTxBits(); + void setDspTxBits(qint32 dsp_tx_bits); + + qint32 getPid(); + void setPid(qint32 pid); + QString* getAppname(); void setAppname(QString* appname); @@ -69,6 +78,9 @@ public: private: QString* version; QString* qt_version; + qint32 dsp_rx_bits; + qint32 dsp_tx_bits; + qint32 pid; QString* appname; QString* architecture; QString* os; From 4448b57b6027a552c4b955fb389e558804f79ce5 Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 23 Jan 2018 00:07:38 +0100 Subject: [PATCH 14/27] SDRDaemon input: differentiate SDRdaemon samples struct from internal DSP sample struct --- .../samplesource/sdrdaemonsource/sdrdaemonsourcebuffer.cpp | 2 +- .../samplesource/sdrdaemonsource/sdrdaemonsourcebuffer.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/samplesource/sdrdaemonsource/sdrdaemonsourcebuffer.cpp b/plugins/samplesource/sdrdaemonsource/sdrdaemonsourcebuffer.cpp index b2d375237..1ab67e08c 100644 --- a/plugins/samplesource/sdrdaemonsource/sdrdaemonsourcebuffer.cpp +++ b/plugins/samplesource/sdrdaemonsource/sdrdaemonsourcebuffer.cpp @@ -174,7 +174,7 @@ void SDRdaemonSourceBuffer::checkSlotData(int slotIndex) if (sampleRate > 0) { int64_t ts = m_currentMeta.m_tv_sec * 1000000LL + m_currentMeta.m_tv_usec; - ts -= (rwDelayBytes * 1000000LL) / (sampleRate * sizeof(Sample)); + ts -= (rwDelayBytes * 1000000LL) / (sampleRate * sizeof(SDRdaemonSample)); m_tvOut_sec = ts / 1000000LL; m_tvOut_usec = ts - (m_tvOut_sec * 1000000LL); } diff --git a/plugins/samplesource/sdrdaemonsource/sdrdaemonsourcebuffer.h b/plugins/samplesource/sdrdaemonsource/sdrdaemonsourcebuffer.h index dab6d5aa3..5613ecac0 100644 --- a/plugins/samplesource/sdrdaemonsource/sdrdaemonsourcebuffer.h +++ b/plugins/samplesource/sdrdaemonsource/sdrdaemonsourcebuffer.h @@ -55,7 +55,7 @@ public: } }; - struct Sample + struct SDRdaemonSample { int16_t i; int16_t q; @@ -68,12 +68,12 @@ public: uint8_t filler; }; - static const int samplesPerBlock = (SDRDAEMONSOURCE_UDPSIZE - sizeof(Header)) / sizeof(Sample); + static const int samplesPerBlock = (SDRDAEMONSOURCE_UDPSIZE - sizeof(Header)) / sizeof(SDRdaemonSample); static const int framesSize = SDRDAEMONSOURCE_NBDECODERSLOTS * (SDRDAEMONSOURCE_NBORIGINALBLOCKS - 1) * (SDRDAEMONSOURCE_UDPSIZE - sizeof(Header)); struct ProtectedBlock { - Sample samples[samplesPerBlock]; + SDRdaemonSample samples[samplesPerBlock]; }; struct SuperBlock From 3d77c9af9bce72d52c19f7d1b1982fbc1bd6cd89 Mon Sep 17 00:00:00 2001 From: f4exb Date: Wed, 24 Jan 2018 08:49:18 +0100 Subject: [PATCH 15/27] SDRDaemon input: adaptation for 24 bit Rx DSP --- .../sdrdaemonsourceudphandler.cpp | 32 +++++++++++++++++-- .../sdrdaemonsourceudphandler.h | 2 ++ sdrbase/dsp/samplesinkfifo.cpp | 4 +-- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/plugins/samplesource/sdrdaemonsource/sdrdaemonsourceudphandler.cpp b/plugins/samplesource/sdrdaemonsource/sdrdaemonsourceudphandler.cpp index e9120f1e8..1330b077c 100644 --- a/plugins/samplesource/sdrdaemonsource/sdrdaemonsourceudphandler.cpp +++ b/plugins/samplesource/sdrdaemonsource/sdrdaemonsourceudphandler.cpp @@ -51,6 +51,8 @@ SDRdaemonSourceUDPHandler::SDRdaemonSourceUDPHandler(SampleSinkFifo *sampleFifo, m_throttlems(SDRDAEMONSOURCE_THROTTLE_MS), m_readLengthSamples(0), m_readLength(0), + m_converterBuffer(0), + m_converterBufferNbSamples(0), m_throttleToggle(false), m_rateDivider(1000/SDRDAEMONSOURCE_THROTTLE_MS), m_autoCorrBuffer(true) @@ -72,6 +74,7 @@ SDRdaemonSourceUDPHandler::~SDRdaemonSourceUDPHandler() { stop(); delete[] m_udpBuf; + if (m_converterBuffer) { delete[] m_converterBuffer; } #ifdef USE_INTERNAL_TIMER if (m_timer) { delete m_timer; @@ -263,9 +266,32 @@ void SDRdaemonSourceUDPHandler::tick() m_readLength = m_readLengthSamples * SDRdaemonSourceBuffer::m_iqSampleSize; - // read samples directly feeding the SampleFifo (no callback) - m_sampleFifo->write(reinterpret_cast(m_sdrDaemonBuffer.readData(m_readLength)), m_readLength); - m_samplesCount += m_readLengthSamples; + if (SDR_RX_SAMP_SZ == 16) + { + // read samples directly feeding the SampleFifo (no callback) + m_sampleFifo->write(reinterpret_cast(m_sdrDaemonBuffer.readData(m_readLength)), m_readLength); + m_samplesCount += m_readLengthSamples; + } + else if (SDR_RX_SAMP_SZ == 24) + { + if (m_readLengthSamples > m_converterBufferNbSamples) + { + if (m_converterBuffer) { delete[] m_converterBuffer; } + m_converterBuffer = new int32_t[m_readLengthSamples*2]; + } + + uint8_t *buf = m_sdrDaemonBuffer.readData(m_readLength); + + for (unsigned int is = 0; is < m_readLengthSamples; is++) + { + m_converterBuffer[2*is] = ((int16_t*)buf)[2*is]; + m_converterBuffer[2*is]<<=8; + m_converterBuffer[2*is+1] = ((int16_t*)buf)[2*is+1]; + m_converterBuffer[2*is+1]<<=8; + } + + m_sampleFifo->write(reinterpret_cast(m_converterBuffer), m_readLengthSamples*4*2); + } if (m_tickCount < m_rateDivider) { diff --git a/plugins/samplesource/sdrdaemonsource/sdrdaemonsourceudphandler.h b/plugins/samplesource/sdrdaemonsource/sdrdaemonsourceudphandler.h index 8a96e6978..0f686329a 100644 --- a/plugins/samplesource/sdrdaemonsource/sdrdaemonsourceudphandler.h +++ b/plugins/samplesource/sdrdaemonsource/sdrdaemonsourceudphandler.h @@ -77,6 +77,8 @@ private: int m_throttlems; uint32_t m_readLengthSamples; uint32_t m_readLength; + int32_t *m_converterBuffer; + uint32_t m_converterBufferNbSamples; bool m_throttleToggle; uint32_t m_rateDivider; bool m_autoCorrBuffer; diff --git a/sdrbase/dsp/samplesinkfifo.cpp b/sdrbase/dsp/samplesinkfifo.cpp index f76998d2e..e60cc2c8c 100644 --- a/sdrbase/dsp/samplesinkfifo.cpp +++ b/sdrbase/dsp/samplesinkfifo.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2012 maintech GmbH, Otto-Hahn-Str. 15, 97204 Hoechberg, Germany // + // Copyright (C) 2012 maintech GmbH, Otto-Hahn-Str. 15, 97204 Hoechberg, Germany // // written by Christian Daniel // // // // This program is free software; you can redistribute it and/or modify // @@ -74,7 +74,7 @@ uint SampleSinkFifo::write(const quint8* data, uint count) uint remaining; uint len; const Sample* begin = (const Sample*)data; - count /= 4; + count /= sizeof(Sample); total = MIN(count, m_size - m_fill); if(total < count) { From 4a442e97e7f0a014ed2dbdf8a4cc5e77d38b311a Mon Sep 17 00:00:00 2001 From: f4exb Date: Wed, 24 Jan 2018 18:17:13 +0100 Subject: [PATCH 16/27] Web API: re-organize online documentation and integrate Swagger-UI --- sdrbase/resources/res.qrc | 26 +- .../{ => webapi/doc/html2}/index.html | 0 .../webapi/doc/swagger-ui/favicon-16x16.png | Bin 0 -> 445 bytes .../webapi/doc/swagger-ui/favicon-32x32.png | Bin 0 -> 1141 bytes .../webapi/doc/swagger-ui/index.html | 96 ++ .../doc/swagger-ui/oauth2-redirect.html | 60 + .../doc/swagger-ui/swagger-ui-bundle.js | 99 ++ .../doc/swagger-ui/swagger-ui-bundle.js.map | 1 + .../swagger-ui-standalone-preset.js | 13 + .../swagger-ui-standalone-preset.js.map | 1 + .../webapi/doc/swagger-ui/swagger-ui.css | 2 + .../webapi/doc/swagger-ui/swagger-ui.css.map | 1 + .../webapi/doc/swagger-ui/swagger-ui.js | 8 + .../webapi/doc/swagger-ui/swagger-ui.js.map | 1 + .../webapi/doc/swagger/include/CWKeyer.yaml | 12 + .../doc/swagger/include/FileSource.yaml | 5 + .../webapi/doc/swagger/include/HackRF.yaml | 52 + .../webapi/doc/swagger/include/LimeSdr.yaml | 74 + .../webapi/doc/swagger/include/NFMDemod.yaml | 43 + .../webapi/doc/swagger/include/NFMMod.yaml | 40 + .../webapi/doc/swagger/include/RtlSdr.yaml | 34 + .../webapi/doc/swagger/include/User.yaml | 9 + .../resources/webapi/doc/swagger/swagger.yaml | 1529 +++++++++++++++++ sdrbase/resources/webapi/index.html | 52 + sdrbase/resources/webapi/sdrangel_logo.png | Bin 0 -> 73272 bytes sdrbase/webapi/webapirequestmapper.cpp | 10 +- sdrgui/gui/aboutdialog.cpp | 4 +- swagger/sdrangel/generate.sh | 4 +- 28 files changed, 2165 insertions(+), 11 deletions(-) rename sdrbase/resources/{ => webapi/doc/html2}/index.html (100%) create mode 100644 sdrbase/resources/webapi/doc/swagger-ui/favicon-16x16.png create mode 100644 sdrbase/resources/webapi/doc/swagger-ui/favicon-32x32.png create mode 100644 sdrbase/resources/webapi/doc/swagger-ui/index.html create mode 100644 sdrbase/resources/webapi/doc/swagger-ui/oauth2-redirect.html create mode 100644 sdrbase/resources/webapi/doc/swagger-ui/swagger-ui-bundle.js create mode 100644 sdrbase/resources/webapi/doc/swagger-ui/swagger-ui-bundle.js.map create mode 100644 sdrbase/resources/webapi/doc/swagger-ui/swagger-ui-standalone-preset.js create mode 100644 sdrbase/resources/webapi/doc/swagger-ui/swagger-ui-standalone-preset.js.map create mode 100644 sdrbase/resources/webapi/doc/swagger-ui/swagger-ui.css create mode 100644 sdrbase/resources/webapi/doc/swagger-ui/swagger-ui.css.map create mode 100644 sdrbase/resources/webapi/doc/swagger-ui/swagger-ui.js create mode 100644 sdrbase/resources/webapi/doc/swagger-ui/swagger-ui.js.map create mode 100644 sdrbase/resources/webapi/doc/swagger/include/CWKeyer.yaml create mode 100644 sdrbase/resources/webapi/doc/swagger/include/FileSource.yaml create mode 100644 sdrbase/resources/webapi/doc/swagger/include/HackRF.yaml create mode 100644 sdrbase/resources/webapi/doc/swagger/include/LimeSdr.yaml create mode 100644 sdrbase/resources/webapi/doc/swagger/include/NFMDemod.yaml create mode 100644 sdrbase/resources/webapi/doc/swagger/include/NFMMod.yaml create mode 100644 sdrbase/resources/webapi/doc/swagger/include/RtlSdr.yaml create mode 100644 sdrbase/resources/webapi/doc/swagger/include/User.yaml create mode 100644 sdrbase/resources/webapi/doc/swagger/swagger.yaml create mode 100644 sdrbase/resources/webapi/index.html create mode 100644 sdrbase/resources/webapi/sdrangel_logo.png diff --git a/sdrbase/resources/res.qrc b/sdrbase/resources/res.qrc index e1d46c714..694ecf84a 100644 --- a/sdrbase/resources/res.qrc +++ b/sdrbase/resources/res.qrc @@ -1,5 +1,27 @@ - index.html + webapi/doc/html2/index.html + webapi/doc/swagger/swagger.yaml + webapi/doc/swagger/include/CWKeyer.yaml + webapi/doc/swagger/include/FileSource.yaml + webapi/doc/swagger/include/HackRF.yaml + webapi/doc/swagger/include/LimeSdr.yaml + webapi/doc/swagger/include/NFMDemod.yaml + webapi/doc/swagger/include/NFMMod.yaml + webapi/doc/swagger/include/RtlSdr.yaml + webapi/doc/swagger-ui/swagger-ui.js.map + webapi/doc/swagger-ui/swagger-ui.js + webapi/doc/swagger-ui/swagger-ui.css.map + webapi/doc/swagger-ui/swagger-ui.css + webapi/doc/swagger-ui/swagger-ui-standalone-preset.js.map + webapi/doc/swagger-ui/swagger-ui-standalone-preset.js + webapi/doc/swagger-ui/swagger-ui-bundle.js.map + webapi/doc/swagger-ui/swagger-ui-bundle.js + webapi/doc/swagger-ui/oauth2-redirect.html + webapi/doc/swagger-ui/index.html + webapi/doc/swagger-ui/favicon-32x32.png + webapi/doc/swagger-ui/favicon-16x16.png + webapi/index.html + webapi/sdrangel_logo.png - \ No newline at end of file + diff --git a/sdrbase/resources/index.html b/sdrbase/resources/webapi/doc/html2/index.html similarity index 100% rename from sdrbase/resources/index.html rename to sdrbase/resources/webapi/doc/html2/index.html diff --git a/sdrbase/resources/webapi/doc/swagger-ui/favicon-16x16.png b/sdrbase/resources/webapi/doc/swagger-ui/favicon-16x16.png new file mode 100644 index 0000000000000000000000000000000000000000..0f7e13b0d9903d27a9129950b1dad362361504e4 GIT binary patch literal 445 zcmV;u0Yd(XP)rNm2=6wQ7&2F}_`h_PI>(9Fx!5<0%l6W{u0OQ#*rglqx3__&vD?|#%fhn*Mn&YY1i+JQHqPvZ34FR@_E%P@x zzTL;Bw#nJXWY}D7^bC>-bx{t|^|R6Oci&MKvov8Op~S=}R=h^p-=vZ0uqG@LE6tP7 n92{cY$^db6>&z__iT?Z#Z8BG|DVcT0DjiaEd>Z!7_`J}8! zKk_$1lGm$vJOY&DjT-(&VGn0;R`iN9=1aOuG`H}BlY>&R3KbGER zB2$7euhH;y1C_LTQex%L6khZpkjFn!ajOUK)f3JLz+I;CE@(N)T)CM4AWjfl-(04= zrsMQ)#NG6nr^Y7!6LA;iHXh?UOFE%hhy>7dl=;I$J>g0BH_r|_4ctEsXx z2sDIQnwa*rcK=*3XUC$D{I@}DTNs@GCb7dB2%%nV%jR){xktt;Ah09op7x@l5D6B2 z0uBdt0YmcN!o?lMpu9Io(1&B1s{TUu*a>2&>Iycx__fbDRM8PYtLt+#G*xSt(cn}K zt!~W2{`9r)xkh^xodLS&FbYw`x$t&Vhl?)#f&k-lZIs<`$gTj{^#^HewuJz(WnUZZ z{Ty_aE;^93bhc-^^k6ZM!^e~$q5!Zz`XPta{a@651gPzaFx$&%IHL6hx$mSeAa#n6 zLkyc-M zs$qhBZhCNE^aIEV)H_~^IeqSRnvo!21Qc`Z;S9!IqXl4K(RUImejotzuG65LVuGS# zcqp@OA8~ln^4c^VihUew)IOX^E9KMtvSvnZ| zC@rl{f(B*PA26aFR`|X!!I(7x_|kq{rlqwhCia+CfNbOg_yYt0bDCc4g#h#`3jpCd zNAhr%4#Ye{i>ni$fzY%r0IS%l3HHZ4tTjOi=JW-t_iG~)oC!2C!52Cc|TAPaH zJ}l%m9yPmA-4#lJea@uf$a`(1;={rL2f*8;7%icbF}e^_`X#ndU=SI0nIn8hXPXHS zSN4rbF}jl0HWx(_`q`-SRa9jP8Ab!}sThNkQ634k=qXBVM4`o{M>qrLJD ze*%D)S;wpxG$d%FcDf-6%zMqWA+gw!C1~T5+|ys$G3Ksm&x59Lyd?0l+LWSk6hc4~ z+yC>|4f;X3#cq3!)>#Mvb-^co7LMrzqWeKB$21I>tJgaGFwu6eB%&j?@d*8GAx~In zI1p-lXVKtcvY7;$TX~wjYw|QhB%q!npQES%F~%Aqz~pJB%rNu!xAj;>xZt75!VHju zfFy%B-`3;Qf<{h94~I62zcHv}D5pS-QCN`M8K1>jN9mpbrFk=5no8j!00000NkvXX Hu0mjfOavUK literal 0 HcmV?d00001 diff --git a/sdrbase/resources/webapi/doc/swagger-ui/index.html b/sdrbase/resources/webapi/doc/swagger-ui/index.html new file mode 100644 index 000000000..efbe9d6eb --- /dev/null +++ b/sdrbase/resources/webapi/doc/swagger-ui/index.html @@ -0,0 +1,96 @@ + + + + + + Swagger UI + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + diff --git a/sdrbase/resources/webapi/doc/swagger-ui/oauth2-redirect.html b/sdrbase/resources/webapi/doc/swagger-ui/oauth2-redirect.html new file mode 100644 index 000000000..eb00dc686 --- /dev/null +++ b/sdrbase/resources/webapi/doc/swagger-ui/oauth2-redirect.html @@ -0,0 +1,60 @@ + + + + + + diff --git a/sdrbase/resources/webapi/doc/swagger-ui/swagger-ui-bundle.js b/sdrbase/resources/webapi/doc/swagger-ui/swagger-ui-bundle.js new file mode 100644 index 000000000..a9a9fdb18 --- /dev/null +++ b/sdrbase/resources/webapi/doc/swagger-ui/swagger-ui-bundle.js @@ -0,0 +1,99 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SwaggerUIBundle=t():e.SwaggerUIBundle=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist",t(t.s=1213)}([function(e,t,n){"use strict";e.exports=n(92)},function(e,t,n){e.exports=n(995)()},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(331),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(){function e(e,t){for(var n=0;n>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?d(e)+t:t}function v(){return!0}function g(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function y(e,t){return b(e,t,0)}function _(e,t){return b(e,t,t)}function b(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}function x(e){this.next=e}function w(e,t,n,r){var i=0===e?t:1===e?n:[t,n];return r?r.value=i:r={value:i,done:!1},r}function k(){return{value:void 0,done:!0}}function E(e){return!!A(e)}function S(e){return e&&"function"==typeof e.next}function C(e){var t=A(e);return t&&t.call(e)}function A(e){var t=e&&(wn&&e[wn]||e[kn]);if("function"==typeof t)return t}function D(e){return e&&"number"==typeof e.length}function O(e){return null===e||void 0===e?B():o(e)?e.toSeq():z(e)}function M(e){return null===e||void 0===e?B().toKeyedSeq():o(e)?a(e)?e.toSeq():e.fromEntrySeq():L(e)}function T(e){return null===e||void 0===e?B():o(e)?a(e)?e.entrySeq():e.toIndexedSeq():q(e)}function P(e){return(null===e||void 0===e?B():o(e)?a(e)?e.entrySeq():e:q(e)).toSetSeq()}function I(e){this._array=e,this.size=e.length}function R(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function j(e){this._iterable=e,this.size=e.length||e.size}function F(e){this._iterator=e,this._iteratorCache=[]}function N(e){return!(!e||!e[Sn])}function B(){return Cn||(Cn=new I([]))}function L(e){var t=Array.isArray(e)?new I(e).fromEntrySeq():S(e)?new F(e).fromEntrySeq():E(e)?new j(e).fromEntrySeq():"object"==typeof e?new R(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function q(e){var t=U(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function z(e){var t=U(e)||"object"==typeof e&&new R(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}function U(e){return D(e)?new I(e):S(e)?new F(e):E(e)?new j(e):void 0}function W(e,t,n,r){var i=e._cache;if(i){for(var o=i.length-1,a=0;a<=o;a++){var s=i[n?o-a:a];if(!1===t(s[1],r?s[0]:a,e))return a+1}return a}return e.__iterateUncached(t,n)}function V(e,t,n,r){var i=e._cache;if(i){var o=i.length-1,a=0;return new x(function(){var e=i[n?o-a:a];return a++>o?k():w(t,r?e[0]:a-1,e[1])})}return e.__iteratorUncached(t,n)}function H(e,t){return t?G(t,e,"",{"":e}):J(e)}function G(e,t,n,r){return Array.isArray(t)?e.call(r,n,T(t).map(function(n,r){return G(e,n,r,t)})):K(t)?e.call(r,n,M(t).map(function(n,r){return G(e,n,r,t)})):t}function J(e){return Array.isArray(e)?T(e).map(J).toList():K(e)?M(e).map(J).toMap():e}function K(e){return e&&(e.constructor===Object||void 0===e.constructor)}function X(e,t){if(e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if(e=e.valueOf(),t=t.valueOf(),e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function Y(e,t){if(e===t)return!0;if(!o(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||a(e)!==a(t)||s(e)!==s(t)||l(e)!==l(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!u(e);if(l(e)){var r=e.entries();return t.every(function(e,t){var i=r.next().value;return i&&X(i[1],e)&&(n||X(i[0],t))})&&r.next().done}var i=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{i=!0;var c=e;e=t,t=c}var p=!0,f=t.__iterate(function(t,r){if(n?!e.has(t):i?!X(t,e.get(r,vn)):!X(e.get(r,vn),t))return p=!1,!1});return p&&e.size===f}function $(e,t){if(!(this instanceof $))return new $(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(An)return An;An=this}}function Z(e,t){if(!e)throw new Error(t)}function Q(e,t,n){if(!(this instanceof Q))return new Q(e,t,n);if(Z(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),n=void 0===n?1:Math.abs(n),t>>1&1073741824|3221225471&e}function oe(e){if(!1===e||null===e||void 0===e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null===e||void 0===e))return 0;if(!0===e)return 1;var t=typeof e;if("number"===t){if(e!==e||e===1/0)return 0;var n=0|e;for(n!==e&&(n^=4294967295*e);e>4294967295;)e/=4294967295,n^=e;return ie(n)}if("string"===t)return e.length>Fn?ae(e):se(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return ue(e);if("function"==typeof e.toString)return se(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function ae(e){var t=Ln[e];return void 0===t&&(t=se(e),Bn===Nn&&(Bn=0,Ln={}),Bn++,Ln[e]=t),t}function se(e){for(var t=0,n=0;n0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}function ce(e){Z(e!==1/0,"Cannot perform this action with an infinite size.")}function pe(e){return null===e||void 0===e?we():fe(e)&&!l(e)?e:we().withMutations(function(t){var r=n(e);ce(r.size),r.forEach(function(e,n){return t.set(n,e)})})}function fe(e){return!(!e||!e[qn])}function he(e,t){this.ownerID=e,this.entries=t}function de(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function me(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function ve(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function ge(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function ye(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&be(e._root)}function _e(e,t){return w(e,t[0],t[1])}function be(e,t){return{node:e,index:0,__prev:t}}function xe(e,t,n,r){var i=Object.create(zn);return i.size=e,i._root=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function we(){return Un||(Un=xe(0))}function ke(e,t,n){var r,i;if(e._root){var o=c(gn),a=c(yn);if(r=Ee(e._root,e.__ownerID,0,void 0,t,n,o,a),!a.value)return e;i=e.size+(o.value?n===vn?-1:1:0)}else{if(n===vn)return e;i=1,r=new he(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=i,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?xe(i,r):we()}function Ee(e,t,n,r,i,o,a,s){return e?e.update(t,n,r,i,o,a,s):o===vn?e:(p(s),p(a),new ge(t,r,[i,o]))}function Se(e){return e.constructor===ge||e.constructor===ve}function Ce(e,t,n,r,i){if(e.keyHash===r)return new ve(t,r,[e.entry,i]);var o,a=(0===n?e.keyHash:e.keyHash>>>n)&mn,s=(0===n?r:r>>>n)&mn;return new de(t,1<>>=1)a[s]=1&n?t[o++]:void 0;return a[r]=i,new me(e,o+1,a)}function Me(e,t,r){for(var i=[],a=0;a>1&1431655765,e=(858993459&e)+(e>>2&858993459),e=e+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function Fe(e,t,n,r){var i=r?e:h(e);return i[t]=n,i}function Ne(e,t,n,r){var i=e.length+1;if(r&&t+1===i)return e[t]=n,e;for(var o=new Array(i),a=0,s=0;s0&&io?0:o-n,l=a-n;return l>dn&&(l=dn),function(){if(i===l)return Xn;var e=t?--l:i++;return r&&r[e]}}function i(e,r,i){var s,u=e&&e.array,l=i>o?0:o-i>>r,c=1+(a-i>>r);return c>dn&&(c=dn),function(){for(;;){if(s){var e=s();if(e!==Xn)return e;s=null}if(l===c)return Xn;var o=t?--c:l++;s=n(u&&u[o],r-hn,i+(o<=e.size||t<0)return e.withMutations(function(e){t<0?Xe(e,t).set(0,n):Xe(e,0,t+1).set(t,n)});t+=e._origin;var r=e._tail,i=e._root,o=c(yn);return t>=$e(e._capacity)?r=Ge(r,e.__ownerID,0,t,n,o):i=Ge(i,e.__ownerID,e._level,t,n,o),o.value?e.__ownerID?(e._root=i,e._tail=r,e.__hash=void 0,e.__altered=!0,e):We(e._origin,e._capacity,e._level,i,r):e}function Ge(e,t,n,r,i,o){var a=r>>>n&mn,s=e&&a0){var l=e&&e.array[a],c=Ge(l,t,n-hn,r,i,o);return c===l?e:(u=Je(e,t),u.array[a]=c,u)}return s&&e.array[a]===i?e:(p(o),u=Je(e,t),void 0===i&&a===u.array.length-1?u.array.pop():u.array[a]=i,u)}function Je(e,t){return t&&e&&t===e.ownerID?e:new ze(e?e.array.slice():[],t)}function Ke(e,t){if(t>=$e(e._capacity))return e._tail;if(t<1<0;)n=n.array[t>>>r&mn],r-=hn;return n}}function Xe(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new f,i=e._origin,o=e._capacity,a=i+t,s=void 0===n?o:n<0?o+n:i+n;if(a===i&&s===o)return e;if(a>=s)return e.clear();for(var u=e._level,l=e._root,c=0;a+c<0;)l=new ze(l&&l.array.length?[void 0,l]:[],r),u+=hn,c+=1<=1<p?new ze([],r):d;if(d&&h>p&&ahn;g-=hn){var y=p>>>g&mn;v=v.array[y]=Je(v.array[y],r)}v.array[p>>>hn&mn]=d}if(s=h)a-=h,s-=h,u=hn,l=null,m=m&&m.removeBefore(r,0,a);else if(a>i||h>>u&mn;if(_!==h>>>u&mn)break;_&&(c+=(1<i&&(l=l.removeBefore(r,u,a-c)),l&&ha&&(a=l.size),o(u)||(l=l.map(function(e){return H(e)})),i.push(l)}return a>e.size&&(e=e.setSize(a)),Ie(e,t,i)}function $e(e){return e>>hn<=dn&&a.size>=2*o.size?(i=a.filter(function(e,t){return void 0!==e&&s!==t}),r=i.toKeyedSeq().map(function(e){return e[0]}).flip().toMap(),e.__ownerID&&(r.__ownerID=i.__ownerID=e.__ownerID)):(r=o.remove(t),i=s===a.size-1?a.pop():a.set(s,void 0))}else if(u){if(n===a.get(s)[1])return e;r=o,i=a.set(s,[t,n])}else r=o.set(t,a.size),i=a.set(a.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=i,e.__hash=void 0,e):et(r,i)}function rt(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function it(e){this._iter=e,this.size=e.size}function ot(e){this._iter=e,this.size=e.size}function at(e){this._iter=e,this.size=e.size}function st(e){var t=Dt(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=Ot,t.__iterateUncached=function(t,n){var r=this;return e.__iterate(function(e,n){return!1!==t(n,e,r)},n)},t.__iteratorUncached=function(t,n){if(t===xn){var r=e.__iterator(t,n);return new x(function(){var e=r.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e})}return e.__iterator(t===bn?_n:bn,n)},t}function ut(e,t,n){var r=Dt(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,i){var o=e.get(r,vn);return o===vn?i:t.call(n,o,r,e)},r.__iterateUncached=function(r,i){var o=this;return e.__iterate(function(e,i,a){return!1!==r(t.call(n,e,i,a),i,o)},i)},r.__iteratorUncached=function(r,i){var o=e.__iterator(xn,i);return new x(function(){var i=o.next();if(i.done)return i;var a=i.value,s=a[0];return w(r,s,t.call(n,a[1],s,e),i)})},r}function lt(e,t){var n=Dt(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=st(e);return t.reverse=function(){return e.flip()},t}),n.get=function(n,r){return e.get(t?n:-1-n,r)},n.has=function(n){return e.has(t?n:-1-n)},n.includes=function(t){return e.includes(t)},n.cacheResult=Ot,n.__iterate=function(t,n){var r=this;return e.__iterate(function(e,n){return t(e,n,r)},!n)},n.__iterator=function(t,n){return e.__iterator(t,!n)},n}function ct(e,t,n,r){var i=Dt(e);return r&&(i.has=function(r){var i=e.get(r,vn);return i!==vn&&!!t.call(n,i,r,e)},i.get=function(r,i){var o=e.get(r,vn);return o!==vn&&t.call(n,o,r,e)?o:i}),i.__iterateUncached=function(i,o){var a=this,s=0;return e.__iterate(function(e,o,u){if(t.call(n,e,o,u))return s++,i(e,r?o:s-1,a)},o),s},i.__iteratorUncached=function(i,o){var a=e.__iterator(xn,o),s=0;return new x(function(){for(;;){var o=a.next();if(o.done)return o;var u=o.value,l=u[0],c=u[1];if(t.call(n,c,l,e))return w(i,r?l:s++,c,o)}})},i}function pt(e,t,n){var r=pe().asMutable();return e.__iterate(function(i,o){r.update(t.call(n,i,o,e),0,function(e){return e+1})}),r.asImmutable()}function ft(e,t,n){var r=a(e),i=(l(e)?Ze():pe()).asMutable();e.__iterate(function(o,a){i.update(t.call(n,o,a,e),function(e){return e=e||[],e.push(r?[a,o]:o),e})});var o=At(e);return i.map(function(t){return Et(e,o(t))})}function ht(e,t,n,r){var i=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n===1/0?n=i:n|=0),g(t,n,i))return e;var o=y(t,i),a=_(n,i);if(o!==o||a!==a)return ht(e.toSeq().cacheResult(),t,n,r);var s,u=a-o;u===u&&(s=u<0?0:u);var l=Dt(e);return l.size=0===s?s:e.size&&s||void 0,!r&&N(e)&&s>=0&&(l.get=function(t,n){return t=m(this,t),t>=0&&ts)return k();var e=i.next();return r||t===bn?e:t===_n?w(t,u-1,void 0,e):w(t,u-1,e.value[1],e)})},l}function dt(e,t,n){var r=Dt(e);return r.__iterateUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterate(r,i);var a=0;return e.__iterate(function(e,i,s){return t.call(n,e,i,s)&&++a&&r(e,i,o)}),a},r.__iteratorUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterator(r,i);var a=e.__iterator(xn,i),s=!0;return new x(function(){if(!s)return k();var e=a.next();if(e.done)return e;var i=e.value,u=i[0],l=i[1];return t.call(n,l,u,o)?r===xn?e:w(r,u,l,e):(s=!1,k())})},r}function mt(e,t,n,r){var i=Dt(e);return i.__iterateUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,u=0;return e.__iterate(function(e,o,l){if(!s||!(s=t.call(n,e,o,l)))return u++,i(e,r?o:u-1,a)}),u},i.__iteratorUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterator(i,o);var s=e.__iterator(xn,o),u=!0,l=0;return new x(function(){var e,o,c;do{if(e=s.next(),e.done)return r||i===bn?e:i===_n?w(i,l++,void 0,e):w(i,l++,e.value[1],e);var p=e.value;o=p[0],c=p[1],u&&(u=t.call(n,c,o,a))}while(u);return i===xn?e:w(i,o,c,e)})},i}function vt(e,t){var r=a(e),i=[e].concat(t).map(function(e){return o(e)?r&&(e=n(e)):e=r?L(e):q(Array.isArray(e)?e:[e]),e}).filter(function(e){return 0!==e.size});if(0===i.length)return e;if(1===i.length){var u=i[0];if(u===e||r&&a(u)||s(e)&&s(u))return u}var l=new I(i);return r?l=l.toKeyedSeq():s(e)||(l=l.toSetSeq()),l=l.flatten(!0),l.size=i.reduce(function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}},0),l}function gt(e,t,n){var r=Dt(e);return r.__iterateUncached=function(r,i){function a(e,l){var c=this;e.__iterate(function(e,i){return(!t||l0}function kt(e,n,r){var i=Dt(e);return i.size=new I(r).map(function(e){return e.size}).min(),i.__iterate=function(e,t){for(var n,r=this.__iterator(bn,t),i=0;!(n=r.next()).done&&!1!==e(n.value,i++,this););return i},i.__iteratorUncached=function(e,i){var o=r.map(function(e){return e=t(e),C(i?e.reverse():e)}),a=0,s=!1;return new x(function(){var t;return s||(t=o.map(function(e){return e.next()}),s=t.some(function(e){return e.done})),s?k():w(e,a++,n.apply(null,t.map(function(e){return e.value})))})},i}function Et(e,t){return N(e)?t:e.constructor(t)}function St(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Ct(e){return ce(e.size),d(e)}function At(e){return a(e)?n:s(e)?r:i}function Dt(e){return Object.create((a(e)?M:s(e)?T:P).prototype)}function Ot(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):O.prototype.cacheResult.call(this)}function Mt(e,t){return e>t?1:et?-1:0}function on(e){if(e.size===1/0)return 0;var t=l(e),n=a(e),r=t?1:0;return an(e.__iterate(n?t?function(e,t){r=31*r+sn(oe(e),oe(t))|0}:function(e,t){r=r+sn(oe(e),oe(t))|0}:t?function(e){r=31*r+oe(e)|0}:function(e){r=r+oe(e)|0}),r)}function an(e,t){return t=Mn(t,3432918353),t=Mn(t<<15|t>>>-15,461845907),t=Mn(t<<13|t>>>-13,5),t=(t+3864292196|0)^e,t=Mn(t^t>>>16,2246822507),t=Mn(t^t>>>13,3266489909),t=ie(t^t>>>16)}function sn(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}var un=Array.prototype.slice;e(n,t),e(r,t),e(i,t),t.isIterable=o,t.isKeyed=a,t.isIndexed=s,t.isAssociative=u,t.isOrdered=l,t.Keyed=n,t.Indexed=r,t.Set=i;var ln="@@__IMMUTABLE_ITERABLE__@@",cn="@@__IMMUTABLE_KEYED__@@",pn="@@__IMMUTABLE_INDEXED__@@",fn="@@__IMMUTABLE_ORDERED__@@",hn=5,dn=1<r?k():w(e,i,n[t?r-i++:i++])})},e(R,M),R.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},R.prototype.has=function(e){return this._object.hasOwnProperty(e)},R.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,i=r.length-1,o=0;o<=i;o++){var a=r[t?i-o:o];if(!1===e(n[a],a,this))return o+1}return o},R.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,i=r.length-1,o=0;return new x(function(){var a=r[t?i-o:o];return o++>i?k():w(e,a,n[a])})},R.prototype[fn]=!0,e(j,T),j.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=this._iterable,r=C(n),i=0;if(S(r))for(var o;!(o=r.next()).done&&!1!==e(o.value,i++,this););return i},j.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterable,r=C(n);if(!S(r))return new x(k);var i=0;return new x(function(){var t=r.next();return t.done?t:w(e,i++,t.value)})},e(F,T),F.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n=this._iterator,r=this._iteratorCache,i=0;i=r.length){var t=n.next();if(t.done)return t;r[i]=t.value}return w(e,i,r[i++])})};var Cn;e($,T),$.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},$.prototype.get=function(e,t){return this.has(e)?this._value:t},$.prototype.includes=function(e){return X(this._value,e)},$.prototype.slice=function(e,t){var n=this.size;return g(e,t,n)?this:new $(this._value,_(t,n)-y(e,n))},$.prototype.reverse=function(){return this},$.prototype.indexOf=function(e){return X(this._value,e)?0:-1},$.prototype.lastIndexOf=function(e){return X(this._value,e)?this.size:-1},$.prototype.__iterate=function(e,t){for(var n=0;n=0&&t=0&&nn?k():w(e,o++,a)})},Q.prototype.equals=function(e){return e instanceof Q?this._start===e._start&&this._end===e._end&&this._step===e._step:Y(this,e)};var Dn;e(ee,t),e(te,ee),e(ne,ee),e(re,ee),ee.Keyed=te,ee.Indexed=ne,ee.Set=re;var On,Mn="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){e|=0,t|=0;var n=65535&e,r=65535&t;return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0},Tn=Object.isExtensible,Pn=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}(),In="function"==typeof WeakMap;In&&(On=new WeakMap);var Rn=0,jn="__immutablehash__";"function"==typeof Symbol&&(jn=Symbol(jn));var Fn=16,Nn=255,Bn=0,Ln={};e(pe,te),pe.of=function(){var e=un.call(arguments,0);return we().withMutations(function(t){for(var n=0;n=e.length)throw new Error("Missing value for key: "+e[n]);t.set(e[n],e[n+1])}})},pe.prototype.toString=function(){return this.__toString("Map {","}")},pe.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},pe.prototype.set=function(e,t){return ke(this,e,t)},pe.prototype.setIn=function(e,t){return this.updateIn(e,vn,function(){return t})},pe.prototype.remove=function(e){return ke(this,e,vn)},pe.prototype.deleteIn=function(e){return this.updateIn(e,function(){return vn})},pe.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},pe.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=Re(this,Tt(e),t,n);return r===vn?void 0:r},pe.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):we()},pe.prototype.merge=function(){return Me(this,void 0,arguments)},pe.prototype.mergeWith=function(e){return Me(this,e,un.call(arguments,1))},pe.prototype.mergeIn=function(e){var t=un.call(arguments,1);return this.updateIn(e,we(),function(e){return"function"==typeof e.merge?e.merge.apply(e,t):t[t.length-1]})},pe.prototype.mergeDeep=function(){return Me(this,Te,arguments)},pe.prototype.mergeDeepWith=function(e){var t=un.call(arguments,1);return Me(this,Pe(e),t)},pe.prototype.mergeDeepIn=function(e){var t=un.call(arguments,1);return this.updateIn(e,we(),function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,t):t[t.length-1]})},pe.prototype.sort=function(e){return Ze(bt(this,e))},pe.prototype.sortBy=function(e,t){return Ze(bt(this,t,e))},pe.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},pe.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new f)},pe.prototype.asImmutable=function(){return this.__ensureOwner()},pe.prototype.wasAltered=function(){return this.__altered},pe.prototype.__iterator=function(e,t){return new ye(this,e,t)},pe.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate(function(t){return r++,e(t[1],t[0],n)},t),r},pe.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?xe(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},pe.isMap=fe;var qn="@@__IMMUTABLE_MAP__@@",zn=pe.prototype;zn[qn]=!0,zn.delete=zn.remove,zn.removeIn=zn.deleteIn,he.prototype.get=function(e,t,n,r){for(var i=this.entries,o=0,a=i.length;o=Wn)return Ae(e,u,r,i);var d=e&&e===this.ownerID,m=d?u:h(u);return f?s?l===c-1?m.pop():m[l]=m.pop():m[l]=[r,i]:m.push([r,i]),d?(this.entries=m,this):new he(e,m)}},de.prototype.get=function(e,t,n,r){void 0===t&&(t=oe(n));var i=1<<((0===e?t:t>>>e)&mn),o=this.bitmap;return 0==(o&i)?r:this.nodes[je(o&i-1)].get(e+hn,t,n,r)},de.prototype.update=function(e,t,n,r,i,o,a){void 0===n&&(n=oe(r));var s=(0===t?n:n>>>t)&mn,u=1<=Vn)return Oe(e,f,l,s,d);if(c&&!d&&2===f.length&&Se(f[1^p]))return f[1^p];if(c&&d&&1===f.length&&Se(d))return d;var m=e&&e===this.ownerID,v=c?d?l:l^u:l|u,g=c?d?Fe(f,p,d,m):Be(f,p,m):Ne(f,p,d,m);return m?(this.bitmap=v,this.nodes=g,this):new de(e,v,g)},me.prototype.get=function(e,t,n,r){void 0===t&&(t=oe(n));var i=(0===e?t:t>>>e)&mn,o=this.nodes[i];return o?o.get(e+hn,t,n,r):r},me.prototype.update=function(e,t,n,r,i,o,a){void 0===n&&(n=oe(r));var s=(0===t?n:n>>>t)&mn,u=i===vn,l=this.nodes,c=l[s];if(u&&!c)return this;var p=Ee(c,e,t+hn,n,r,i,o,a);if(p===c)return this;var f=this.count;if(c){if(!p&&--f=0&&e>>t&mn;if(r>=this.array.length)return new ze([],e);var i,o=0===r;if(t>0){var a=this.array[r];if((i=a&&a.removeBefore(e,t-hn,n))===a&&o)return this}if(o&&!i)return this;var s=Je(this,e);if(!o)for(var u=0;u>>t&mn;if(r>=this.array.length)return this;var i;if(t>0){var o=this.array[r];if((i=o&&o.removeAfter(e,t-hn,n))===o&&r===this.array.length-1)return this}var a=Je(this,e);return a.array.splice(r+1),i&&(a.array[r]=i),a};var Kn,Xn={};e(Ze,pe),Ze.of=function(){return this(arguments)},Ze.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Ze.prototype.get=function(e,t){var n=this._map.get(e);return void 0!==n?this._list.get(n)[1]:t},Ze.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):tt()},Ze.prototype.set=function(e,t){return nt(this,e,t)},Ze.prototype.remove=function(e){return nt(this,e,vn)},Ze.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Ze.prototype.__iterate=function(e,t){var n=this;return this._list.__iterate(function(t){return t&&e(t[1],t[0],n)},t)},Ze.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},Ze.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),n=this._list.__ensureOwner(e);return e?et(t,n,e,this.__hash):(this.__ownerID=e,this._map=t,this._list=n,this)},Ze.isOrderedMap=Qe,Ze.prototype[fn]=!0,Ze.prototype.delete=Ze.prototype.remove;var Yn;e(rt,M),rt.prototype.get=function(e,t){return this._iter.get(e,t)},rt.prototype.has=function(e){return this._iter.has(e)},rt.prototype.valueSeq=function(){return this._iter.valueSeq()},rt.prototype.reverse=function(){var e=this,t=lt(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},rt.prototype.map=function(e,t){var n=this,r=ut(this,e,t);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(e,t)}),r},rt.prototype.__iterate=function(e,t){var n,r=this;return this._iter.__iterate(this._useKeys?function(t,n){return e(t,n,r)}:(n=t?Ct(this):0,function(i){return e(i,t?--n:n++,r)}),t)},rt.prototype.__iterator=function(e,t){if(this._useKeys)return this._iter.__iterator(e,t);var n=this._iter.__iterator(bn,t),r=t?Ct(this):0;return new x(function(){var i=n.next();return i.done?i:w(e,t?--r:r++,i.value,i)})},rt.prototype[fn]=!0,e(it,T),it.prototype.includes=function(e){return this._iter.includes(e)},it.prototype.__iterate=function(e,t){var n=this,r=0;return this._iter.__iterate(function(t){return e(t,r++,n)},t)},it.prototype.__iterator=function(e,t){var n=this._iter.__iterator(bn,t),r=0;return new x(function(){var t=n.next();return t.done?t:w(e,r++,t.value,t)})},e(ot,P),ot.prototype.has=function(e){return this._iter.includes(e)},ot.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){return e(t,t,n)},t)},ot.prototype.__iterator=function(e,t){var n=this._iter.__iterator(bn,t);return new x(function(){var t=n.next();return t.done?t:w(e,t.value,t.value,t)})},e(at,M),at.prototype.entrySeq=function(){return this._iter.toSeq()},at.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){if(t){St(t);var r=o(t);return e(r?t.get(1):t[1],r?t.get(0):t[0],n)}},t)},at.prototype.__iterator=function(e,t){var n=this._iter.__iterator(bn,t);return new x(function(){for(;;){var t=n.next();if(t.done)return t;var r=t.value;if(r){St(r);var i=o(r);return w(e,i?r.get(0):r[0],i?r.get(1):r[1],t)}}})},it.prototype.cacheResult=rt.prototype.cacheResult=ot.prototype.cacheResult=at.prototype.cacheResult=Ot,e(Pt,te),Pt.prototype.toString=function(){return this.__toString(Rt(this)+" {","}")},Pt.prototype.has=function(e){return this._defaultValues.hasOwnProperty(e)},Pt.prototype.get=function(e,t){if(!this.has(e))return t;var n=this._defaultValues[e];return this._map?this._map.get(e,n):n},Pt.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var e=this.constructor;return e._empty||(e._empty=It(this,we()))},Pt.prototype.set=function(e,t){if(!this.has(e))throw new Error('Cannot set unknown key "'+e+'" on '+Rt(this));if(this._map&&!this._map.has(e)){if(t===this._defaultValues[e])return this}var n=this._map&&this._map.set(e,t);return this.__ownerID||n===this._map?this:It(this,n)},Pt.prototype.remove=function(e){if(!this.has(e))return this;var t=this._map&&this._map.remove(e);return this.__ownerID||t===this._map?this:It(this,t)},Pt.prototype.wasAltered=function(){return this._map.wasAltered()},Pt.prototype.__iterator=function(e,t){var r=this;return n(this._defaultValues).map(function(e,t){return r.get(t)}).__iterator(e,t)},Pt.prototype.__iterate=function(e,t){var r=this;return n(this._defaultValues).map(function(e,t){return r.get(t)}).__iterate(e,t)},Pt.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map&&this._map.__ensureOwner(e);return e?It(this,t,e):(this.__ownerID=e,this._map=t,this)};var $n=Pt.prototype;$n.delete=$n.remove,$n.deleteIn=$n.removeIn=zn.removeIn,$n.merge=zn.merge,$n.mergeWith=zn.mergeWith,$n.mergeIn=zn.mergeIn,$n.mergeDeep=zn.mergeDeep,$n.mergeDeepWith=zn.mergeDeepWith,$n.mergeDeepIn=zn.mergeDeepIn,$n.setIn=zn.setIn,$n.update=zn.update,$n.updateIn=zn.updateIn,$n.withMutations=zn.withMutations,$n.asMutable=zn.asMutable,$n.asImmutable=zn.asImmutable,e(Nt,re),Nt.of=function(){return this(arguments)},Nt.fromKeys=function(e){return this(n(e).keySeq())},Nt.prototype.toString=function(){return this.__toString("Set {","}")},Nt.prototype.has=function(e){return this._map.has(e)},Nt.prototype.add=function(e){return Lt(this,this._map.set(e,!0))},Nt.prototype.remove=function(e){return Lt(this,this._map.remove(e))},Nt.prototype.clear=function(){return Lt(this,this._map.clear())},Nt.prototype.union=function(){var e=un.call(arguments,0);return e=e.filter(function(e){return 0!==e.size}),0===e.length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations(function(t){for(var n=0;n=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):Kt(e,t)},Gt.prototype.pushAll=function(e){if(e=r(e),0===e.size)return this;ce(e.size);var t=this.size,n=this._head;return e.reverse().forEach(function(e){t++,n={value:e,next:n}}),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):Kt(t,n)},Gt.prototype.pop=function(){return this.slice(1)},Gt.prototype.unshift=function(){return this.push.apply(this,arguments)},Gt.prototype.unshiftAll=function(e){return this.pushAll(e)},Gt.prototype.shift=function(){return this.pop.apply(this,arguments)},Gt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Xt()},Gt.prototype.slice=function(e,t){if(g(e,t,this.size))return this;var n=y(e,this.size);if(_(t,this.size)!==this.size)return ne.prototype.slice.call(this,e,t);for(var r=this.size-n,i=this._head;n--;)i=i.next;return this.__ownerID?(this.size=r,this._head=i,this.__hash=void 0,this.__altered=!0,this):Kt(r,i)},Gt.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Kt(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Gt.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&!1!==e(r.value,n++,this);)r=r.next;return n},Gt.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new x(function(){if(r){var t=r.value;return r=r.next,w(e,n++,t)}return k()})},Gt.isStack=Jt;var rr="@@__IMMUTABLE_STACK__@@",ir=Gt.prototype;ir[rr]=!0,ir.withMutations=zn.withMutations,ir.asMutable=zn.asMutable,ir.asImmutable=zn.asImmutable,ir.wasAltered=zn.wasAltered;var or;t.Iterator=x,Yt(t,{toArray:function(){ce(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate(function(t,n){e[n]=t}),e},toIndexedSeq:function(){return new it(this)},toJS:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJS?e.toJS():e}).__toJS()},toJSON:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e}).__toJS()},toKeyedSeq:function(){return new rt(this,!0)},toMap:function(){return pe(this.toKeyedSeq())},toObject:function(){ce(this.size);var e={};return this.__iterate(function(t,n){e[n]=t}),e},toOrderedMap:function(){return Ze(this.toKeyedSeq())},toOrderedSet:function(){return Ut(a(this)?this.valueSeq():this)},toSet:function(){return Nt(a(this)?this.valueSeq():this)},toSetSeq:function(){return new ot(this)},toSeq:function(){return s(this)?this.toIndexedSeq():a(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Gt(a(this)?this.valueSeq():this)},toList:function(){return Le(a(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){return Et(this,vt(this,un.call(arguments,0)))},includes:function(e){return this.some(function(t){return X(t,e)})},entries:function(){return this.__iterator(xn)},every:function(e,t){ce(this.size);var n=!0;return this.__iterate(function(r,i,o){if(!e.call(t,r,i,o))return n=!1,!1}),n},filter:function(e,t){return Et(this,ct(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},forEach:function(e,t){return ce(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){ce(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate(function(r){n?n=!1:t+=e,t+=null!==r&&void 0!==r?r.toString():""}),t},keys:function(){return this.__iterator(_n)},map:function(e,t){return Et(this,ut(this,e,t))},reduce:function(e,t,n){ce(this.size);var r,i;return arguments.length<2?i=!0:r=t,this.__iterate(function(t,o,a){i?(i=!1,r=t):r=e.call(n,r,t,o,a)}),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return Et(this,lt(this,!0))},slice:function(e,t){return Et(this,ht(this,e,t,!0))},some:function(e,t){return!this.every(Qt(e),t)},sort:function(e){return Et(this,bt(this,e))},values:function(){return this.__iterator(bn)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(e,t){return d(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return pt(this,e,t)},equals:function(e){return Y(this,e)},entrySeq:function(){var e=this;if(e._cache)return new I(e._cache);var t=e.toSeq().map(Zt).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Qt(e),t)},findEntry:function(e,t,n){var r=n;return this.__iterate(function(n,i,o){if(e.call(t,n,i,o))return r=[i,n],!1}),r},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},findLastEntry:function(e,t,n){return this.toKeyedSeq().reverse().findEntry(e,t,n)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(){return this.find(v)},flatMap:function(e,t){return Et(this,yt(this,e,t))},flatten:function(e){return Et(this,gt(this,e,!0))},fromEntrySeq:function(){return new at(this)},get:function(e,t){return this.find(function(t,n){return X(n,e)},void 0,t)},getIn:function(e,t){for(var n,r=this,i=Tt(e);!(n=i.next()).done;){var o=n.value;if((r=r&&r.get?r.get(o,vn):vn)===vn)return t}return r},groupBy:function(e,t){return ft(this,e,t)},has:function(e){return this.get(e,vn)!==vn},hasIn:function(e){return this.getIn(e,vn)!==vn},isSubset:function(e){return e="function"==typeof e.includes?e:t(e),this.every(function(t){return e.includes(t)})},isSuperset:function(e){return e="function"==typeof e.isSubset?e:t(e),e.isSubset(this)},keyOf:function(e){return this.findKey(function(t){return X(t,e)})},keySeq:function(){return this.toSeq().map($t).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return xt(this,e)},maxBy:function(e,t){return xt(this,t,e)},min:function(e){return xt(this,e?en(e):rn)},minBy:function(e,t){return xt(this,t?en(t):rn,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return Et(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return Et(this,mt(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Qt(e),t)},sortBy:function(e,t){return Et(this,bt(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return Et(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return Et(this,dt(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Qt(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=on(this))}});var ar=t.prototype;ar[ln]=!0,ar[En]=ar.values,ar.__toJS=ar.toArray,ar.__toStringMapper=tn,ar.inspect=ar.toSource=function(){return this.toString()},ar.chain=ar.flatMap,ar.contains=ar.includes,Yt(n,{flip:function(){return Et(this,st(this))},mapEntries:function(e,t){var n=this,r=0;return Et(this,this.toSeq().map(function(i,o){return e.call(t,[o,i],r++,n)}).fromEntrySeq())},mapKeys:function(e,t){var n=this;return Et(this,this.toSeq().flip().map(function(r,i){return e.call(t,r,i,n)}).flip())}});var sr=n.prototype;return sr[cn]=!0,sr[En]=ar.entries,sr.__toJS=ar.toObject,sr.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+tn(e)},Yt(r,{toKeyedSeq:function(){return new rt(this,!1)},filter:function(e,t){return Et(this,ct(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return Et(this,lt(this,!1))},slice:function(e,t){return Et(this,ht(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(0|t,0),0===n||2===n&&!t)return this;e=y(e,e<0?this.count():this.size);var r=this.slice(0,e);return Et(this,1===n?r:r.concat(h(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.findLastEntry(e,t);return n?n[0]:-1},first:function(){return this.get(0)},flatten:function(e){return Et(this,gt(this,e,!1))},get:function(e,t){return e=m(this,e),e<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find(function(t,n){return n===e},void 0,t)},has:function(e){return(e=m(this,e))>=0&&(void 0!==this.size?this.size===1/0||e5e3)return e.textContent;return function(e){for(var n,r,i,o,a,s=e.textContent,u=0,l=s[0],c=1,p=e.innerHTML="",f=0;r=n,n=f<7&&"\\"==n?1:c;){if(c=l,l=s[++u],o=p.length>1,!c||f>8&&"\n"==c||[/\S/.test(c),1,1,!/[$\w]/.test(c),("/"==n||"\n"==n)&&o,'"'==n&&o,"'"==n&&o,s[u-4]+r+n=="--\x3e",r+n=="*/"][f])for(p&&(e.appendChild(a=t.createElement("span")).setAttribute("style",["color: #555; font-weight: bold;","","","color: #555;",""][f?f<3?2:f>6?4:f>3?3:+/^(a(bstract|lias|nd|rguments|rray|s(m|sert)?|uto)|b(ase|egin|ool(ean)?|reak|yte)|c(ase|atch|har|hecked|lass|lone|ompl|onst|ontinue)|de(bugger|cimal|clare|f(ault|er)?|init|l(egate|ete)?)|do|double|e(cho|ls?if|lse(if)?|nd|nsure|num|vent|x(cept|ec|p(licit|ort)|te(nds|nsion|rn)))|f(allthrough|alse|inal(ly)?|ixed|loat|or(each)?|riend|rom|unc(tion)?)|global|goto|guard|i(f|mp(lements|licit|ort)|n(it|clude(_once)?|line|out|stanceof|t(erface|ernal)?)?|s)|l(ambda|et|ock|ong)|m(icrolight|odule|utable)|NaN|n(amespace|ative|ext|ew|il|ot|ull)|o(bject|perator|r|ut|verride)|p(ackage|arams|rivate|rotected|rotocol|ublic)|r(aise|e(adonly|do|f|gister|peat|quire(_once)?|scue|strict|try|turn))|s(byte|ealed|elf|hort|igned|izeof|tatic|tring|truct|ubscript|uper|ynchronized|witch)|t(emplate|hen|his|hrows?|ransient|rue|ry|ype(alias|def|id|name|of))|u(n(checked|def(ined)?|ion|less|signed|til)|se|sing)|v(ar|irtual|oid|olatile)|w(char_t|hen|here|hile|ith)|xor|yield)$/.test(p):0]),a.appendChild(t.createTextNode(p))),i=f&&f<7?f:i,p="",f=11;![1,/[\/{}[(\-+*=<>:;|\\.,?!&@~]/.test(c),/[\])]/.test(c),/[$\w]/.test(c),"/"==c&&i<2&&"<"!=n,'"'==c,"'"==c,c+l+s[u+1]+s[u+2]=="\x3c!--",c+l=="/*",c+l=="//","#"==c][--f];);p+=c}}(e)}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:L.default.Map();if(!L.default.Map.isMap(e)||!e.size)return L.default.List();if(Array.isArray(t)||(t=[t]),t.length<1)return e.merge(n);var r=L.default.List(),i=t[0],o=!0,a=!1,s=void 0;try{for(var u,l=(0,T.default)(e.entries());!(o=(u=l.next()).done);o=!0){var c=u.value,p=(0,O.default)(c,2),f=p[0],h=p[1],d=b(h,t.slice(1),n.set(i,f));r=L.default.List.isList(d)?r.concat(d):r.push(d)}}catch(e){a=!0,s=e}finally{try{!o&&l.return&&l.return()}finally{if(a)throw s}}return r}function x(e){var t=/filename="([^;]*);?"/i.exec(e);return null===t&&(t=/filename=([^;]*);?/i.exec(e)),null!==t&&t.length>1?t[1]:null}function w(e){return(0,V.default)((0,U.default)(e))}function k(e){return w(e.replace(/\.[^.\/]*$/,""))}function E(e){return"string"!=typeof e||""===e?"":(0,q.sanitizeUrl)(e)}function S(e){if(!L.default.OrderedMap.isOrderedMap(e))return null;if(!e.size)return null;var t=e.find(function(e,t){return t.startsWith("2")&&(0,j.default)(e.get("content")||{}).length>0}),n=e.get("default")||L.default.OrderedMap(),r=(n.get("content")||L.default.OrderedMap()).keySeq().toJS(),i=r.length?n:null;return t||i}Object.defineProperty(t,"__esModule",{value:!0}),t.getExtensions=t.escapeDeepLinkPath=t.createDeepLinkPath=t.shallowEqualKeys=t.buildFormData=t.sorters=t.btoa=t.parseSearch=t.getSampleSchema=t.validateParam=t.validatePattern=t.validateMinLength=t.validateMaxLength=t.validateGuid=t.validateDateTime=t.validateString=t.validateBoolean=t.validateFile=t.validateInteger=t.validateNumber=t.validateMinimum=t.validateMaximum=t.propChecker=t.memoize=t.isImmutable=void 0;var C=n(34),A=r(C),D=n(18),O=r(D),M=n(95),T=r(M),P=n(35),I=r(P),R=n(47),j=r(R),F=n(48),N=r(F);t.isJSONObject=i,t.objectify=o,t.arrayify=a,t.fromJSOrdered=s,t.bindToState=u,t.normalizeArray=l,t.isFn=c,t.isObject=p,t.isFunc=f,t.isArray=h,t.objMap=d,t.objReduce=m,t.systemThunkMiddleware=v,t.defaultStatusCode=g,t.getList=y,t.highlight=_,t.mapToList=b,t.extractFileNameFromContentDispositionHeader=x,t.pascalCase=w,t.pascalCaseFilename=k,t.sanitizeUrl=E,t.getAcceptControllingResponse=S;var B=n(7),L=r(B),q=n(505),z=n(939),U=r(z),W=n(428),V=r(W),H=n(425),G=r(H),J=n(223),K=r(J),X=n(954),Y=r(X),$=n(120),Z=r($),Q=n(172),ee=n(46),te=r(ee),ne=n(696),re=r(ne),ie="default",oe=t.isImmutable=function(e){return L.default.Iterable.isIterable(e)},ae=(t.memoize=G.default,t.propChecker=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return(0,j.default)(e).length!==(0,j.default)(t).length||((0,Y.default)(e,function(e,n){if(r.includes(n))return!1;var i=t[n];return L.default.Iterable.isIterable(e)?!L.default.is(e,i):("object"!==(void 0===e?"undefined":(0,N.default)(e))||"object"!==(void 0===i?"undefined":(0,N.default)(i)))&&e!==i})||n.some(function(n){return!(0,Z.default)(e[n],t[n])}))},t.validateMaximum=function(e,t){if(e>t)return"Value must be less than Maximum"}),se=t.validateMinimum=function(e,t){if(et)return"Value must be less than MaxLength"},ve=t.validateMinLength=function(e,t){if(e.length2&&void 0!==arguments[2]&&arguments[2],r=[],i=t&&"body"===e.get("in")?e.get("value_xml"):e.get("value"),o=e.get("required"),a=n?e.get("schema"):e;if(!a)return r;var s=a.get("maximum"),u=a.get("minimum"),l=a.get("type"),c=a.get("format"),p=a.get("maxLength"),f=a.get("minLength"),h=a.get("pattern");if(l&&(o||i)){var d="string"===l&&i,m="array"===l&&Array.isArray(i)&&i.length,v="array"===l&&L.default.List.isList(i)&&i.count(),g="file"===l&&i instanceof te.default.File,y="boolean"===l&&(i||!1===i),_="number"===l&&(i||0===i),b="integer"===l&&(i||0===i);if(o&&!(d||m||v||g||y||_||b))return r.push("Required field is not provided"),r;if(h){var x=ge(i,h);x&&r.push(x)}if(p||0===p){var w=me(i,p);w&&r.push(w)}if(f){var k=ve(i,f);k&&r.push(k)}if(s||0===s){var E=ae(i,s);E&&r.push(E)}if(u||0===u){var S=se(i,u);S&&r.push(S)}if("string"===l){var C=void 0;if(!(C="date-time"===c?he(i):"uuid"===c?de(i):fe(i)))return r;r.push(C)}else if("boolean"===l){var A=pe(i);if(!A)return r;r.push(A)}else if("number"===l){var D=ue(i);if(!D)return r;r.push(D)}else if("integer"===l){var O=le(i);if(!O)return r;r.push(O)}else if("array"===l){var M=void 0;if(!i.count())return r;M=a.getIn(["items","type"]),i.forEach(function(e,t){var n=void 0;"number"===M?n=ue(e):"integer"===M?n=le(e):"string"===M&&(n=fe(e)),n&&r.push({index:t,error:n})})}else if("file"===l){var T=ce(i);if(!T)return r;r.push(T)}}return r},t.getSampleSchema=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(/xml/.test(t)){if(!e.xml||!e.xml.name){if(e.xml=e.xml||{},!e.$$ref)return e.type||e.items||e.properties||e.additionalProperties?'\n\x3c!-- XML example cannot be generated --\x3e':null;var r=e.$$ref.match(/\S*\/(\S+)$/);e.xml.name=r[1]}return(0,Q.memoizedCreateXMLExample)(e,n)}return(0,A.default)((0,Q.memoizedSampleFromSchema)(e,n),null,2)},t.parseSearch=function(){var e={},t=te.default.location.search;if(!t)return{};if(""!=t){var n=t.substr(1).split("&");for(var r in n)n.hasOwnProperty(r)&&(r=n[r].split("="),e[decodeURIComponent(r[0])]=decodeURIComponent(r[1]))}return e},t.btoa=function(t){var n=void 0;return n=t instanceof e?t:new e(t.toString(),"utf-8"),n.toString("base64")},t.sorters={operationsSorter:{alpha:function(e,t){return e.get("path").localeCompare(t.get("path"))},method:function(e,t){return e.get("method").localeCompare(t.get("method"))}},tagsSorter:{alpha:function(e,t){return e.localeCompare(t)}}},t.buildFormData=function(e){var t=[];for(var n in e){var r=e[n];void 0!==r&&""!==r&&t.push([n,"=",encodeURIComponent(r).replace(/%20/g,"+")].join(""))}return t.join("&")},t.shallowEqualKeys=function(e,t,n){return!!(0,K.default)(n,function(n){return(0,Z.default)(e[n],t[n])})},t.createDeepLinkPath=function(e){return"string"==typeof e||e instanceof String?e.trim().replace(/\s/g,"_"):""});t.escapeDeepLinkPath=function(e){return(0,re.default)(ye(e))},t.getExtensions=function(e){return e.filter(function(e,t){return/^x-/.test(t)})}}).call(t,n(40).Buffer)},function(e,t,n){"use strict";var r=n(31),i=r;e.exports=i},function(e,t,n){"use strict";function r(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r6?s-6:0),l=6;l5?l-5:0),p=5;p5?a-5:0),u=5;u key("+c[p]+")"].concat(s));if(h instanceof Error)return h}}return i(t)}function u(e){return a(e,"List",b.List.isList)}function l(e,t,n,r){function o(){for(var i=arguments.length,o=Array(i),u=0;u5?s-5:0),l=5;l5?l-5:0),p=5;p>",w={listOf:u,mapOf:c,orderedMapOf:p,setOf:f,orderedSetOf:h,stackOf:d,iterableOf:m,recordOf:v,shape:y,contains:y,mapContains:_,list:o("List",b.List.isList),map:o("Map",b.Map.isMap),orderedMap:o("OrderedMap",b.OrderedMap.isOrderedMap),set:o("Set",b.Set.isSet),orderedSet:o("OrderedSet",b.OrderedSet.isOrderedSet),stack:o("Stack",b.Stack.isStack),seq:o("Seq",b.Seq.isSeq),record:o("Record",function(e){return e instanceof b.Record}),iterable:o("Iterable",b.Iterable.isIterable)};e.exports=w},function(e,t,n){"use strict";function r(e,t){return 1===e.nodeType&&e.getAttribute(d)===String(t)||8===e.nodeType&&e.nodeValue===" react-text: "+t+" "||8===e.nodeType&&e.nodeValue===" react-empty: "+t+" "}function i(e){for(var t;t=e._renderedComponent;)e=t;return e}function o(e,t){var n=i(e);n._hostNode=t,t[v]=n}function a(e){var t=e._hostNode;t&&(delete t[v],e._hostNode=null)}function s(e,t){if(!(e._flags&m.hasCachedChildNodes)){var n=e._renderedChildren,a=t.firstChild;e:for(var s in n)if(n.hasOwnProperty(s)){var u=n[s],l=i(u)._domID;if(0!==l){for(;null!==a;a=a.nextSibling)if(r(a,l)){o(u,a);continue e}p("32",l)}}e._flags|=m.hasCachedChildNodes}}function u(e){if(e[v])return e[v];for(var t=[];!e[v];){if(t.push(e),!e.parentNode)return null;e=e.parentNode}for(var n,r;e&&(r=e[v]);e=t.pop())n=r,t.length&&s(r,e);return n}function l(e){var t=u(e);return null!=t&&t._hostNode===e?t:null}function c(e){if(void 0===e._hostNode&&p("33"),e._hostNode)return e._hostNode;for(var t=[];!e._hostNode;)t.push(e),e._hostParent||p("34"),e=e._hostParent;for(;t.length;e=t.pop())s(e,e._hostNode);return e._hostNode}var p=n(11),f=n(89),h=n(453),d=(n(8),f.ID_ATTRIBUTE_NAME),m=h,v="__reactInternalInstance$"+Math.random().toString(36).slice(2),g={getClosestInstanceFromNode:u,getInstanceFromNode:l,getNodeFromInstance:c,precacheChildNodes:s,precacheNode:o,uncacheNode:a};e.exports=g},function(e,t){var n=e.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},function(e,t,n){"use strict";function r(e){var t={};return null!==e&&Object.keys(e).forEach(function(n){e[n].forEach(function(e){t[String(e)]=n})}),t}function i(e,t){if(t=t||{},Object.keys(t).forEach(function(t){if(-1===a.indexOf(t))throw new o('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=r(t.styleAliases||null),-1===s.indexOf(this.kind))throw new o('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var o=n(117),a=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],s=["scalar","sequence","mapping"];e.exports=i},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(563),o=r(i),a=n(95),s=r(a);t.default=function(){function e(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=(0,s.default)(e);!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&u.return&&u.return()}finally{if(i)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if((0,o.default)(Object(t)))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()},function(e,t,n){var r=n(361)("wks"),i=n(202),o=n(30).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){"use strict";t.__esModule=!0;var r=n(35),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=i.default||function(e){for(var t=1;t=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(65535!=(65535&e)&&65534!=(65535&e)&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function l(e){if(e>65535){e-=65536;var t=55296+(e>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function c(e,t){var n=0;return o(y,t)?y[t]:35===t.charCodeAt(0)&&g.test(t)&&(n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10),u(n))?l(n):e}function p(e){return e.indexOf("&")<0?e:e.replace(v,c)}function f(e){return x[e]}function h(e){return _.test(e)?e.replace(b,f):e}var d=Object.prototype.hasOwnProperty,m=/\\([\\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g,v=/&([a-z#][a-z0-9]{1,31});/gi,g=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,y=n(488),_=/[&<>"]/,b=/[&<>"]/g,x={"&":"&","<":"<",">":">",'"':"""};t.assign=a,t.isString=i,t.has=o,t.unescapeMd=s,t.isValidEntityCode=u,t.fromCodePoint=l,t.replaceEntities=p,t.escapeHtml=h},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(30),i=n(63),o=n(64),a=n(78),s=n(136),u=function(e,t,n){var l,c,p,f,h=e&u.F,d=e&u.G,m=e&u.S,v=e&u.P,g=e&u.B,y=d?r:m?r[t]||(r[t]={}):(r[t]||{}).prototype,_=d?i:i[t]||(i[t]={}),b=_.prototype||(_.prototype={});d&&(n=t);for(l in n)c=!h&&y&&void 0!==y[l],p=(c?y:n)[l],f=g&&c?s(p,r):v&&"function"==typeof p?s(Function.call,p):p,y&&a(y,l,p,e&u.U),_[l]!=p&&o(_,l,f),v&&b[l]!=p&&(b[l]=p)};r.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,n){var r=n(28),i=n(107),o=n(57),a=/"/g,s=function(e,t,n,r){var i=String(o(e)),s="<"+t;return""!==n&&(s+=" "+n+'="'+String(r).replace(a,""")+'"'),s+">"+i+""};e.exports=function(e,t){var n={};n[e]=t(s),r(r.P+r.F*i(function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}),"String",n)}},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){"use strict";function r(e){return function(){return e}}var i=function(){};i.thatReturns=r,i.thatReturnsFalse=r(!1),i.thatReturnsTrue=r(!0),i.thatReturnsNull=r(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(e){return e},e.exports=i},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function o(e){if(p===clearTimeout)return clearTimeout(e);if((p===r||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function a(){m&&h&&(m=!1,h.length?d=h.concat(d):v=-1,d.length&&s())}function s(){if(!m){var e=i(a);m=!0;for(var t=d.length;t;){for(h=d,d=[];++v1)for(var n=1;n=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function m(e){return+e!=e&&(e=0),o.alloc(+e)}function v(e,t){if(o.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return J(e).length;default:if(r)return V(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,n);case"utf8":case"utf-8":return D(this,t,n);case"ascii":return M(this,t,n);case"latin1":case"binary":return T(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function y(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function _(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=o.from(t,r)),o.isBuffer(t))return 0===t.length?-1:b(e,t,n,r,i);if("number"==typeof t)return t&=255,o.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,i){function o(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}var a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}var l;if(i){var c=-1;for(l=n;ls&&(n=s-u),l=n;l>=0;l--){for(var p=!0,f=0;fi&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a239?4:o>223?3:o>191?2:1;if(i+s<=n){var u,l,c,p;switch(s){case 1:o<128&&(a=o);break;case 2:u=e[i+1],128==(192&u)&&(p=(31&o)<<6|63&u)>127&&(a=p);break;case 3:u=e[i+1],l=e[i+2],128==(192&u)&&128==(192&l)&&(p=(15&o)<<12|(63&u)<<6|63&l)>2047&&(p<55296||p>57343)&&(a=p);break;case 4:u=e[i+1],l=e[i+2],c=e[i+3],128==(192&u)&&128==(192&l)&&128==(192&c)&&(p=(15&o)<<18|(63&u)<<12|(63&l)<<6|63&c)>65535&&p<1114112&&(a=p)}}null===a?(a=65533,s=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),i+=s}return O(r)}function O(e){var t=e.length;if(t<=Q)return String.fromCharCode.apply(String,e);for(var n="",r=0;rr)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function j(e,t,n,r,i,a){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function F(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function N(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function B(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(e,t,n,r,i){return i||B(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),$.write(e,t,n,r,23,4),n+4}function q(e,t,n,r,i){return i||B(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),$.write(e,t,n,r,52,8),n+8}function z(e){if(e=U(e).replace(ee,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function U(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function W(e){return e<16?"0"+e.toString(16):e.toString(16)}function V(e,t){t=t||1/0;for(var n,r=e.length,i=null,o=[],a=0;a55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function H(e){for(var t=[],n=0;n>8,i=n%256,o.push(i),o.push(r);return o}function J(e){return Y.toByteArray(z(e))}function K(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function X(e){return e!==e}/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +var Y=n(569),$=n(763),Z=n(387);t.Buffer=o,t.SlowBuffer=m,t.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=r(),o.poolSize=8192,o._augment=function(e){return e.__proto__=o.prototype,e},o.from=function(e,t,n){return a(null,e,t,n)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(e,t,n){return u(null,e,t,n)},o.allocUnsafe=function(e){return l(null,e)},o.allocUnsafeSlow=function(e){return l(null,e)},o.isBuffer=function(e){return!(null==e||!e._isBuffer)},o.compare=function(e,t){if(!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},o.prototype.compare=function(e,t,n,r,i){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;for(var a=i-r,s=n-t,u=Math.min(a,s),l=this.slice(r,i),c=e.slice(t,n),p=0;pi)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return x(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return k(this,e,t,n);case"latin1":case"binary":return E(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;o.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)r+=this[e+--t]*i;return r},o.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],i=1,o=0;++o=i&&(r-=Math.pow(2,8*t)),r},o.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},o.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),$.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),$.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),$.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),$.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t|=0,n|=0,!r){j(this,e,t,n,Math.pow(2,8*n)-1,0)}var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+n},o.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,1,255,0),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):F(this,e,t,!0),t+2},o.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):F(this,e,t,!1),t+2},o.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):N(this,e,t,!0),t+4},o.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},o.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);j(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},o.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);j(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},o.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,1,127,-128),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):F(this,e,t,!0),t+2},o.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):F(this,e,t,!1),t+2},o.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):N(this,e,t,!0),t+4},o.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},o.prototype.writeFloatLE=function(e,t,n){return L(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){return L(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){return q(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){return q(this,e,t,!1,n)},o.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(a<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var a;if("number"==typeof e)for(a=t;a0&&(a=this.buffer[u-1],e.call(r,a)<0);)if(u--,this.pointer-u>n/2-1){o=" ... ",u+=5;break}for(l="",i=this.pointer;in/2-1){l=" ... ",i-=5;break}return""+new Array(t).join(" ")+o+this.buffer.slice(u,i)+l+"\n"+new Array(t+this.pointer-u+o.length).join(" ")+"^"},t.prototype.toString=function(){var e,t;return e=this.get_snippet(),t=" on line "+(this.line+1)+", column "+(this.column+1),e?t:t+":\n"+e},t}(),this.YAMLError=function(e){function n(e){this.message=e,n.__super__.constructor.call(this),this.stack=this.toString()+"\n"+(new Error).stack.split("\n").slice(1).join("\n")}return t(n,e),n.prototype.toString=function(){return this.message},n}(Error),this.MarkedYAMLError=function(e){function n(e,t,r,i,o){this.context=e,this.context_mark=t,this.problem=r,this.problem_mark=i,this.note=o,n.__super__.constructor.call(this)}return t(n,e),n.prototype.toString=function(){var e;return e=[],null!=this.context&&e.push(this.context),null==this.context_mark||null!=this.problem&&null!=this.problem_mark&&this.context_mark.line===this.problem_mark.line&&this.context_mark.column===this.problem_mark.column||e.push(this.context_mark.toString()),null!=this.problem&&e.push(this.problem),null!=this.problem_mark&&e.push(this.problem_mark.toString()),null!=this.note&&e.push(this.note),e.join("\n")},n}(this.YAMLError)}).call(this)},function(e,t,n){"use strict";var r=n(95),i=function(e){return e&&e.__esModule?e:{default:e}}(r);e.exports=function(){var e={location:{},history:{},open:function(){},close:function(){},File:function(){}};if("undefined"==typeof window)return e;try{e=window;var t=["File","Blob","FormData"],n=!0,r=!1,o=void 0;try{for(var a,s=(0,i.default)(t);!(n=(a=s.next()).done);n=!0){var u=a.value;u in window&&(e[u]=window[u])}}catch(e){r=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(r)throw o}}}catch(e){console.error(e)}return e}()},function(e,t,n){e.exports={default:n(592),__esModule:!0}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(566),o=r(i),a=n(565),s=r(a),u="function"==typeof s.default&&"symbol"==typeof o.default?function(e){return typeof e}:function(e){return e&&"function"==typeof s.default&&e.constructor===s.default&&e!==s.default.prototype?"symbol":typeof e};t.default="function"==typeof s.default&&"symbol"===u(o.default)?function(e){return void 0===e?"undefined":u(e)}:function(e){return e&&"function"==typeof s.default&&e.constructor===s.default&&e!==s.default.prototype?"symbol":void 0===e?"undefined":u(e)}},function(e,t,n){e.exports=!n(54)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){"use strict";function r(e,t,n){return n?[e,t]:e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r){this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n;var i=this.constructor.Interface;for(var o in i)if(i.hasOwnProperty(o)){var s=i[o];s?this[o]=s(n):"target"===o?this.target=r:this[o]=n[o]}var u=null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue;return this.isDefaultPrevented=u?a.thatReturnsTrue:a.thatReturnsFalse,this.isPropagationStopped=a.thatReturnsFalse,this}var i=n(12),o=n(70),a=n(31),s=(n(10),["dispatchConfig","_targetInst","nativeEvent","isDefaultPrevented","isPropagationStopped","_dispatchListeners","_dispatchInstances"]),u={type:null,target:null,currentTarget:a.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};i(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=a.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=a.thatReturnsTrue)},persist:function(){this.isPersistent=a.thatReturnsTrue},isPersistent:a.thatReturnsFalse,destructor:function(){var e=this.constructor.Interface;for(var t in e)this[t]=null;for(var n=0;n1?t-1:0),i=1;i2?n-2:0),o=2;o=n?e:e.length+1===n?""+t+e:""+new Array(n-e.length+1).join(t)+e},this.to_hex=function(e){return"string"==typeof e&&(e=e.charCodeAt(0)),e.toString(16)}}).call(this)}).call(t,n(17))},function(e,t,n){var r=n(77);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){var n=e.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},function(e,t,n){var r=n(138),i=n(360);e.exports=n(106)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){"use strict";var r=n(724),i=Math.max;e.exports=function(e){return i(0,r(e))}},function(e,t,n){function r(e){return null==e?void 0===e?u:s:(e=Object(e),l&&l in e?o(e):a(e))}var i=n(82),o=n(895),a=n(924),s="[object Null]",u="[object Undefined]",l=i?i.toStringTag:void 0;e.exports=r},function(e,t,n){function r(e,t){var n=o(e,t);return i(n)?n:void 0}var i=n(853),o=n(896);e.exports=r},function(e,t){function n(e){return null!=e&&"object"==typeof e}e.exports=n},function(e,t,n){"use strict"},function(e,t,n){"use strict";var r=n(11),i=(n(8),function(e){var t=this;if(t.instancePool.length){var n=t.instancePool.pop();return t.call(n,e),n}return new t(e)}),o=function(e,t){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,e,t),r}return new n(e,t)},a=function(e,t,n){var r=this;if(r.instancePool.length){var i=r.instancePool.pop();return r.call(i,e,t,n),i}return new r(e,t,n)},s=function(e,t,n,r){var i=this;if(i.instancePool.length){var o=i.instancePool.pop();return i.call(o,e,t,n,r),o}return new i(e,t,n,r)},u=function(e){var t=this;e instanceof t||r("25"),e.destructor(),t.instancePool.length`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>",u="]",l=new RegExp("^(?:<[A-Za-z][A-Za-z0-9-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>|]|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|[<][?].*?[?][>]|]*>|)","i"),c=/[\\&]/,p="[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]",f=new RegExp("\\\\"+p+"|"+a,"gi"),h=new RegExp('[&<>"]',"g"),d=new RegExp(a+'|[&<>"]',"gi"),m=function(e){return 92===e.charCodeAt(0)?e.charAt(1):o(e)},v=function(e){return c.test(e)?e.replace(f,m):e},g=function(e){try{return r(i(e))}catch(t){return e}},y=function(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";default:return e}},_=function(e,t){return h.test(e)?t?e.replace(d,y):e.replace(h,y):e};e.exports={unescapeString:v,normalizeURI:g,escapeXml:_,reHtmlTag:l,OPENTAG:s,CLOSETAG:u,ENTITY:a,ESCAPABLE:p}},function(e,t){e.exports={}},function(e,t,n){var r=n(181),i=n(178);e.exports=function(e){return r(i(e))}},function(e,t,n){var r=n(178);e.exports=function(e){return Object(r(e))}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(30),i=n(64),o=n(108),a=n(202)("src"),s=Function.toString,u=(""+s).split("toString");n(63).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var l="function"==typeof n;l&&(o(n,"name")||i(n,"name",t)),e[t]!==n&&(l&&(o(n,a)||i(n,a,e[t]?""+e[t]:u.join(String(t)))),e===r?e[t]=n:s?e[t]?e[t]=n:i(e,t,n):(delete e[t],i(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[a]||s.call(this)})},function(e,t,n){"use strict";var r=n(372)();e.exports=function(e){return e!==r&&null!==e}},function(e,t,n){"use strict";function r(e){return void 0===e||null===e}function i(e){return"object"==typeof e&&null!==e}function o(e){return Array.isArray(e)?e:r(e)?[]:[e]}function a(e,t){var n,r,i,o;if(t)for(o=Object.keys(t),n=0,r=o.length;n`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>",u="]",l=new RegExp("^(?:<[A-Za-z][A-Za-z0-9-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>|]|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|[<][?].*?[?][>]|]*>|)","i"),c=/[\\&]/,p="[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]",f=new RegExp("\\\\"+p+"|"+a,"gi"),h=new RegExp('[&<>"]',"g"),d=new RegExp(a+'|[&<>"]',"gi"),m=function(e){return 92===e.charCodeAt(0)?e.charAt(1):o(e)},v=function(e){return c.test(e)?e.replace(f,m):e},g=function(e){try{return r(i(e))}catch(t){return e}},y=function(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";default:return e}},_=function(e,t){return h.test(e)?t?e.replace(d,y):e.replace(h,y):e};e.exports={unescapeString:v,normalizeURI:g,escapeXml:_,reHtmlTag:l,OPENTAG:s,CLOSETAG:u,ENTITY:a,ESCAPABLE:p}},function(e,t,n){"use strict";var r=n(12),i=n(474),o=n(1099),a=n(1100),s=n(93),u=n(1101),l=n(1102),c=n(1103),p=n(1107),f=s.createElement,h=s.createFactory,d=s.cloneElement,m=r,v=function(e){return e},g={Children:{map:o.map,forEach:o.forEach,count:o.count,toArray:o.toArray,only:p},Component:i.Component,PureComponent:i.PureComponent,createElement:f,cloneElement:d,isValidElement:s.isValidElement,PropTypes:u,createClass:c,createFactory:h,createMixin:v,DOM:a,version:l,__spread:m};e.exports=g},function(e,t,n){"use strict";function r(e){return void 0!==e.ref}function i(e){return void 0!==e.key}var o=n(12),a=n(52),s=(n(10),n(478),Object.prototype.hasOwnProperty),u=n(476),l={key:!0,ref:!0,__self:!0,__source:!0},c=function(e,t,n,r,i,o,a){var s={$$typeof:u,type:e,key:t,ref:n,props:a,_owner:o};return s};c.createElement=function(e,t,n){var o,u={},p=null,f=null;if(null!=t){r(t)&&(f=t.ref),i(t)&&(p=""+t.key),void 0===t.__self?null:t.__self,void 0===t.__source?null:t.__source;for(o in t)s.call(t,o)&&!l.hasOwnProperty(o)&&(u[o]=t[o])}var h=arguments.length-2;if(1===h)u.children=n;else if(h>1){for(var d=Array(h),m=0;m1){for(var g=Array(v),y=0;y=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(562),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){n(621);for(var r=n(24),i=n(56),o=n(74),a=n(22)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),u=0;u0?i(r(e),9007199254740991):0}},function(e,t,n){(function(e){function n(e){return Array.isArray?Array.isArray(e):"[object Array]"===v(e)}function r(e){return"boolean"==typeof e}function i(e){return null===e}function o(e){return null==e}function a(e){return"number"==typeof e}function s(e){return"string"==typeof e}function u(e){return"symbol"==typeof e}function l(e){return void 0===e}function c(e){return"[object RegExp]"===v(e)}function p(e){return"object"==typeof e&&null!==e}function f(e){return"[object Date]"===v(e)}function h(e){return"[object Error]"===v(e)||e instanceof Error}function d(e){return"function"==typeof e}function m(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function v(e){return Object.prototype.toString.call(e)}t.isArray=n,t.isBoolean=r,t.isNull=i,t.isNullOrUndefined=o,t.isNumber=a,t.isString=s,t.isSymbol=u,t.isUndefined=l,t.isRegExp=c,t.isObject=p,t.isDate=f,t.isError=h,t.isFunction=d,t.isPrimitive=m,t.isBuffer=e.isBuffer}).call(t,n(40).Buffer)},function(e,t,n){"use strict";function r(e){return"string"==typeof e&&i.test(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=/-webkit-|-moz-|-ms-/;e.exports=t.default},function(e,t){e.exports={Text:"text",Directive:"directive",Comment:"comment",Script:"script",Style:"style",Tag:"tag",CDATA:"cdata",Doctype:"doctype",isTag:function(e){return"tag"===e.type||"script"===e.type||"style"===e.type}}},function(e,t,n){var r=n(710),i=n(709);t.decode=function(e,t){return(!t||t<=0?i.XML:i.HTML)(e)},t.decodeStrict=function(e,t){return(!t||t<=0?i.XML:i.HTMLStrict)(e)},t.encode=function(e,t){return(!t||t<=0?r.XML:r.HTML)(e)},t.encodeXML=r.XML,t.encodeHTML4=t.encodeHTML5=t.encodeHTML=r.HTML,t.decodeXML=t.decodeXMLStrict=i.XML,t.decodeHTML4=t.decodeHTML5=t.decodeHTML=i.HTML,t.decodeHTML4Strict=t.decodeHTML5Strict=t.decodeHTMLStrict=i.HTMLStrict,t.escape=r.escape},function(e,t,n){"use strict";var r=n(79);e.exports=function(e){if(!r(e))throw new TypeError("Cannot use null or undefined");return e}},function(e,t,n){function r(t,n){return delete e.exports[t],e.exports[t]=n,n}var i=n(380),o=n(699);e.exports={Parser:i,Tokenizer:n(381),ElementType:n(113),DomHandler:o,get FeedHandler(){return r("FeedHandler",n(759))},get Stream(){return r("Stream",n(761))},get WritableStream(){return r("WritableStream",n(382))},get ProxyHandler(){return r("ProxyHandler",n(760))},get DomUtils(){return r("DomUtils",n(701))},get CollectingHandler(){return r("CollectingHandler",n(758))},DefaultHandler:o,get RssHandler(){return r("RssHandler",this.FeedHandler)},parseDOM:function(e,t){var n=new o(t);return new i(n,t).end(e),n.dom},parseFeed:function(t,n){var r=new e.exports.FeedHandler(n);return new i(r,n).end(t),r.dom},createDomStream:function(e,t,n){var r=new o(e,t,n);return new i(r,t)},EVENTS:{attribute:2,cdatastart:0,cdataend:0,text:1,processinginstruction:2,comment:1,commentend:0,closetag:1,opentag:2,opentagname:1,error:1,end:0}}},function(e,t,n){"use strict";function r(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.prototype.toString=function(e){var t=this.name+": ";return t+=this.reason||"(unknown reason)",!e&&this.mark&&(t+=" "+this.mark.toString()),t},e.exports=r},function(e,t,n){"use strict";var r=n(81);e.exports=new r({include:[n(388)],implicit:[n(813),n(806)],explicit:[n(798),n(808),n(809),n(811)]})},function(e,t,n){function r(e){return"function"==typeof e?e:null==e?a:"object"==typeof e?s(e)?o(e[0],e[1]):i(e):u(e)}var i=n(857),o=n(858),a=n(225),s=n(20),u=n(951);e.exports=r},function(e,t){function n(e,t){return e===t||e!==e&&t!==t}e.exports=n},function(e,t){function n(e,t,n){if(t in e)return e[t];if(3===arguments.length)return n;throw new Error('"'+t+'" is a required argument.')}function r(e){var t=e.match(y);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function i(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function o(e){var n=e,o=r(e);if(o){if(!o.path)return e;n=o.path}for(var a,s=t.isAbsolute(n),u=n.split(/\/+/),l=0,c=u.length-1;c>=0;c--)a=u[c],"."===a?u.splice(c,1):".."===a?l++:l>0&&(""===a?(u.splice(c+1,l),l=0):(u.splice(c,2),l--));return n=u.join("/"),""===n&&(n=s?"/":"."),o?(o.path=n,i(o)):n}function a(e,t){""===e&&(e="."),""===t&&(t=".");var n=r(t),a=r(e);if(a&&(e=a.path||"/"),n&&!n.scheme)return a&&(n.scheme=a.scheme),i(n);if(n||t.match(_))return t;if(a&&!a.host&&!a.path)return a.host=t,i(a);var s="/"===t.charAt(0)?t:o(e.replace(/\/+$/,"")+"/"+t);return a?(a.path=s,i(a)):s}function s(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return t;if(e=e.slice(0,r),e.match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)}function u(e){return e}function l(e){return p(e)?"$"+e:e}function c(e){return p(e)?e.slice(1):e}function p(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function f(e,t,n){var r=d(e.source,t.source);return 0!==r?r:0!==(r=e.originalLine-t.originalLine)?r:0!==(r=e.originalColumn-t.originalColumn)||n?r:0!==(r=e.generatedColumn-t.generatedColumn)?r:(r=e.generatedLine-t.generatedLine,0!==r?r:d(e.name,t.name))}function h(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r?r:0!==(r=e.generatedColumn-t.generatedColumn)||n?r:0!==(r=d(e.source,t.source))?r:0!==(r=e.originalLine-t.originalLine)?r:(r=e.originalColumn-t.originalColumn,0!==r?r:d(e.name,t.name))}function d(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}function m(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n?n:0!==(n=e.generatedColumn-t.generatedColumn)?n:0!==(n=d(e.source,t.source))?n:0!==(n=e.originalLine-t.originalLine)?n:(n=e.originalColumn-t.originalColumn,0!==n?n:d(e.name,t.name))}function v(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}function g(e,t,n){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),n){var s=r(n);if(!s)throw new Error("sourceMapURL could not be parsed");if(s.path){var u=s.path.lastIndexOf("/");u>=0&&(s.path=s.path.substring(0,u+1))}t=a(i(s),t)}return o(t)}t.getArg=n;var y=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,_=/^data:.+\,.+$/;t.urlParse=r,t.urlGenerate=i,t.normalize=o,t.join=a,t.isAbsolute=function(e){return"/"===e.charAt(0)||y.test(e)},t.relative=s;var b=function(){return!("__proto__"in Object.create(null))}();t.toSetString=b?u:l,t.fromSetString=b?u:c,t.compareByOriginalPositions=f,t.compareByGeneratedPositionsDeflated=h,t.compareByGeneratedPositionsInflated=m,t.parseSourceMapInput=v,t.computeSourceURL=g},function(e,t,n){"use strict";function r(e){return"button"===e||"input"===e||"select"===e||"textarea"===e}function i(e,t,n){switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":return!(!n.disabled||!r(t));default:return!1}}var o=n(11),a=n(242),s=n(243),u=n(247),l=n(462),c=n(463),p=(n(8),{}),f=null,h=function(e,t){e&&(s.executeDispatchesInOrder(e,t),e.isPersistent()||e.constructor.release(e))},d=function(e){return h(e,!0)},m=function(e){return h(e,!1)},v=function(e){return"."+e._rootNodeID},g={injection:{injectEventPluginOrder:a.injectEventPluginOrder,injectEventPluginsByName:a.injectEventPluginsByName},putListener:function(e,t,n){"function"!=typeof n&&o("94",t,typeof n);var r=v(e);(p[t]||(p[t]={}))[r]=n;var i=a.registrationNameModules[t];i&&i.didPutListener&&i.didPutListener(e,t,n)},getListener:function(e,t){var n=p[t];if(i(t,e._currentElement.type,e._currentElement.props))return null;var r=v(e);return n&&n[r]},deleteListener:function(e,t){var n=a.registrationNameModules[t];n&&n.willDeleteListener&&n.willDeleteListener(e,t);var r=p[t];if(r){delete r[v(e)]}},deleteAllListeners:function(e){var t=v(e);for(var n in p)if(p.hasOwnProperty(n)&&p[n][t]){var r=a.registrationNameModules[n];r&&r.willDeleteListener&&r.willDeleteListener(e,n),delete p[n][t]}},extractEvents:function(e,t,n,r){for(var i,o=a.plugins,s=0;s0&&void 0!==arguments[0]?arguments[0]:{};return{type:v,payload:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.CLEAR=t.NEW_AUTH_ERR=t.NEW_SPEC_ERR_BATCH=t.NEW_SPEC_ERR=t.NEW_THROWN_ERR_BATCH=t.NEW_THROWN_ERR=void 0,t.newThrownErr=r,t.newThrownErrBatch=i,t.newSpecErr=o,t.newSpecErrBatch=a,t.newAuthErr=s,t.clear=u;var l=n(264),c=function(e){return e&&e.__esModule?e:{default:e}}(l),p=t.NEW_THROWN_ERR="err_new_thrown_err",f=t.NEW_THROWN_ERR_BATCH="err_new_thrown_err_batch",h=t.NEW_SPEC_ERR="err_new_spec_err",d=t.NEW_SPEC_ERR_BATCH="err_new_spec_err_batch",m=t.NEW_AUTH_ERR="err_new_auth_err",v=t.CLEAR="err_clear"},function(e,t,n){var r=n(53),i=n(338),o=n(336),a=n(37),s=n(133),u=n(193),l={},c={},t=e.exports=function(e,t,n,p,f){var h,d,m,v,g=f?function(){return e}:u(e),y=r(n,p,t?2:1),_=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(o(g)){for(h=s(e.length);h>_;_++)if((v=t?y(a(d=e[_])[0],d[1]):y(e[_]))===l||v===c)return v}else for(m=g.call(e);!(d=m.next()).done;)if((v=i(m,y,d.value,t))===l||v===c)return v};t.BREAK=l,t.RETURN=c},function(e,t){e.exports=!0},function(e,t,n){var r=n(134)("meta"),i=n(27),o=n(55),a=n(41).f,s=0,u=Object.isExtensible||function(){return!0},l=!n(54)(function(){return u(Object.preventExtensions({}))}),c=function(e){a(e,r,{value:{i:"O"+ ++s,w:{}}})},p=function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,r)){if(!u(e))return"F";if(!t)return"E";c(e)}return e[r].i},f=function(e,t){if(!o(e,r)){if(!u(e))return!0;if(!t)return!1;c(e)}return e[r].w},h=function(e){return l&&d.NEED&&u(e)&&!o(e,r)&&c(e),e},d=e.exports={KEY:r,NEED:!1,fastKey:p,getWeak:f,onFreeze:h}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var r=n(189),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(135);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){"use strict";var r=n(64),i=n(78),o=n(107),a=n(57),s=n(19);e.exports=function(e,t,n){var u=s(e),l=n(a,u,""[e]),c=l[0],p=l[1];o(function(){var t={};return t[u]=function(){return 7},7!=""[e](t)})&&(i(String.prototype,e,c),r(RegExp.prototype,u,2==t?function(e,t){return p.call(e,this,t)}:function(e){return p.call(e,this)}))}},function(e,t,n){var r=n(62),i=n(641),o=n(660),a=Object.defineProperty;t.f=n(106)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(643),i=n(57);e.exports=function(e){return r(i(e))}},function(e,t,n){"use strict";var r,i=n(373),o=n(376),a=n(728),s=n(733);r=e.exports=function(e,t){var n,r,a,u,l;return arguments.length<2||"string"!=typeof e?(u=t,t=e,e=null):u=arguments[2],null==e?(n=a=!0,r=!1):(n=s.call(e,"c"),r=s.call(e,"e"),a=s.call(e,"w")),l={value:t,configurable:n,enumerable:r,writable:a},u?i(o(u),l):l},r.gs=function(e,t,n){var r,u,l,c;return"string"!=typeof e?(l=n,n=t,t=e,e=null):l=arguments[3],null==t?t=void 0:a(t)?null==n?n=void 0:a(n)||(l=n,n=void 0):(l=t,t=n=void 0),null==e?(r=!0,u=!1):(r=s.call(e,"c"),u=s.call(e,"e")),c={get:t,set:n,configurable:r,enumerable:u},l?i(o(l),c):c}},function(e,t,n){"use strict";e.exports=n(725)("forEach")},function(e,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function i(e){return"number"==typeof e}function o(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!i(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,n,i,s,u,l;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(n=this._events[e],a(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),n.apply(this,s)}else if(o(n))for(s=Array.prototype.slice.call(arguments,1),l=n.slice(),i=l.length,u=0;u0&&this._events[e].length>i&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function n(){this.removeListener(e,n),i||(i=!0,t.apply(this,arguments))}if(!r(t))throw TypeError("listener must be a function");var i=!1;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,t){var n,i,a,s;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],a=n.length,i=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(n)){for(s=a;s-- >0;)if(n[s]===t||n[s].listener&&n[s].listener===t){i=s;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],r(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){return this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,n){"use strict";var r={};e.exports=r},function(e,t,n){"use strict";var r=n(81);e.exports=r.DEFAULT=new r({include:[n(118)],explicit:[n(804),n(803),n(802)]})},function(e,t,n){function r(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e]/;e.exports=i},function(e,t,n){"use strict";var r,i=n(25),o=n(241),a=/^[ \r\n\t\f]/,s=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,u=n(249),l=u(function(e,t){if(e.namespaceURI!==o.svg||"innerHTML"in e)e.innerHTML=t;else{r=r||document.createElement("div"),r.innerHTML=""+t+"";for(var n=r.firstChild;n.firstChild;)e.appendChild(n.firstChild)}});if(i.canUseDOM){var c=document.createElement("div");c.innerHTML=" ",""===c.innerHTML&&(l=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),a.test(t)||"<"===t[0]&&s.test(t)){e.innerHTML=String.fromCharCode(65279)+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t}),c=null}e.exports=l},function(e,t,n){"use strict";function r(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]="number"==typeof e[n]?e[n]:e[n].val);return t}t.__esModule=!0,t.default=r,e.exports=t.default},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,i,o=-1,a=e.posMax,s=e.pos,u=e.isInLabel;if(e.isInLabel)return-1;if(e.labelUnmatchedScopes)return e.labelUnmatchedScopes--,-1;for(e.pos=t+1,e.isInLabel=!0,n=1;e.pos1&&void 0!==arguments[1])||arguments[1];return e=(0,s.normalizeArray)(e),{type:p,payload:{thing:e,shown:t}}}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e=(0,s.normalizeArray)(e),{type:c,payload:{thing:e,mode:t}}}Object.defineProperty(t,"__esModule",{value:!0}),t.SHOW=t.UPDATE_MODE=t.UPDATE_FILTER=t.UPDATE_LAYOUT=void 0,t.updateLayout=r,t.updateFilter=i,t.show=o,t.changeMode=a;var s=n(9),u=t.UPDATE_LAYOUT="layout_update_layout",l=t.UPDATE_FILTER="layout_update_filter",c=t.UPDATE_MODE="layout_update_mode",p=t.SHOW="layout_show"},function(e,t,n){"use strict";function r(e,t){return{type:u,payload:{selectedServerUrl:e,namespace:t}}}function i(e){var t=e.value,n=e.pathMethod;return{type:l,payload:{value:t,pathMethod:n}}}function o(e){var t=e.value,n=e.pathMethod;return{type:c,payload:{value:t,pathMethod:n}}}function a(e){var t=e.value,n=e.path,r=e.method;return{type:p,payload:{value:t,path:n,method:r}}}function s(e){var t=e.server,n=e.namespace,r=e.key,i=e.val;return{type:f,payload:{server:t,namespace:n,key:r,val:i}}}Object.defineProperty(t,"__esModule",{value:!0}),t.setSelectedServer=r,t.setRequestBodyValue=i,t.setRequestContentType=o,t.setResponseContentType=a,t.setServerVariableValue=s;var u=t.UPDATE_SELECTED_SERVER="oas3_set_servers",l=t.UPDATE_REQUEST_BODY_VALUE="oas3_set_request_body_value",c=t.UPDATE_REQUEST_CONTENT_TYPE="oas3_set_request_content_type",p=t.UPDATE_RESPONSE_CONTENT_TYPE="oas3_set_response_content_type",f=t.UPDATE_SERVER_VARIABLE_VALUE="oas3_set_server_variable_value"},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=h(e,t);if(n)return(0,s.default)(n,{declaration:!0,indent:"\t"})}Object.defineProperty(t,"__esModule",{value:!0}),t.memoizedSampleFromSchema=t.memoizedCreateXMLExample=t.sampleXmlFromSchema=t.inferSchema=t.sampleFromSchema=void 0,t.createXMLExample=i;var o=n(9),a=n(1198),s=r(a),u=n(967),l=r(u),c={string:function(){return"string"},string_email:function(){return"user@example.com"},"string_date-time":function(){return(new Date).toISOString()},number:function(){return 0},number_float:function(){return 0},integer:function(){return 0},boolean:function(e){return"boolean"!=typeof e.default||e.default}},p=function(e){e=(0,o.objectify)(e);var t=e,n=t.type,r=t.format,i=c[n+"_"+r]||c[n];return(0,o.isFunc)(i)?i(e):"Unknown Type: "+e.type},f=t.sampleFromSchema=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,o.objectify)(t),i=r.type,a=r.example,s=r.properties,u=r.additionalProperties,l=r.items,c=n.includeReadOnly,f=n.includeWriteOnly;if(void 0!==a)return a;if(!i)if(s)i="object";else{if(!l)return;i="array"}if("object"===i){var h=(0,o.objectify)(s),d={};for(var m in h)h[m].readOnly&&!c||h[m].writeOnly&&!f||(d[m]=e(h[m],n));if(!0===u)d.additionalProp1={};else if(u)for(var v=(0,o.objectify)(u),g=e(v,n),y=1;y<4;y++)d["additionalProp"+y]=g;return d}return"array"===i?[e(l,n)]:t.enum?t.default?t.default:(0,o.normalizeArray)(t.enum)[0]:"file"!==i?p(t):void 0},h=(t.inferSchema=function(e){return e.schema&&(e=e.schema),e.properties&&(e.type="object"),e},t.sampleXmlFromSchema=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,o.objectify)(t),i=r.type,a=r.properties,s=r.additionalProperties,u=r.items,l=r.example,c=n.includeReadOnly,f=n.includeWriteOnly,h=r.default,d={},m={},v=t.xml,g=v.name,y=v.prefix,_=v.namespace,b=r.enum,x=void 0,w=void 0;if(!i)if(a||s)i="object";else{if(!u)return;i="array"}if(g=g||"notagname",x=(y?y+":":"")+g,_){m[y?"xmlns:"+y:"xmlns"]=_}if("array"===i&&u){if(u.xml=u.xml||v||{},u.xml.name=u.xml.name||v.name,v.wrapped)return d[x]=[],Array.isArray(l)?l.forEach(function(t){u.example=t,d[x].push(e(u,n))}):Array.isArray(h)?h.forEach(function(t){u.default=t,d[x].push(e(u,n))}):d[x]=[e(u,n)],m&&d[x].push({_attr:m}),d;var k=[];return Array.isArray(l)?(l.forEach(function(t){u.example=t,k.push(e(u,n))}),k):Array.isArray(h)?(h.forEach(function(t){u.default=t,k.push(e(u,n))}),k):e(u,n)}if("object"===i){var E=(0,o.objectify)(a);d[x]=[],l=l||{};for(var S in E)if(E.hasOwnProperty(S)&&(!E[S].readOnly||c)&&(!E[S].writeOnly||f))if(E[S].xml=E[S].xml||{},E[S].xml.attribute){var C=Array.isArray(E[S].enum)&&E[S].enum[0],A=E[S].example,D=E[S].default;m[E[S].xml.name||S]=void 0!==A&&A||void 0!==l[S]&&l[S]||void 0!==D&&D||C||p(E[S])}else{E[S].xml.name=E[S].xml.name||S,E[S].example=void 0!==E[S].example?E[S].example:l[S];var O=e(E[S]);Array.isArray(O)?d[x]=d[x].concat(O):d[x].push(O)}return!0===s?d[x].push({additionalProp:"Anything can be here"}):s&&d[x].push({additionalProp:p(s)}),m&&d[x].push({_attr:m}),d}return w=void 0!==l?l:void 0!==h?h:Array.isArray(b)?b[0]:p(t),d[x]=m?[{_attr:m},w]:w,d});t.memoizedCreateXMLExample=(0,l.default)(i),t.memoizedSampleFromSchema=(0,l.default)(f)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=X(e).replace(/\t/g," ");if("string"==typeof e)return{type:R,payload:t}}function o(e){return{type:J,payload:e}}function a(e){return{type:j,payload:e}}function s(e){return{type:F,payload:e}}function u(e,t,n,r,i){return{type:N,payload:{path:e,value:r,paramName:t,paramIn:n,isXml:i}}}function l(e){return{type:H,payload:{pathMethod:e}}}function c(e,t){return{type:G,payload:{path:e,value:t,key:"consumes_value"}}}function p(e,t){return{type:G,payload:{path:e,value:t,key:"produces_value"}}}function f(e,t){return{type:W,payload:{path:e,method:t}}}function h(e,t){return{type:V,payload:{path:e,method:t}}}function d(e,t,n){return{type:K,payload:{scheme:e,path:t,method:n}}}Object.defineProperty(t,"__esModule",{value:!0}),t.execute=t.executeRequest=t.logRequest=t.setMutatedRequest=t.setRequest=t.setResponse=t.validateParams=t.resolveSpec=t.parseToJson=t.SET_SCHEME=t.UPDATE_RESOLVED=t.UPDATE_OPERATION_VALUE=t.CLEAR_VALIDATE_PARAMS=t.CLEAR_REQUEST=t.CLEAR_RESPONSE=t.LOG_REQUEST=t.SET_MUTATED_REQUEST=t.SET_REQUEST=t.SET_RESPONSE=t.VALIDATE_PARAMS=t.UPDATE_PARAM=t.UPDATE_JSON=t.UPDATE_URL=t.UPDATE_SPEC=void 0;var m=n(21),v=r(m),g=n(96),y=r(g),_=n(35),b=r(_),x=n(47),w=r(x),k=n(48),E=r(k);t.updateSpec=i,t.updateResolved=o,t.updateUrl=a,t.updateJsonSpec=s,t.changeParam=u,t.clearValidateParams=l,t.changeConsumesValue=c,t.changeProducesValue=p,t.clearResponse=f,t.clearRequest=h,t.setScheme=d;var S=n(211),C=r(S),A=n(1186),D=r(A),O=n(264),M=r(O),T=n(422),P=r(T),I=n(9),R=t.UPDATE_SPEC="spec_update_spec",j=t.UPDATE_URL="spec_update_url",F=t.UPDATE_JSON="spec_update_json",N=t.UPDATE_PARAM="spec_update_param",B=t.VALIDATE_PARAMS="spec_validate_param",L=t.SET_RESPONSE="spec_set_response",q=t.SET_REQUEST="spec_set_request",z=t.SET_MUTATED_REQUEST="spec_set_mutated_request",U=t.LOG_REQUEST="spec_log_request",W=t.CLEAR_RESPONSE="spec_clear_response",V=t.CLEAR_REQUEST="spec_clear_request",H=t.CLEAR_VALIDATE_PARAMS="spec_clear_validate_param",G=t.UPDATE_OPERATION_VALUE="spec_update_operation_value",J=t.UPDATE_RESOLVED="spec_update_resolved",K=t.SET_SCHEME="set_scheme",X=function(e){return(0,P.default)(e)?e:""},Y=(t.parseToJson=function(e){return function(t){var n=t.specActions,r=t.specSelectors,i=t.errActions,o=r.specStr,a=null;try{e=e||o(),i.clear({source:"parser"}),a=C.default.safeLoad(e)}catch(e){return console.error(e),i.newSpecErr({source:"parser",level:"error",message:e.reason,line:e.mark&&e.mark.line?e.mark.line+1:void 0})}return a&&"object"===(void 0===a?"undefined":(0,E.default)(a))?n.updateJsonSpec(a):{}}},t.resolveSpec=function(e,t){return function(n){var r=n.specActions,i=n.specSelectors,o=n.errActions,a=n.fn,s=a.fetch,u=a.resolve,l=a.AST,c=n.getConfigs,p=c(),f=p.modelPropertyMacro,h=p.parameterMacro,d=p.requestInterceptor,m=p.responseInterceptor;void 0===e&&(e=i.specJson()),void 0===t&&(t=i.url());var v=l.getLineNumberForPath,g=i.specStr();return u({fetch:s,spec:e,baseDoc:t,modelPropertyMacro:f,parameterMacro:h,requestInterceptor:d,responseInterceptor:m}).then(function(e){var t=e.spec,n=e.errors;if(o.clear({type:"thrown"}),Array.isArray(n)&&n.length>0){var i=n.map(function(e){return console.error(e),e.line=e.fullPath?v(g,e.fullPath):null,e.path=e.fullPath?e.fullPath.join("."):null,e.level="error",e.type="thrown",e.source="resolver",Object.defineProperty(e,"message",{enumerable:!0,value:e.message}),e});o.newThrownErrBatch(i)}return r.updateResolved(t)})}},t.validateParams=function(e,t){return{type:B,payload:{pathMethod:e,isOAS3:t}}},t.setResponse=function(e,t,n){return{payload:{path:e,method:t,res:n},type:L}},t.setRequest=function(e,t,n){return{payload:{path:e,method:t,req:n},type:q}},t.setMutatedRequest=function(e,t,n){return{payload:{path:e,method:t,req:n},type:z}},t.logRequest=function(e){return{payload:e,type:U}},t.executeRequest=function(e){return function(t){var n=t.fn,r=t.specActions,i=t.specSelectors,o=t.getConfigs,a=t.oas3Selectors,s=e.pathName,u=e.method,l=e.operation,c=o(),p=c.requestInterceptor,f=c.responseInterceptor,h=l.toJS();if(e.contextUrl=(0,D.default)(i.url()).toString(),h&&h.operationId?e.operationId=h.operationId:h&&s&&u&&(e.operationId=n.opId(h,s,u)),i.isOAS3()){var d=s+":"+u;e.server=a.selectedServer(d)||a.selectedServer();var m=a.serverVariables({server:e.server,namespace:d}).toJS(),v=a.serverVariables({server:e.server}).toJS();e.serverVariables=(0,w.default)(m).length?m:v,e.requestContentType=a.requestContentType(s,u),e.responseContentType=a.responseContentType(s,u)||"*/*";var g=a.requestBodyValue(s,u);(0,I.isJSONObject)(g)?e.requestBody=JSON.parse(g):e.requestBody=g}var y=(0,b.default)({},e);y=n.buildRequest(y),r.setRequest(e.pathName,e.method,y);var _=function(t){var n=p.apply(this,[t]),i=(0,b.default)({},n);return r.setMutatedRequest(e.pathName,e.method,i),n};e.requestInterceptor=_,e.responseInterceptor=f;var x=Date.now();return n.execute(e).then(function(t){t.duration=Date.now()-x,r.setResponse(e.pathName,e.method,t)}).catch(function(t){return r.setResponse(e.pathName,e.method,{error:!0,err:(0,M.default)(t)})})}},function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.path,n=e.method,r=(0,y.default)(e,["path","method"]);return function(e){var i=e.fn.fetch,o=e.specSelectors,a=e.specActions,s=o.spec().toJS(),u=o.operationScheme(t,n),l=o.contentTypeValues([t,n]).toJS(),c=l.requestContentType,p=l.responseContentType,f=/xml/i.test(c),h=o.parameterValues([t,n],f).toJS();return a.executeRequest((0,v.default)({fetch:i,spec:s,pathName:t,method:n,parameters:h,requestContentType:c,scheme:u,responseContentType:p},r))}});t.execute=Y},function(e,t,n){"use strict";function r(e){switch(e._type){case"document":case"block_quote":case"list":case"item":case"paragraph":case"heading":case"emph":case"strong":case"link":case"image":case"custom_inline":case"custom_block":return!0;default:return!1}}var i=function(e,t){this.current=e,this.entering=!0===t},o=function(){var e=this.current,t=this.entering;if(null===e)return null;var n=r(e);return t&&n?e._firstChild?(this.current=e._firstChild,this.entering=!0):this.entering=!1:e===this.root?this.current=null:null===e._next?(this.current=e._parent,this.entering=!1):(this.current=e._next,this.entering=!0),{entering:t,node:e}},a=function(e){return{current:e,root:e,entering:!0,next:o,resumeAt:i}},s=function(e,t){this._type=e,this._parent=null,this._firstChild=null,this._lastChild=null,this._prev=null,this._next=null,this._sourcepos=t,this._lastLineBlank=!1,this._open=!0,this._string_content=null,this._literal=null,this._listData={},this._info=null,this._destination=null,this._title=null,this._isFenced=!1,this._fenceChar=null,this._fenceLength=0,this._fenceOffset=null,this._level=null,this._onEnter=null,this._onExit=null},u=s.prototype;Object.defineProperty(u,"isContainer",{get:function(){return r(this)}}),Object.defineProperty(u,"type",{get:function(){return this._type}}),Object.defineProperty(u,"firstChild",{get:function(){return this._firstChild}}),Object.defineProperty(u,"lastChild",{get:function(){return this._lastChild}}),Object.defineProperty(u,"next",{get:function(){return this._next}}),Object.defineProperty(u,"prev",{get:function(){return this._prev}}),Object.defineProperty(u,"parent",{get:function(){return this._parent}}),Object.defineProperty(u,"sourcepos",{get:function(){return this._sourcepos}}),Object.defineProperty(u,"literal",{get:function(){return this._literal},set:function(e){this._literal=e}}),Object.defineProperty(u,"destination",{get:function(){return this._destination},set:function(e){this._destination=e}}),Object.defineProperty(u,"title",{get:function(){return this._title},set:function(e){this._title=e}}),Object.defineProperty(u,"info",{get:function(){return this._info},set:function(e){this._info=e}}),Object.defineProperty(u,"level",{get:function(){return this._level},set:function(e){this._level=e}}),Object.defineProperty(u,"listType",{get:function(){return this._listData.type},set:function(e){this._listData.type=e}}),Object.defineProperty(u,"listTight",{get:function(){return this._listData.tight},set:function(e){this._listData.tight=e}}),Object.defineProperty(u,"listStart",{get:function(){return this._listData.start},set:function(e){this._listData.start=e}}),Object.defineProperty(u,"listDelimiter",{get:function(){return this._listData.delimiter},set:function(e){this._listData.delimiter=e}}),Object.defineProperty(u,"onEnter",{get:function(){return this._onEnter},set:function(e){this._onEnter=e}}),Object.defineProperty(u,"onExit",{get:function(){return this._onExit},set:function(e){this._onExit=e}}),s.prototype.appendChild=function(e){e.unlink(),e._parent=this,this._lastChild?(this._lastChild._next=e,e._prev=this._lastChild,this._lastChild=e):(this._firstChild=e,this._lastChild=e)},s.prototype.prependChild=function(e){e.unlink(),e._parent=this,this._firstChild?(this._firstChild._prev=e,e._next=this._firstChild,this._firstChild=e):(this._firstChild=e,this._lastChild=e)},s.prototype.unlink=function(){this._prev?this._prev._next=this._next:this._parent&&(this._parent._firstChild=this._next),this._next?this._next._prev=this._prev:this._parent&&(this._parent._lastChild=this._prev),this._parent=null,this._next=null,this._prev=null},s.prototype.insertAfter=function(e){e.unlink(),e._next=this._next,e._next&&(e._next._prev=e),e._prev=this,this._next=e,e._parent=this._parent,e._next||(e._parent._lastChild=e)},s.prototype.insertBefore=function(e){e.unlink(),e._prev=this._prev,e._prev&&(e._prev._next=e),e._next=this,this._prev=e,e._parent=this._parent,e._prev||(e._parent._firstChild=e)},s.prototype.walker=function(){return new a(this)},e.exports=s},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(53),i=n(181),o=n(76),a=n(133),s=n(601);e.exports=function(e,t){var n=1==e,u=2==e,l=3==e,c=4==e,p=6==e,f=5==e||p,h=t||s;return function(t,s,d){for(var m,v,g=o(t),y=i(g),_=r(s,d,3),b=a(y.length),x=0,w=n?h(t,b):u?h(t,0):void 0;b>x;x++)if((f||x in y)&&(m=y[x],v=_(m,x,g),e))if(n)w[x]=v;else if(v)switch(e){case 3:return!0;case 5:return m;case 6:return x;case 2:w.push(m)}else if(c)return!1;return p?-1:l||c?c:w}}},function(e,t,n){var r=n(99),i=n(22)("toStringTag"),o="Arguments"==r(function(){return arguments}()),a=function(e,t){try{return e[t]}catch(e){}};e.exports=function(e){var t,n,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=a(t=Object(e),i))?n:o?r(t):"Object"==(s=r(t))&&"function"==typeof t.callee?"Arguments":s}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(27),i=n(24).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(99);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){"use strict";function r(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=i(t),this.reject=i(n)}var i=n(98);e.exports.f=function(e){return new r(e)}},function(e,t,n){var r=n(37),i=n(610),o=n(180),a=n(187)("IE_PROTO"),s=function(){},u=function(){var e,t=n(179)("iframe"),r=o.length;for(t.style.display="none",n(334).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write("