diff --git a/Transceiver52M/Channelizer.cpp b/Transceiver52M/Channelizer.cpp index 2d817b0a..a18dd036 100644 --- a/Transceiver52M/Channelizer.cpp +++ b/Transceiver52M/Channelizer.cpp @@ -88,7 +88,7 @@ bool Channelizer::rotate(const float *in, size_t len) convolve_real(hInputs[i], blockLen, subFilters[i], hLen, hOutputs[i], blockLen, - 0, blockLen, 1, 0); + 0, blockLen); } cxvec_fft(fftHandle); diff --git a/Transceiver52M/Resampler.cpp b/Transceiver52M/Resampler.cpp index 6b9621cd..ecd8865e 100644 --- a/Transceiver52M/Resampler.cpp +++ b/Transceiver52M/Resampler.cpp @@ -143,7 +143,7 @@ int Resampler::rotate(const float *in, size_t in_len, float *out, size_t out_len convolve_real(in, in_len, reinterpret_cast(partitions[path]), filt_len, &out[2 * i], out_len - i, - n, 1, 1, 0); + n, 1); } return out_len; diff --git a/Transceiver52M/Synthesis.cpp b/Transceiver52M/Synthesis.cpp index 262c638d..6b621561 100644 --- a/Transceiver52M/Synthesis.cpp +++ b/Transceiver52M/Synthesis.cpp @@ -102,7 +102,7 @@ bool Synthesis::rotate(float *out, size_t len) convolve_real(hInputs[i], blockLen, subFilters[i], hLen, hOutputs[i], blockLen, - 0, blockLen, 1, 0); + 0, blockLen); } /* Interleave into output vector */ diff --git a/Transceiver52M/arch/arm/convolve.c b/Transceiver52M/arch/arm/convolve.c index 912d0c29..5b5bce51 100644 --- a/Transceiver52M/arch/arm/convolve.c +++ b/Transceiver52M/arch/arm/convolve.c @@ -29,17 +29,15 @@ int _base_convolve_real(float *x, int x_len, float *h, int h_len, float *y, int y_len, - int start, int len, - int step, int offset); + int start, int len); int _base_convolve_complex(float *x, int x_len, float *h, int h_len, float *y, int y_len, - int start, int len, - int step, int offset); + int start, int len); int bounds_check(int x_len, int h_len, int y_len, - int start, int len, int step); + int start, int len); #ifdef HAVE_NEON /* Calls into NEON assembler */ @@ -69,35 +67,32 @@ void convolve_init(void) int convolve_real(float *x, int x_len, float *h, int h_len, float *y, int y_len, - int start, int len, - int step, int offset) + int start, int len) { void (*conv_func)(float *, float *, float *, int) = NULL; - if (bounds_check(x_len, h_len, y_len, start, len, step) < 0) + if (bounds_check(x_len, h_len, y_len, start, len) < 0) return -1; memset(y, 0, len * 2 * sizeof(float)); #ifdef HAVE_NEON - if (step <= 4) { - switch (h_len) { - case 4: - conv_func = neon_conv_real4; - break; - case 8: - conv_func = neon_conv_real8; - break; - case 12: - conv_func = neon_conv_real12; - break; - case 16: - conv_func = neon_conv_real16; - break; - case 20: - conv_func = neon_conv_real20; - break; - } + switch (h_len) { + case 4: + conv_func = neon_conv_real4; + break; + case 8: + conv_func = neon_conv_real8; + break; + case 12: + conv_func = neon_conv_real12; + break; + case 16: + conv_func = neon_conv_real16; + break; + case 20: + conv_func = neon_conv_real20; + break; } #endif if (conv_func) { @@ -107,7 +102,7 @@ int convolve_real(float *x, int x_len, _base_convolve_real(x, x_len, h, h_len, y, y_len, - start, len, step, offset); + start, len); } return len; @@ -118,18 +113,17 @@ int convolve_real(float *x, int x_len, int convolve_complex(float *x, int x_len, float *h, int h_len, float *y, int y_len, - int start, int len, - int step, int offset) + int start, int len) { void (*conv_func)(float *, float *, float *, int, int) = NULL; - if (bounds_check(x_len, h_len, y_len, start, len, step) < 0) + if (bounds_check(x_len, h_len, y_len, start, len) < 0) return -1; memset(y, 0, len * 2 * sizeof(float)); #ifdef HAVE_NEON - if (step <= 4 && !(h_len % 4)) + if (!(h_len % 4)) conv_func = neon_conv_cmplx_4n; #endif if (conv_func) { @@ -139,7 +133,7 @@ int convolve_complex(float *x, int x_len, _base_convolve_complex(x, x_len, h, h_len, y, y_len, - start, len, step, offset); + start, len); } return len; diff --git a/Transceiver52M/arch/common/convolve.h b/Transceiver52M/arch/common/convolve.h index 095b04c8..e30f7eca 100644 --- a/Transceiver52M/arch/common/convolve.h +++ b/Transceiver52M/arch/common/convolve.h @@ -6,26 +6,22 @@ void *convolve_h_alloc(size_t num); int convolve_real(const float *x, int x_len, const float *h, int h_len, float *y, int y_len, - int start, int len, - int step, int offset); + int start, int len); int convolve_complex(const float *x, int x_len, const float *h, int h_len, float *y, int y_len, - int start, int len, - int step, int offset); + int start, int len); int base_convolve_real(const float *x, int x_len, const float *h, int h_len, float *y, int y_len, - int start, int len, - int step, int offset); + int start, int len); int base_convolve_complex(const float *x, int x_len, const float *h, int h_len, float *y, int y_len, - int start, int len, - int step, int offset); + int start, int len); void convolve_init(void); diff --git a/Transceiver52M/arch/common/convolve_base.c b/Transceiver52M/arch/common/convolve_base.c index 2eb71243..9bb8d3d8 100644 --- a/Transceiver52M/arch/common/convolve_base.c +++ b/Transceiver52M/arch/common/convolve_base.c @@ -41,17 +41,17 @@ static void mac_cmplx(const float *x, const float *h, float *y) /* Base vector complex-complex multiply and accumulate */ static void mac_real_vec_n(const float *x, const float *h, float *y, - int len, int step, int offset) + int len) { - for (int i = offset; i < len; i += step) + for (int i=0; ibegin(), _x->size(), (float *) h->begin(), h->size(), (float *) y->begin(), y->size(), - start, len, step, offset); + start, len); } else if (!h->isReal() && h->isAligned()) { rc = convolve_complex((float *) _x->begin(), _x->size(), (float *) h->begin(), h->size(), (float *) y->begin(), y->size(), - start, len, step, offset); + start, len); } else if (h->isReal() && !h->isAligned()) { rc = base_convolve_real((float *) _x->begin(), _x->size(), (float *) h->begin(), h->size(), (float *) y->begin(), y->size(), - start, len, step, offset); + start, len); } else if (!h->isReal() && !h->isAligned()) { rc = base_convolve_complex((float *) _x->begin(), _x->size(), (float *) h->begin(), h->size(), (float *) y->begin(), y->size(), - start, len, step, offset); + start, len); } else { rc = -1; } @@ -1482,7 +1481,7 @@ static int detectBurst(const signalVector &burst, /* Correlate */ if (!convolve(corr_in, sync->sequence, &corr, - CUSTOM, start, len, 1, 0)) { + CUSTOM, start, len)) { delete dec; return -1; } diff --git a/tests/Transceiver52M/convolve_test.c b/tests/Transceiver52M/convolve_test.c index 54bc7a19..8ca4b721 100644 --- a/tests/Transceiver52M/convolve_test.c +++ b/tests/Transceiver52M/convolve_test.c @@ -62,21 +62,17 @@ static void test_convolve_complex(int h_len) int y_len; int start; int len; - int step; - int offset; x_len=34; y_len=26; start=8; len=26; - step=1; - offset=1; reset_testvec(0); dump_floats(x,x_len,"x"); printf("\n"); dump_floats(h,h_len,"h"); printf("\n"); - convolve_complex(x, x_len, h, h_len, y, y_len, start, len, step, offset); + convolve_complex(x, x_len, h, h_len, y, y_len, start, len); dump_floats(y,y_len,"y"); printf("\n"); } @@ -88,21 +84,17 @@ static void test_convolve_real(int h_len) int y_len; int start; int len; - int step; - int offset; x_len=34; y_len=26; start=8; len=26; - step=1; - offset=1; reset_testvec(0); - dump_floats(x,x_len,"x"); + dump_floats(x-30,2*x_len+30,"x"); printf("\n"); - dump_floats(h,h_len,"h"); + dump_floats(h,2*h_len,"h"); printf("\n"); - convolve_real(x, x_len, h, h_len, y, y_len, start, len, step, offset); + convolve_real(x, x_len, h, h_len, y, y_len, start, len); dump_floats(y,y_len,"y"); printf("\n"); }