summaryrefslogtreecommitdiffstats
path: root/libaf
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-07-15 19:05:42 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-07-15 19:05:42 +0000
commit7c78c34ace312ee47065d4517a7c775eea4c3d07 (patch)
tree3973229f958cedc4db3106c8db961d0221465671 /libaf
parent803385a5d71aec6a44afc9a6b9409eb5ed48722d (diff)
downloadmpv-7c78c34ace312ee47065d4517a7c775eea4c3d07.tar.bz2
mpv-7c78c34ace312ee47065d4517a7c775eea4c3d07.tar.xz
Add const to libaf/filter.c functions.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27290 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libaf')
-rw-r--r--libaf/filter.c20
-rw-r--r--libaf/filter.h14
2 files changed, 17 insertions, 17 deletions
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);