Mercurial > libavutil.hg
annotate lls.h @ 267:d363937cc410 libavutil
Reverting stray commit part II, r8156 had the base64 export patch mixed with the nutdec patch
author | lu_zero |
---|---|
date | Wed, 28 Feb 2007 03:40:23 +0000 |
parents | d76a36742464 |
children | f13e5473611e |
rev | line source |
---|---|
76
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
1 /* |
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
2 * linear least squares model |
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
3 * |
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
4 * Copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at> |
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
5 * |
116
d76a36742464
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
90
diff
changeset
|
6 * This file is part of FFmpeg. |
d76a36742464
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
90
diff
changeset
|
7 * |
d76a36742464
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
90
diff
changeset
|
8 * FFmpeg is free software; you can redistribute it and/or |
76
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
9 * modify it under the terms of the GNU Lesser General Public |
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
10 * License as published by the Free Software Foundation; either |
116
d76a36742464
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
90
diff
changeset
|
11 * version 2.1 of the License, or (at your option) any later version. |
76
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
12 * |
116
d76a36742464
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
90
diff
changeset
|
13 * FFmpeg is distributed in the hope that it will be useful, |
76
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
16 * Lesser General Public License for more details. |
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
17 * |
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
18 * You should have received a copy of the GNU Lesser General Public |
116
d76a36742464
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
90
diff
changeset
|
19 * License along with FFmpeg; if not, write to the Free Software |
90 | 20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
76
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
21 */ |
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
22 |
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
23 #ifndef LLS_H |
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
24 #define LLS_H |
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
25 |
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
26 #define MAX_VARS 32 |
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
27 |
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
28 //FIXME avoid direct access to LLSModel from outside |
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
29 |
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
30 /** |
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
31 * Linear least squares model. |
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
32 */ |
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
33 typedef struct LLSModel{ |
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
34 double covariance[MAX_VARS+1][MAX_VARS+1]; |
79
adbb5540fa47
calculate all coefficients for several orders during cholesky factorization, the resulting coefficients are not strictly optimal though as there is a small difference in the autocorrelation matrixes which is ignored for the smaller orders
michael
parents:
76
diff
changeset
|
35 double coeff[MAX_VARS][MAX_VARS]; |
adbb5540fa47
calculate all coefficients for several orders during cholesky factorization, the resulting coefficients are not strictly optimal though as there is a small difference in the autocorrelation matrixes which is ignored for the smaller orders
michael
parents:
76
diff
changeset
|
36 double variance[MAX_VARS]; |
76
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
37 int indep_count; |
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
38 }LLSModel; |
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
39 |
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
40 void av_init_lls(LLSModel *m, int indep_count); |
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
41 void av_update_lls(LLSModel *m, double *param, double decay); |
79
adbb5540fa47
calculate all coefficients for several orders during cholesky factorization, the resulting coefficients are not strictly optimal though as there is a small difference in the autocorrelation matrixes which is ignored for the smaller orders
michael
parents:
76
diff
changeset
|
42 void av_solve_lls(LLSModel *m, double threshold, int min_order); |
adbb5540fa47
calculate all coefficients for several orders during cholesky factorization, the resulting coefficients are not strictly optimal though as there is a small difference in the autocorrelation matrixes which is ignored for the smaller orders
michael
parents:
76
diff
changeset
|
43 double av_evaluate_lls(LLSModel *m, double *param, int order); |
76
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
44 |
8c75234388b5
linear least squares solver using cholesky factorization
michael
parents:
diff
changeset
|
45 #endif |