Go to the source code of this file.
|
void | autocorr (float *r, const float *x, int N, int order) |
|
void | bwexpand (float *out, float *in, float coef, int length) |
|
void | interpolate (float *out, float *in1, float *in2, float coef, int length) |
|
void | levdurb (float *a, float *k, float *r, int order) |
|
int | LSF_check (float *lsf, int dim, int NoAn) |
|
void | sort_sq (float *xq, int *index, float x, const float *cb, int cb_size) |
|
void | SplitVQ (float *qX, int *index, float *X, const float *CB, int nsplit, const int *dim, const int *cbsize) |
|
void | vq (float *Xq, int *index, const float *CB, float *X, int n_cb, int dim) |
|
void | window (float *z, const float *x, const float *y, int N) |
|
◆ autocorr()
void autocorr |
( |
float * |
r, |
|
|
const float * |
x, |
|
|
int |
N, |
|
|
int |
order |
|
) |
| |
Definition at line 22 of file helpfun.c.
References order.
Referenced by SimpleAnalysis().
32 for (lag = 0; lag <=
order; lag++) {
34 for (n = 0; n < N - lag; n++) {
35 sum += x[n] * x[n+lag];
◆ bwexpand()
void bwexpand |
( |
float * |
out, |
|
|
float * |
in, |
|
|
float |
coef, |
|
|
int |
length |
|
) |
| |
◆ interpolate()
void interpolate |
( |
float * |
out, |
|
|
float * |
in1, |
|
|
float * |
in2, |
|
|
float |
coef, |
|
|
int |
length |
|
) |
| |
◆ levdurb()
void levdurb |
( |
float * |
a, |
|
|
float * |
k, |
|
|
float * |
r, |
|
|
int |
order |
|
) |
| |
Definition at line 67 of file helpfun.c.
References EPS, and order.
Referenced by SimpleAnalysis().
80 for (i = 0; i <
order; i++) {
85 a[1] = k[0] = -r[1]/r[0];
86 alpha = r[0] + r[1] * k[0];
87 for (m = 1; m <
order; m++){
89 for (i = 0; i < m; i++){
90 sum +=
a[i+1] * r[m - i];
100 for (i = 0; i < m_h; i++){
101 sum =
a[i+1] + k[m] *
a[m - i];
102 a[m - i] += k[m] * a[i+1];
◆ LSF_check()
int LSF_check |
( |
float * |
lsf, |
|
|
int |
dim, |
|
|
int |
NoAn |
|
) |
| |
Definition at line 272 of file helpfun.c.
Referenced by iLBC_decode(), and LPCencode().
279 int k,n,m, Nit=2, change=0,pos;
280 static float eps=(float)0.039;
281 static float eps2=(float)0.0195;
282 static float maxlsf=(float)3.14;
283 static float minlsf=(float)0.01;
287 for (n=0; n<Nit; n++) {
288 for (m=0; m<NoAn; m++) {
289 for (k=0; k<(dim-1); k++) {
292 if ((lsf[pos+1]-lsf[pos])<eps) {
294 if (lsf[pos+1]<lsf[pos]) {
295 lsf[pos+1]= lsf[pos]+eps2;
296 lsf[pos]= lsf[pos+1]-eps2;
309 if (lsf[pos]<minlsf) {
314 if (lsf[pos]>maxlsf) {
◆ sort_sq()
void sort_sq |
( |
float * |
xq, |
|
|
int * |
index, |
|
|
float |
x, |
|
|
const float * |
cb, |
|
|
int |
cb_size |
|
) |
| |
◆ SplitVQ()
void SplitVQ |
( |
float * |
qX, |
|
|
int * |
index, |
|
|
float * |
X, |
|
|
const float * |
CB, |
|
|
int |
nsplit, |
|
|
const int * |
dim, |
|
|
const int * |
cbsize |
|
) |
| |
Definition at line 209 of file helpfun.c.
References vq().
Referenced by SimplelsfQ().
219 int cb_pos, X_pos, i;
223 for (i = 0; i < nsplit; i++) {
224 vq(qX + X_pos, index + i, CB + cb_pos, X + X_pos,
227 cb_pos += dim[i] * cbsize[i];
void vq(float *Xq, int *index, const float *CB, float *X, int n_cb, int dim)
◆ vq()
void vq |
( |
float * |
Xq, |
|
|
int * |
index, |
|
|
const float * |
CB, |
|
|
float * |
X, |
|
|
int |
n_cb, |
|
|
int |
dim |
|
) |
| |
Definition at line 165 of file helpfun.c.
References FLOAT_MAX, and tmp().
Referenced by SplitVQ().
175 float dist,
tmp, mindist;
180 for (j = 0; j < n_cb; j++) {
181 dist = X[0] - CB[pos];
183 for (i = 1; i < dim; i++) {
184 tmp = X[i] - CB[pos + i];
188 if (dist < mindist) {
194 for (i = 0; i < dim; i++) {
195 Xq[i] = CB[minindex*dim + i];
◆ window()
void window |
( |
float * |
z, |
|
|
const float * |
x, |
|
|
const float * |
y, |
|
|
int |
N |
|
) |
| |
Definition at line 50 of file helpfun.c.
58 for (i = 0; i < N; i++) {