1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-19 06:41:47 -05:00

SDRdaemonFEC support: debug (7). Corrected CM256 parameters specification fixing decoding

This commit is contained in:
f4exb 2016-06-23 01:31:40 +02:00
parent 278f085dbc
commit aea9bf866e

View File

@ -40,6 +40,8 @@ SDRdaemonFECBuffer::SDRdaemonFECBuffer(uint32_t throttlems) :
m_outputMeta.init(); m_outputMeta.init();
m_framesNbBytes = nbDecoderSlots * sizeof(BufferFrame); m_framesNbBytes = nbDecoderSlots * sizeof(BufferFrame);
m_wrDeltaEstimate = m_framesNbBytes / 2; m_wrDeltaEstimate = m_framesNbBytes / 2;
m_paramsCM256.BlockBytes = sizeof(ProtectedBlock); // never changes
m_paramsCM256.OriginalCount = m_nbOriginalBlocks; // never changes
} }
SDRdaemonFECBuffer::~SDRdaemonFECBuffer() SDRdaemonFECBuffer::~SDRdaemonFECBuffer()
@ -194,6 +196,8 @@ void SDRdaemonFECBuffer::writeData(char *array, uint32_t length)
m_decoderSlots[decoderIndex].m_blockCount++; m_decoderSlots[decoderIndex].m_blockCount++;
} }
else if (!m_decoderSlots[decoderIndex].m_decoded) // ready to decode else if (!m_decoderSlots[decoderIndex].m_decoded) // ready to decode
{
if (m_decoderSlots[decoderIndex].m_recoveryCount > 0) // recovery data used
{ {
if (m_decoderSlots[decoderIndex].m_metaRetrieved) // block zero with its meta data has been received if (m_decoderSlots[decoderIndex].m_metaRetrieved) // block zero with its meta data has been received
{ {
@ -204,17 +208,19 @@ void SDRdaemonFECBuffer::writeData(char *array, uint32_t length)
m_paramsCM256.RecoveryCount = m_currentMeta.m_nbFECBlocks; // take last stored value for number of FEC blocks m_paramsCM256.RecoveryCount = m_currentMeta.m_nbFECBlocks; // take last stored value for number of FEC blocks
} }
if (m_decoderSlots[decoderIndex].m_recoveryCount > 0) // recovery data used
{
if (cm256_decode(m_paramsCM256, m_decoderSlots[decoderIndex].m_cm256DescriptorBlocks)) // failure to decode if (cm256_decode(m_paramsCM256, m_decoderSlots[decoderIndex].m_cm256DescriptorBlocks)) // failure to decode
{ {
qDebug("SDRdaemonFECBuffer::writeAndRead: CM256 decode error"); qDebug() << "SDRdaemonFECBuffer::writeData: CM256 decode error:"
<< " BlockBytes: " << m_paramsCM256.BlockBytes
<< " OriginalCount: " << m_paramsCM256.OriginalCount
<< " RecoveryCount: " << m_paramsCM256.RecoveryCount
<< " m_recoveryCount: " << m_decoderSlots[decoderIndex].m_recoveryCount;
} }
else // success to decode else // success to decode
{ {
int nbOriginalBlocks = m_decoderSlots[decoderIndex].m_blockCount - m_decoderSlots[decoderIndex].m_recoveryCount; int nbOriginalBlocks = m_decoderSlots[decoderIndex].m_blockCount - m_decoderSlots[decoderIndex].m_recoveryCount;
qDebug() << "SDRdaemonFECBuffer::writeData:" qDebug() << "SDRdaemonFECBuffer::writeData: CM256 decode success:"
<< " nbOriginalBlocks: " << nbOriginalBlocks << " nbOriginalBlocks: " << nbOriginalBlocks
<< " m_recoveryCount: " << m_decoderSlots[decoderIndex].m_recoveryCount; << " m_recoveryCount: " << m_decoderSlots[decoderIndex].m_recoveryCount;
@ -251,7 +257,7 @@ void SDRdaemonFECBuffer::writeData(char *array, uint32_t length)
m_bufferLenSec = (float) m_framesNbBytes / (float) sampleRate; m_bufferLenSec = (float) m_framesNbBytes / (float) sampleRate;
} }
printMeta("SDRdaemonFECBuffer::writeData", &m_decoderSlots[decoderIndex].m_blockZero.m_metaData); // print for change other than timestamp printMeta("SDRdaemonFECBuffer::writeData: new meta", &m_decoderSlots[decoderIndex].m_blockZero.m_metaData); // print for change other than timestamp
} }
m_currentMeta = m_decoderSlots[decoderIndex].m_blockZero.m_metaData; // renew current meta m_currentMeta = m_decoderSlots[decoderIndex].m_blockZero.m_metaData; // renew current meta