Mooooore performance

This commit is contained in:
Ryzerth
2021-06-30 02:48:36 +02:00
parent 24892c854e
commit 8f4942bbe9
4 changed files with 7 additions and 12 deletions

View File

@ -361,10 +361,7 @@ private:
HackRFSourceModule* _this = (HackRFSourceModule*)transfer->rx_ctx;
int count = transfer->valid_length / 2;
int8_t* buffer = (int8_t*)transfer->buffer;
for (int i = 0; i < count; i++) {
_this->stream.writeBuf[i].re = (float)buffer[i * 2] / 128.0f;
_this->stream.writeBuf[i].im = (float)buffer[(i * 2) + 1] / 128.0f;
}
volk_8i_s32f_convert_32f((float*)_this->stream.writeBuf, buffer, 128.0f, count*2);
if (!_this->stream.swap(count)) { return -1; }
return 0;
}