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