1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-01 21:54:55 -04:00

Floating point to integer decimator optimization using the even/odd algorithm

This commit is contained in:
f4exb
2018-04-29 22:56:34 +02:00
parent 1213ad2a71
commit 48cc6df8a7
4 changed files with 258 additions and 25 deletions
+18 -18
View File
@@ -32,7 +32,7 @@ void DecimatorsFI::decimate1(SampleVector::iterator* it, const float* buf, qint3
void DecimatorsFI::decimate2_cen(SampleVector::iterator* it, const float* buf, qint32 nbIAndQ)
{
double intbuf[2];
float intbuf[2];
for (int pos = 0; pos < nbIAndQ - 3; pos += 4)
{
@@ -54,7 +54,7 @@ void DecimatorsFI::decimate2_cen(SampleVector::iterator* it, const float* buf, q
void DecimatorsFI::decimate2_inf(SampleVector::iterator* it, const float* buf, qint32 nbIAndQ)
{
double xreal, yimag;
float xreal, yimag;
for (int pos = 0; pos < nbIAndQ - 7; pos += 8)
{
@@ -74,7 +74,7 @@ void DecimatorsFI::decimate2_inf(SampleVector::iterator* it, const float* buf, q
void DecimatorsFI::decimate2_sup(SampleVector::iterator* it, const float* buf, qint32 nbIAndQ)
{
double xreal, yimag;
float xreal, yimag;
for (int pos = 0; pos < nbIAndQ - 7; pos += 8)
{
@@ -94,7 +94,7 @@ void DecimatorsFI::decimate2_sup(SampleVector::iterator* it, const float* buf, q
void DecimatorsFI::decimate4_inf(SampleVector::iterator* it, const float* buf, qint32 nbIAndQ)
{
double xreal, yimag;
float xreal, yimag;
for (int pos = 0; pos < nbIAndQ - 7; pos += 8)
{
@@ -116,7 +116,7 @@ void DecimatorsFI::decimate4_sup(SampleVector::iterator* it, const float* buf, q
// Inf (LSB):
// x y x y x y x y / x -> 0,-3,-4,7 / y -> 1,2,-5,-6
// [ rotate: 0, 1, -3, 2, -4, -5, 7, -6]
double xreal, yimag;
float xreal, yimag;
for (int pos = 0; pos < nbIAndQ - 7; pos += 8)
{
@@ -132,7 +132,7 @@ void DecimatorsFI::decimate4_sup(SampleVector::iterator* it, const float* buf, q
void DecimatorsFI::decimate8_inf(SampleVector::iterator* it, const float* buf, qint32 nbIAndQ)
{
double xreal[2], yimag[2];
float xreal[2], yimag[2];
for (int pos = 0; pos < nbIAndQ - 15; pos += 8)
{
@@ -154,7 +154,7 @@ void DecimatorsFI::decimate8_inf(SampleVector::iterator* it, const float* buf, q
void DecimatorsFI::decimate8_sup(SampleVector::iterator* it, const float* buf, qint32 nbIAndQ)
{
double xreal[2], yimag[2];
float xreal[2], yimag[2];
for (int pos = 0; pos < nbIAndQ - 15; pos += 8)
{
@@ -178,7 +178,7 @@ void DecimatorsFI::decimate16_inf(SampleVector::iterator* it, const float* buf,
{
// Offset tuning: 4x downsample and rotate, then
// downsample 4x more. [ rotate: 0, 1, -3, 2, -4, -5, 7, -6]
double xreal[4], yimag[4];
float xreal[4], yimag[4];
for (int pos = 0; pos < nbIAndQ - 31; )
{
@@ -205,7 +205,7 @@ void DecimatorsFI::decimate16_sup(SampleVector::iterator* it, const float* buf,
{
// Offset tuning: 4x downsample and rotate, then
// downsample 4x more. [ rotate: 1, 0, -2, 3, -5, -4, 6, -7]
double xreal[4], yimag[4];
float xreal[4], yimag[4];
for (int pos = 0; pos < nbIAndQ - 31; )
{
@@ -230,7 +230,7 @@ void DecimatorsFI::decimate16_sup(SampleVector::iterator* it, const float* buf,
void DecimatorsFI::decimate32_inf(SampleVector::iterator* it, const float* buf, qint32 nbIAndQ)
{
double xreal[8], yimag[8];
float xreal[8], yimag[8];
for (int pos = 0; pos < nbIAndQ - 63; )
{
@@ -260,7 +260,7 @@ void DecimatorsFI::decimate32_inf(SampleVector::iterator* it, const float* buf,
void DecimatorsFI::decimate32_sup(SampleVector::iterator* it, const float* buf, qint32 nbIAndQ)
{
double xreal[8], yimag[8];
float xreal[8], yimag[8];
for (int pos = 0; pos < nbIAndQ - 63; )
{
@@ -290,7 +290,7 @@ void DecimatorsFI::decimate32_sup(SampleVector::iterator* it, const float* buf,
void DecimatorsFI::decimate64_inf(SampleVector::iterator* it, const float* buf, qint32 nbIAndQ)
{
double xreal[16], yimag[16];
float xreal[16], yimag[16];
for (int pos = 0; pos < nbIAndQ - 127; )
{
@@ -329,7 +329,7 @@ void DecimatorsFI::decimate64_inf(SampleVector::iterator* it, const float* buf,
void DecimatorsFI::decimate64_sup(SampleVector::iterator* it, const float* buf, qint32 nbIAndQ)
{
double xreal[16], yimag[16];
float xreal[16], yimag[16];
for (int pos = 0; pos < nbIAndQ - 127; )
{
@@ -368,7 +368,7 @@ void DecimatorsFI::decimate64_sup(SampleVector::iterator* it, const float* buf,
void DecimatorsFI::decimate4_cen(SampleVector::iterator* it, const float* buf, qint32 nbIAndQ)
{
double intbuf[4];
float intbuf[4];
for (int pos = 0; pos < nbIAndQ - 7; pos += 8)
{
@@ -402,7 +402,7 @@ void DecimatorsFI::decimate4_cen(SampleVector::iterator* it, const float* buf, q
void DecimatorsFI::decimate8_cen(SampleVector::iterator* it, const float* buf, qint32 nbIAndQ)
{
double intbuf[8];
float intbuf[8];
for (int pos = 0; pos < nbIAndQ - 15; pos += 16)
{
@@ -461,7 +461,7 @@ void DecimatorsFI::decimate8_cen(SampleVector::iterator* it, const float* buf, q
void DecimatorsFI::decimate16_cen(SampleVector::iterator* it, const float* buf, qint32 nbIAndQ)
{
double intbuf[16];
float intbuf[16];
for (int pos = 0; pos < nbIAndQ - 31; pos += 32)
{
@@ -569,7 +569,7 @@ void DecimatorsFI::decimate16_cen(SampleVector::iterator* it, const float* buf,
void DecimatorsFI::decimate32_cen(SampleVector::iterator* it, const float* buf, qint32 nbIAndQ)
{
double intbuf[32];
float intbuf[32];
for (int pos = 0; pos < nbIAndQ - 63; pos += 64)
{
@@ -774,7 +774,7 @@ void DecimatorsFI::decimate32_cen(SampleVector::iterator* it, const float* buf,
void DecimatorsFI::decimate64_cen(SampleVector::iterator* it, const float* buf, qint32 nbIAndQ)
{
double intbuf[64];
float intbuf[64];
for (int pos = 0; pos < nbIAndQ - 127; pos += 128)
{