libilbc 0.0.1
helpfun.h
1/*
2 * iLBC - a library for the iLBC codec
3 *
4 * helpfun.h - The iLBC low bit rate speech codec.
5 *
6 * Adapted by Steve Underwood <steveu@coppice.org> from the reference
7 * iLBC code supplied in RFC3951.
8 *
9 * Original code Copyright (C) The Internet Society (2004).
10 * All changes to produce this version Copyright (C) 2008 by Steve Underwood
11 * All Rights Reserved.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 */
17
18#ifndef __iLBC_HELPFUN_H
19#define __iLBC_HELPFUN_H
20
21void autocorr(float *r, /* (o) autocorrelation vector */
22 const float *x, /* (i) data vector */
23 int N, /* (i) length of data vector */
24 int order); /* largest lag for calculated
25 autocorrelations */
26
27void window(float *z, /* (o) the windowed data */
28 const float *x, /* (i) the original data vector */
29 const float *y, /* (i) the window */
30 int N); /* (i) length of all vectors */
31
32void levdurb(float *a, /* (o) lpc coefficient vector starting with 1.0 */
33 float *k, /* (o) reflection coefficients */
34 float *r, /* (i) autocorrelation vector */
35 int order); /* (i) order of lpc filter */
36
37void interpolate(float *out, /* (o) the interpolated vector */
38 float *in1, /* (i) the first vector for the
39 interpolation */
40 float *in2, /* (i) the second vector for the
41 interpolation */
42 float coef, /* (i) interpolation weights */
43 int length); /* (i) length of all vectors */
44
45void bwexpand(float *out, /* (o) the bandwidth expanded lpc coefficients */
46 float *in, /* (i) the lpc coefficients before bandwidth
47 expansion */
48 float coef, /* (i) the bandwidth expansion factor */
49 int length); /* (i) the length of lpc coefficient vectors */
50
51void vq(float *Xq, /* (o) the quantized vector */
52 int *index, /* (o) the quantization index */
53 const float *CB, /* (i) the vector quantization codebook */
54 float *X, /* (i) the vector to quantize */
55 int n_cb, /* (i) the number of vectors in the codebook */
56 int dim); /* (i) the dimension of all vectors */
57
58void SplitVQ(float *qX, /* (o) the quantized vector */
59 int *index, /* (o) a vector of indexes for all vector
60 codebooks in the split */
61 float *X, /* (i) the vector to quantize */
62 const float *CB, /* (i) the quantizer codebook */
63 int nsplit, /* the number of vector splits */
64 const int *dim, /* the dimension of X and qX */
65 const int *cbsize); /* the number of vectors in the codebook */
66
67void sort_sq(float *xq, /* (o) the quantized value */
68 int *index, /* (o) the quantization index */
69 float x, /* (i) the value to quantize */
70 const float *cb, /* (i) the quantization codebook */
71 int cb_size); /* (i) the size of the quantization codebook */
72
73int LSF_check( /* (o) 1 for stable lsf vectors and 0 for nonstable ones */
74 float *lsf, /* (i) a table of lsf vectors */
75 int dim, /* (i) the dimension of each lsf vector */
76 int NoAn); /* (i) the number of lsf vectors in the table */
77
78#endif