diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-03-01 13:19:00 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-03-01 13:19:00 +0100 |
commit | 76f8d3c8d9211daca678747e9521c7ed9e90aba9 (patch) | |
tree | eb69348de94a6b7133c440740fe33ad21dc0640d /libavutil/lls.c | |
parent | fb4b1607561c167b5018641829387447cc8fb51d (diff) | |
parent | 9d4da474f5f40b019cb4cb931c8499deee586174 (diff) | |
download | ffmpeg-76f8d3c8d9211daca678747e9521c7ed9e90aba9.tar.gz |
Merge commit '9d4da474f5f40b019cb4cb931c8499deee586174'
* commit '9d4da474f5f40b019cb4cb931c8499deee586174':
lls: move to the private namespace
Conflicts:
libavutil/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/lls.c')
-rw-r--r-- | libavutil/lls.c | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/libavutil/lls.c b/libavutil/lls.c index dcefc2cbad..13eea96fde 100644 --- a/libavutil/lls.c +++ b/libavutil/lls.c @@ -30,13 +30,13 @@ #include "lls.h" -void av_init_lls(LLSModel *m, int indep_count) +void avpriv_init_lls(LLSModel *m, int indep_count) { memset(m, 0, sizeof(LLSModel)); m->indep_count = indep_count; } -void av_update_lls(LLSModel *m, double *var, double decay) +void avpriv_update_lls(LLSModel *m, double *var, double decay) { int i, j; @@ -48,7 +48,7 @@ void av_update_lls(LLSModel *m, double *var, double decay) } } -void av_solve_lls(LLSModel *m, double threshold, int min_order) +void avpriv_solve_lls(LLSModel *m, double threshold, int min_order) { int i, j, k; double (*factor)[MAX_VARS + 1] = (void *) &m->covariance[1][0]; @@ -105,7 +105,7 @@ void av_solve_lls(LLSModel *m, double threshold, int min_order) } } -double av_evaluate_lls(LLSModel *m, double *param, int order) +double avpriv_evaluate_lls(LLSModel *m, double *param, int order) { int i; double out = 0; @@ -116,6 +116,25 @@ double av_evaluate_lls(LLSModel *m, double *param, int order) return out; } +#ifndef FF_API_LLS_PRIVATE +void av_init_lls(LLSModel *m, int indep_count) +{ + return avpriv_init_lls(m, indep_count); +} +void av_update_lls(LLSModel *m, double *param, double decay) +{ + return avpriv_update_lls(m, param, decay); +} +void av_solve_lls(LLSModel *m, double threshold, int min_order) +{ + return avpriv_solve_lls(m, threshold, min_order); +} +double av_evaluate_lls(LLSModel *m, double *param, int order) +{ + return avpriv_evaluate_lls(m, param, order); +} +#endif + #ifdef TEST #include <stdio.h> @@ -129,7 +148,7 @@ int main(void) AVLFG lfg; av_lfg_init(&lfg, 1); - av_init_lls(&m, 3); + avpriv_init_lls(&m, 3); for (i = 0; i < 100; i++) { double var[4]; @@ -139,10 +158,10 @@ int main(void) var[1] = var[0] + av_lfg_get(&lfg) / (double) UINT_MAX - 0.5; var[2] = var[1] + av_lfg_get(&lfg) / (double) UINT_MAX - 0.5; var[3] = var[2] + av_lfg_get(&lfg) / (double) UINT_MAX - 0.5; - av_update_lls(&m, var, 0.99); - av_solve_lls(&m, 0.001, 0); + avpriv_update_lls(&m, var, 0.99); + avpriv_solve_lls(&m, 0.001, 0); for (order = 0; order < 3; order++) { - eval = av_evaluate_lls(&m, var + 1, order); + eval = avpriv_evaluate_lls(&m, var + 1, order); printf("real:%9f order:%d pred:%9f var:%f coeffs:%f %9f %9f\n", var[0], order, eval, sqrt(m.variance[order] / (i + 1)), m.coeff[order][0], m.coeff[order][1], |