aboutsummaryrefslogtreecommitdiffhomepage
path: root/libaf
diff options
context:
space:
mode:
authorGravatar Uoti Urpala <uau@symbol.nonexistent.invalid>2008-07-21 15:03:49 +0300
committerGravatar Uoti Urpala <uau@symbol.nonexistent.invalid>2008-07-21 15:03:49 +0300
commit2d4656e070697cebe8cb66568b3e8dd8919b5eed (patch)
tree39c927d18e0ab459c7ddf36dcb876d2d0621e2a6 /libaf
parent92f0cba26b5c032f8b097f525862233d92a02a2d (diff)
parent4993d0c46afa109c3deb8d818be712ec86e0230a (diff)
Merge svn changes up to r27332
Diffstat (limited to 'libaf')
-rw-r--r--libaf/af_hrtf.h12
-rw-r--r--libaf/filter.c20
-rw-r--r--libaf/filter.h14
3 files changed, 23 insertions, 23 deletions
diff --git a/libaf/af_hrtf.h b/libaf/af_hrtf.h
index 1a5c73e579..0ddc5b343e 100644
--- a/libaf/af_hrtf.h
+++ b/libaf/af_hrtf.h
@@ -88,7 +88,7 @@ How to generate these data:
/* Center front (-5 degree) - not 0 degree in order to create a clear
front image from a finite distance */
-float cf_filt[128] = {
+static const float cf_filt[128] = {
-0.00008638082319075036, 0.0003198059946385229,
-0.0005010631339162132, 0.0011424741331126876,
-0.001584220794688753, 0.001742715363246275,
@@ -155,7 +155,7 @@ float cf_filt[128] = {
-0.005469203016468759, -0.004355784273189485
};
/* Front, same side (30 degree) */
-float af_filt[128] = {
+static const float af_filt[128] = {
-0.004140580614755493, 0.005790934614385445,
0.003318916682081112, 0.014257145544366063,
0.007328442487127339, -0.06550381777876194,
@@ -222,7 +222,7 @@ float af_filt[128] = {
-0.0005083025643192044, 0.00035096963769606926
};
/* Front, opposite (-30 degree) */
-float of_filt[128] = {
+static const float of_filt[128] = {
-0.000013472538374193126, -0.00008048061877079751,
0.000043927265781258155, -0.000017931700794858892,
-0.000034774602476112886, -0.00009576223008735474,
@@ -289,7 +289,7 @@ float of_filt[128] = {
-0.0013726264946164232, -0.0020075119315034313
};
/* Rear, same side (135 degree) */
-float ar_filt[128] = {
+static const float ar_filt[128] = {
0.004573315040810066, 0.0013592578059426913,
0.01553271930902704, -0.0002356117224941317,
-0.05746098219774702, 0.03430688963370445,
@@ -356,7 +356,7 @@ float ar_filt[128] = {
-0.0026884314856593368, -0.004084181815125924
};
/* Rear, opposite (-135 degree) */
-float or_filt[128] = {
+static const float or_filt[128] = {
0.0001220944028243897, -0.000021785381808441314,
5.823057988603169e-6, -0.00001217768176447613,
-0.00006123604397345513, 5.574117262531134e-6,
@@ -423,7 +423,7 @@ float or_filt[128] = {
-0.001852908777923165, -0.002540339553144362
};
/* Center rear (180 degree) */
-float cr_filt[128] = {
+static const float cr_filt[128] = {
-0.00005989110716536726, -0.00022790291829128702,
0.0002659166098971966, -0.0003774772716776257,
0.0004540309551867803, -0.000420238187386368,
diff --git a/libaf/filter.c b/libaf/filter.c
index a6436b4108..fb5d93b7d5 100644
--- a/libaf/filter.c
+++ b/libaf/filter.c
@@ -25,8 +25,8 @@
w filter taps
x input signal must be a circular buffer which is indexed backwards
*/
-inline FLOAT_TYPE af_filter_fir(register unsigned int n, FLOAT_TYPE* w,
- FLOAT_TYPE* x)
+inline FLOAT_TYPE af_filter_fir(register unsigned int n, const FLOAT_TYPE* w,
+ const FLOAT_TYPE* x)
{
register FLOAT_TYPE y; // Output
y = 0.0;
@@ -48,11 +48,11 @@ inline FLOAT_TYPE af_filter_fir(register unsigned int n, FLOAT_TYPE* w,
s output buffer stride
*/
FLOAT_TYPE* af_filter_pfir(unsigned int n, unsigned int d, unsigned int xi,
- FLOAT_TYPE** w, FLOAT_TYPE** x, FLOAT_TYPE* y,
+ const FLOAT_TYPE** w, const FLOAT_TYPE** x, FLOAT_TYPE* y,
unsigned int s)
{
- register FLOAT_TYPE* xt = *x + xi;
- register FLOAT_TYPE* wt = *w;
+ register const FLOAT_TYPE* xt = *x + xi;
+ register const FLOAT_TYPE* wt = *w;
register int nt = 2*n;
while(d-- > 0){
*y = af_filter_fir(n,wt,xt);
@@ -69,7 +69,7 @@ FLOAT_TYPE* af_filter_pfir(unsigned int n, unsigned int d, unsigned int xi,
filter. xq must be n*2 by k big, s is the index for in.
*/
int af_filter_updatepq(unsigned int n, unsigned int d, unsigned int xi,
- FLOAT_TYPE** xq, FLOAT_TYPE* in, unsigned int s)
+ FLOAT_TYPE** xq, const FLOAT_TYPE* in, unsigned int s)
{
register FLOAT_TYPE* txq = *xq + xi;
register int nt = n*2;
@@ -99,7 +99,7 @@ int af_filter_updatepq(unsigned int n, unsigned int d, unsigned int xi,
returns 0 if OK, -1 if fail
*/
-int af_filter_design_fir(unsigned int n, FLOAT_TYPE* w, FLOAT_TYPE* fc,
+int af_filter_design_fir(unsigned int n, FLOAT_TYPE* w, const FLOAT_TYPE* fc,
unsigned int flags, FLOAT_TYPE opt)
{
unsigned int o = n & 1; // Indicator for odd filter length
@@ -238,7 +238,7 @@ int af_filter_design_fir(unsigned int n, FLOAT_TYPE* w, FLOAT_TYPE* fc,
returns 0 if OK, -1 if fail
*/
-int af_filter_design_pfir(unsigned int n, unsigned int k, FLOAT_TYPE* w,
+int af_filter_design_pfir(unsigned int n, unsigned int k, const FLOAT_TYPE* w,
FLOAT_TYPE** pw, FLOAT_TYPE g, unsigned int flags)
{
int l = (int)n/k; // Length of individual FIR filters
@@ -316,7 +316,7 @@ static void af_filter_prewarp(FLOAT_TYPE* a, FLOAT_TYPE fc, FLOAT_TYPE fs)
Return: On return, set coef z-domain coefficients and k to the gain
required to maintain overall gain = 1.0;
*/
-static void af_filter_bilinear(FLOAT_TYPE* a, FLOAT_TYPE* b, FLOAT_TYPE* k,
+static void af_filter_bilinear(const FLOAT_TYPE* a, const FLOAT_TYPE* b, FLOAT_TYPE* k,
FLOAT_TYPE fs, FLOAT_TYPE *coef)
{
FLOAT_TYPE ad, bd;
@@ -417,7 +417,7 @@ static void af_filter_bilinear(FLOAT_TYPE* a, FLOAT_TYPE* b, FLOAT_TYPE* k,
return -1 if fail 0 if success.
*/
-int af_filter_szxform(FLOAT_TYPE* a, FLOAT_TYPE* b, FLOAT_TYPE Q, FLOAT_TYPE fc,
+int af_filter_szxform(const FLOAT_TYPE* a, const FLOAT_TYPE* b, FLOAT_TYPE Q, FLOAT_TYPE fc,
FLOAT_TYPE fs, FLOAT_TYPE *k, FLOAT_TYPE *coef)
{
FLOAT_TYPE at[3];
diff --git a/libaf/filter.h b/libaf/filter.h
index 089f707d3b..0993f86cce 100644
--- a/libaf/filter.h
+++ b/libaf/filter.h
@@ -44,26 +44,26 @@
#define ODD 0x00000010 // Make filter HP
// Exported functions
-extern FLOAT_TYPE af_filter_fir(unsigned int n, FLOAT_TYPE* w, FLOAT_TYPE* x);
+extern FLOAT_TYPE af_filter_fir(unsigned int n, const FLOAT_TYPE* w, const FLOAT_TYPE* x);
extern FLOAT_TYPE* af_filter_pfir(unsigned int n, unsigned int k,
- unsigned int xi, FLOAT_TYPE** w,
- FLOAT_TYPE** x, FLOAT_TYPE* y,
+ unsigned int xi, const FLOAT_TYPE** w,
+ const FLOAT_TYPE** x, FLOAT_TYPE* y,
unsigned int s);
//extern int af_filter_updateq(unsigned int n, unsigned int xi,
// FLOAT_TYPE* xq, FLOAT_TYPE* in);
extern int af_filter_updatepq(unsigned int n, unsigned int k, unsigned int xi,
- FLOAT_TYPE** xq, FLOAT_TYPE* in, unsigned int s);
+ FLOAT_TYPE** xq, const FLOAT_TYPE* in, unsigned int s);
-extern int af_filter_design_fir(unsigned int n, FLOAT_TYPE* w, FLOAT_TYPE* fc,
+extern int af_filter_design_fir(unsigned int n, FLOAT_TYPE* w, const FLOAT_TYPE* fc,
unsigned int flags, FLOAT_TYPE opt);
-extern int af_filter_design_pfir(unsigned int n, unsigned int k, FLOAT_TYPE* w,
+extern int af_filter_design_pfir(unsigned int n, unsigned int k, const FLOAT_TYPE* w,
FLOAT_TYPE** pw, FLOAT_TYPE g,
unsigned int flags);
-extern int af_filter_szxform(FLOAT_TYPE* a, FLOAT_TYPE* b, FLOAT_TYPE Q,
+extern int af_filter_szxform(const FLOAT_TYPE* a, const FLOAT_TYPE* b, FLOAT_TYPE Q,
FLOAT_TYPE fc, FLOAT_TYPE fs, FLOAT_TYPE *k,
FLOAT_TYPE *coef);