1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-05-02 00:20:13 -04:00

PlutoSDR input: simplify convert method parameters

This commit is contained in:
f4exb 2017-09-08 08:45:24 +02:00
parent 450a44036e
commit 3c20b02602
2 changed files with 22 additions and 22 deletions

View File

@ -95,7 +95,7 @@ void PlutoSDRInputThread::run()
if (is == ((1<<m_log2Decim) - 1)) if (is == ((1<<m_log2Decim) - 1))
{ {
convert(m_buf, 2*(1<<m_log2Decim)); // I+Q -> 2 convert(); // I+Q -> 2
is = 0; is = 0;
} }
else else
@ -109,11 +109,11 @@ void PlutoSDRInputThread::run()
} }
// Decimate according to specified log2 (ex: log2=4 => decim=16) // Decimate according to specified log2 (ex: log2=4 => decim=16)
void PlutoSDRInputThread::convert(const qint16* buf, qint32 len) void PlutoSDRInputThread::convert()
{ {
if (m_log2Decim == 0) if (m_log2Decim == 0)
{ {
m_decimators.decimate1(&m_convertIt, buf, len); m_decimators.decimate1(&m_convertIt, m_buf, 2*(1<<m_log2Decim));
} }
else else
{ {
@ -122,22 +122,22 @@ void PlutoSDRInputThread::convert(const qint16* buf, qint32 len)
switch (m_log2Decim) switch (m_log2Decim)
{ {
case 1: case 1:
m_decimators.decimate2_inf(&m_convertIt, buf, len); m_decimators.decimate2_inf(&m_convertIt, m_buf, 2*(1<<m_log2Decim));
break; break;
case 2: case 2:
m_decimators.decimate4_inf(&m_convertIt, buf, len); m_decimators.decimate4_inf(&m_convertIt, m_buf, 2*(1<<m_log2Decim));
break; break;
case 3: case 3:
m_decimators.decimate8_inf(&m_convertIt, buf, len); m_decimators.decimate8_inf(&m_convertIt, m_buf, 2*(1<<m_log2Decim));
break; break;
case 4: case 4:
m_decimators.decimate16_inf(&m_convertIt, buf, len); m_decimators.decimate16_inf(&m_convertIt, m_buf, 2*(1<<m_log2Decim));
break; break;
case 5: case 5:
m_decimators.decimate32_inf(&m_convertIt, buf, len); m_decimators.decimate32_inf(&m_convertIt, m_buf, 2*(1<<m_log2Decim));
break; break;
case 6: case 6:
m_decimators.decimate64_inf(&m_convertIt, buf, len); m_decimators.decimate64_inf(&m_convertIt, m_buf, 2*(1<<m_log2Decim));
break; break;
default: default:
break; break;
@ -148,22 +148,22 @@ void PlutoSDRInputThread::convert(const qint16* buf, qint32 len)
switch (m_log2Decim) switch (m_log2Decim)
{ {
case 1: case 1:
m_decimators.decimate2_sup(&m_convertIt, buf, len); m_decimators.decimate2_sup(&m_convertIt, m_buf, 2*(1<<m_log2Decim));
break; break;
case 2: case 2:
m_decimators.decimate4_sup(&m_convertIt, buf, len); m_decimators.decimate4_sup(&m_convertIt, m_buf, 2*(1<<m_log2Decim));
break; break;
case 3: case 3:
m_decimators.decimate8_sup(&m_convertIt, buf, len); m_decimators.decimate8_sup(&m_convertIt, m_buf, 2*(1<<m_log2Decim));
break; break;
case 4: case 4:
m_decimators.decimate16_sup(&m_convertIt, buf, len); m_decimators.decimate16_sup(&m_convertIt, m_buf, 2*(1<<m_log2Decim));
break; break;
case 5: case 5:
m_decimators.decimate32_sup(&m_convertIt, buf, len); m_decimators.decimate32_sup(&m_convertIt, m_buf, 2*(1<<m_log2Decim));
break; break;
case 6: case 6:
m_decimators.decimate64_sup(&m_convertIt, buf, len); m_decimators.decimate64_sup(&m_convertIt, m_buf, 2*(1<<m_log2Decim));
break; break;
default: default:
break; break;
@ -174,22 +174,22 @@ void PlutoSDRInputThread::convert(const qint16* buf, qint32 len)
switch (m_log2Decim) switch (m_log2Decim)
{ {
case 1: case 1:
m_decimators.decimate2_cen(&m_convertIt, buf, len); m_decimators.decimate2_cen(&m_convertIt, m_buf, 2*(1<<m_log2Decim));
break; break;
case 2: case 2:
m_decimators.decimate4_cen(&m_convertIt, buf, len); m_decimators.decimate4_cen(&m_convertIt, m_buf, 2*(1<<m_log2Decim));
break; break;
case 3: case 3:
m_decimators.decimate8_cen(&m_convertIt, buf, len); m_decimators.decimate8_cen(&m_convertIt, m_buf, 2*(1<<m_log2Decim));
break; break;
case 4: case 4:
m_decimators.decimate16_cen(&m_convertIt, buf, len); m_decimators.decimate16_cen(&m_convertIt, m_buf, 2*(1<<m_log2Decim));
break; break;
case 5: case 5:
m_decimators.decimate32_cen(&m_convertIt, buf, len); m_decimators.decimate32_cen(&m_convertIt, m_buf, 2*(1<<m_log2Decim));
break; break;
case 6: case 6:
m_decimators.decimate64_cen(&m_convertIt, buf, len); m_decimators.decimate64_cen(&m_convertIt, m_buf, 2*(1<<m_log2Decim));
break; break;
default: default:
break; break;

View File

@ -60,7 +60,7 @@ private:
Decimators<qint16, SDR_SAMP_SZ, 12> m_decimators; Decimators<qint16, SDR_SAMP_SZ, 12> m_decimators;
void run(); void run();
void convert(const qint16* buf, qint32 len); void convert();
}; };