1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-09-27 07:16:48 -04:00

ATV Demod: optimize scope feed

This commit is contained in:
f4exb 2017-04-09 17:43:23 +02:00
parent 40b5e7467f
commit 29b691a5af
2 changed files with 8 additions and 5 deletions

View File

@ -221,10 +221,9 @@ void ATVDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
if ((m_objRunning.m_intVideoTabIndex == 1) && (m_objScopeSink != 0)) // do only if scope tab is selected and scope is available
{
m_objScopeSink->feed(m_objScopeSampleBuffer.begin(), m_objScopeSampleBuffer.end(), false); // m_ssb = positive only
m_objScopeSampleBuffer.clear();
}
m_objScopeSampleBuffer.clear();
if (ptrBufferToRelease != 0)
{
delete ptrBufferToRelease;
@ -404,10 +403,12 @@ void ATVDemod::demod(Complex& c)
fltVal = 0.0f;
}
fltVal = (fltVal < -1.0f) ? -1.0f : (fltVal > 1.0f) ? 1.0f : fltVal;
m_objScopeSampleBuffer.push_back(Sample(fltVal*32767.0f, 0.0f));
fltVal = m_objRunning.m_blnInvertVideo ? 1.0f - fltVal : fltVal;
fltVal = (fltVal < -1.0f) ? -1.0f : (fltVal > 1.0f) ? 1.0f : fltVal;
if ((m_objRunning.m_intVideoTabIndex == 1) && (m_objScopeSink != 0)) { // feed scope buffer only if scope is present and visible
m_objScopeSampleBuffer.push_back(Sample(fltVal*32767.0f, 0.0f));
}
m_fltAmpLineAverage += fltVal;

View File

@ -385,6 +385,8 @@ private:
AvgExpInt m_objAvgColIndex;
int m_intAvgColIndex;
SampleVector m_sampleBuffer;
//*************** RF ***************
MovingAverage<double> m_objMagSqAverage;