1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-06-16 13:32:27 -04:00

Facepalm.

This commit is contained in:
John Greb 2014-11-11 12:01:42 +00:00
parent b68e76a66d
commit 1a46bf391e

View File

@ -77,7 +77,7 @@ void RTLSDRThread::run()
void RTLSDRThread::decimate2(SampleVector::iterator* it, const quint8* buf, qint32 len) void RTLSDRThread::decimate2(SampleVector::iterator* it, const quint8* buf, qint32 len)
{ {
qint16 xreal, yimag; qint16 xreal, yimag;
for (int pos = 0; pos < len + 7; pos += 8) { for (int pos = 0; pos < len - 7; pos += 8) {
xreal = buf[pos+0] - buf[pos+3]; xreal = buf[pos+0] - buf[pos+3];
yimag = buf[pos+1] + buf[pos+2] - 255; yimag = buf[pos+1] + buf[pos+2] - 255;
Sample s( xreal << 3, yimag << 3 ); Sample s( xreal << 3, yimag << 3 );
@ -93,7 +93,7 @@ void RTLSDRThread::decimate2(SampleVector::iterator* it, const quint8* buf, qint
void RTLSDRThread::decimate4(SampleVector::iterator* it, const quint8* buf, qint32 len) void RTLSDRThread::decimate4(SampleVector::iterator* it, const quint8* buf, qint32 len)
{ {
qint16 xreal, yimag; qint16 xreal, yimag;
for (int pos = 0; pos < len + 7; pos += 8) { for (int pos = 0; pos < len - 7; pos += 8) {
xreal = buf[pos+0] - buf[pos+3] + buf[pos+7] - buf[pos+4]; xreal = buf[pos+0] - buf[pos+3] + buf[pos+7] - buf[pos+4];
yimag = buf[pos+1] - buf[pos+5] + buf[pos+2] - buf[pos+6]; yimag = buf[pos+1] - buf[pos+5] + buf[pos+2] - buf[pos+6];
Sample s( xreal << 4, yimag << 4 ); Sample s( xreal << 4, yimag << 4 );
@ -105,7 +105,7 @@ void RTLSDRThread::decimate4(SampleVector::iterator* it, const quint8* buf, qint
void RTLSDRThread::decimate8(SampleVector::iterator* it, const quint8* buf, qint32 len) void RTLSDRThread::decimate8(SampleVector::iterator* it, const quint8* buf, qint32 len)
{ {
qint16 xreal, yimag; qint16 xreal, yimag;
for (int pos = 0; pos < len + 15; pos += 8) { for (int pos = 0; pos < len - 15; pos += 8) {
xreal = buf[pos+0] - buf[pos+3] + buf[pos+7] - buf[pos+4]; xreal = buf[pos+0] - buf[pos+3] + buf[pos+7] - buf[pos+4];
yimag = buf[pos+1] - buf[pos+5] + buf[pos+2] - buf[pos+6]; yimag = buf[pos+1] - buf[pos+5] + buf[pos+2] - buf[pos+6];
pos += 8; pos += 8;