annotate intercom/ilbc/helpfun.h @ 3:c6c5a16ce2f2

compilation fixes
author Peter Meerwald <pmeerw@cosy.sbg.ac.at>
date Fri, 25 Jun 2010 09:59:25 +0200
parents 13be24d74cd2
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
1
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
2 /******************************************************************
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
3
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
4 iLBC Speech Coder ANSI-C Source Code
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
5
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
6 helpfun.h
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
7
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
8 Copyright (C) The Internet Society (2004).
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
9 All Rights Reserved.
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
10
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
11 ******************************************************************/
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
12
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
13 #ifndef __iLBC_HELPFUN_H
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
14 #define __iLBC_HELPFUN_H
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
15
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
16 void autocorr(float *r, /* (o) autocorrelation vector */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
17 const float *x, /* (i) data vector */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
18 int N, /* (i) length of data vector */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
19 int order /* largest lag for calculated
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
20 autocorrelations */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
21 );
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
22
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
23 void window(float *z, /* (o) the windowed data */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
24 const float *x, /* (i) the original data vector */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
25 const float *y, /* (i) the window */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
26 int N /* (i) length of all vectors */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
27 );
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
28
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
29 void levdurb(float *a, /* (o) lpc coefficient vector starting
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
30 with 1.0 */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
31 float *k, /* (o) reflection coefficients */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
32 float *r, /* (i) autocorrelation vector */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
33 int order /* (i) order of lpc filter */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
34 );
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
35
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
36 void interpolate(float *out, /* (o) the interpolated vector */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
37 float *in1, /* (i) the first vector for the
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
38 interpolation */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
39 float *in2, /* (i) the second vector for the
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
40 interpolation */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
41 float coef, /* (i) interpolation weights */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
42 int length /* (i) length of all vectors */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
43 );
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
44
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
45 void bwexpand(float *out, /* (o) the bandwidth expanded lpc
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
46 coefficients */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
47 float *in, /* (i) the lpc coefficients before bandwidth
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
48 expansion */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
49 float coef, /* (i) the bandwidth expansion factor */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
50 int length /* (i) the length of lpc coefficient vectors */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
51 );
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
52
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
53 void vq(float *Xq, /* (o) the quantized vector */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
54 int *index, /* (o) the quantization index */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
55 const float *CB, /* (i) the vector quantization codebook */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
56 float *X, /* (i) the vector to quantize */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
57 int n_cb, /* (i) the number of vectors in the codebook */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
58 int dim /* (i) the dimension of all vectors */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
59 );
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
60
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
61 void SplitVQ(float *qX, /* (o) the quantized vector */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
62 int *index, /* (o) a vector of indexes for all vector
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
63 codebooks in the split */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
64 float *X, /* (i) the vector to quantize */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
65 const float *CB, /* (i) the quantizer codebook */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
66 int nsplit, /* the number of vector splits */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
67 const int *dim, /* the dimension of X and qX */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
68 const int *cbsize /* the number of vectors in the codebook */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
69 );
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
70
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
71
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
72 void sort_sq(float *xq, /* (o) the quantized value */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
73 int *index, /* (o) the quantization index */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
74 float x, /* (i) the value to quantize */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
75 const float *cb, /* (i) the quantization codebook */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
76 int cb_size /* (i) the size of the quantization codebook */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
77 );
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
78
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
79 int LSF_check( /* (o) 1 for stable lsf vectors and 0 for
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
80
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
81
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
82
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
83
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
84
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
85 nonstable ones */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
86 float *lsf, /* (i) a table of lsf vectors */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
87 int dim, /* (i) the dimension of each lsf vector */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
88 int NoAn /* (i) the number of lsf vectors in the
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
89 table */
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
90 );
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
91
13be24d74cd2 import intercom-0.4.1
Peter Meerwald <pmeerw@cosy.sbg.ac.at>
parents:
diff changeset
92 #endif

Repositories maintained by Peter Meerwald, pmeerw@pmeerw.net.