aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/common
diff options
context:
space:
mode:
authorTom Tsou <tom@tsou.cc>2015-03-25 12:55:11 -0700
committerTom Tsou <tom.tsou@ettus.com>2015-08-21 19:31:24 -0700
commitf147b174475171cdf79ccba25a5e66fec282efcd (patch)
treeea18554ae3a1cccfa6c8b0d5f4ee565db516e266 /Transceiver52M/common
parentd4d3daa12ea5491f4b6ba03805d4a2d3f068bc11 (diff)
sigproc: Make convolution and convert input buffers immutable
For good practice, use const specifier when applicable. Signed-off-by: Tom Tsou <tom@tsou.cc>
Diffstat (limited to 'Transceiver52M/common')
-rw-r--r--Transceiver52M/common/convert.h4
-rw-r--r--Transceiver52M/common/convolve.h16
-rw-r--r--Transceiver52M/common/convolve_base.c24
3 files changed, 22 insertions, 22 deletions
diff --git a/Transceiver52M/common/convert.h b/Transceiver52M/common/convert.h
index 5b557bf..4827c28 100644
--- a/Transceiver52M/common/convert.h
+++ b/Transceiver52M/common/convert.h
@@ -1,7 +1,7 @@
#ifndef _CONVERT_H_
#define _CONVERT_H_
-void convert_float_short(short *out, float *in, float scale, int len);
-void convert_short_float(float *out, short *in, int len);
+void convert_float_short(short *out, const float *in, float scale, int len);
+void convert_short_float(float *out, const short *in, int len);
#endif /* _CONVERT_H_ */
diff --git a/Transceiver52M/common/convolve.h b/Transceiver52M/common/convolve.h
index aef9953..08bda0c 100644
--- a/Transceiver52M/common/convolve.h
+++ b/Transceiver52M/common/convolve.h
@@ -3,26 +3,26 @@
void *convolve_h_alloc(int num);
-int convolve_real(float *x, int x_len,
- float *h, int h_len,
+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 convolve_complex(float *x, int x_len,
- float *h, int h_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 base_convolve_real(float *x, int x_len,
- float *h, int h_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 base_convolve_complex(float *x, int x_len,
- float *h, int h_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);
diff --git a/Transceiver52M/common/convolve_base.c b/Transceiver52M/common/convolve_base.c
index 41dba1c..71453a1 100644
--- a/Transceiver52M/common/convolve_base.c
+++ b/Transceiver52M/common/convolve_base.c
@@ -26,21 +26,21 @@
#endif
/* Base multiply and accumulate complex-real */
-static void mac_real(float *x, float *h, float *y)
+static void mac_real(const float *x, const float *h, float *y)
{
y[0] += x[0] * h[0];
y[1] += x[1] * h[0];
}
/* Base multiply and accumulate complex-complex */
-static void mac_cmplx(float *x, float *h, float *y)
+static void mac_cmplx(const float *x, const float *h, float *y)
{
y[0] += x[0] * h[0] - x[1] * h[1];
y[1] += x[0] * h[1] + x[1] * h[0];
}
/* Base vector complex-complex multiply and accumulate */
-static void mac_real_vec_n(float *x, float *h, float *y,
+static void mac_real_vec_n(const float *x, const float *h, float *y,
int len, int step, int offset)
{
for (int i = offset; i < len; i += step)
@@ -48,7 +48,7 @@ static void mac_real_vec_n(float *x, float *h, float *y,
}
/* Base vector complex-complex multiply and accumulate */
-static void mac_cmplx_vec_n(float *x, float *h, float *y,
+static void mac_cmplx_vec_n(const float *x, const float *h, float *y,
int len, int step, int offset)
{
for (int i = offset; i < len; i += step)
@@ -56,8 +56,8 @@ static void mac_cmplx_vec_n(float *x, float *h, float *y,
}
/* Base complex-real convolution */
-int _base_convolve_real(float *x, int x_len,
- float *h, int h_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)
@@ -73,8 +73,8 @@ int _base_convolve_real(float *x, int x_len,
}
/* Base complex-complex convolution */
-int _base_convolve_complex(float *x, int x_len,
- float *h, int h_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)
@@ -110,8 +110,8 @@ int bounds_check(int x_len, int h_len, int y_len,
}
/* API: Non-aligned (no SSE) complex-real */
-int base_convolve_real(float *x, int x_len,
- float *h, int h_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)
@@ -128,8 +128,8 @@ int base_convolve_real(float *x, int x_len,
}
/* API: Non-aligned (no SSE) complex-complex */
-int base_convolve_complex(float *x, int x_len,
- float *h, int h_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)