[FFmpeg-cvslog] lpc: remove "decay" argument

Loren Merritt git at videolan.org
Sun Jun 30 11:22:17 CEST 2013


ffmpeg | branch: master | Loren Merritt <lorenm at u.washington.edu> | Tue Jun 18 21:30:40 2013 +0000| [cc6714bb16b1f0716ba43701d47273dbe9657b8b] | committer: Luca Barbato

lpc: remove "decay" argument

We never used the rolling-average mode, and this makes av_update_lls 15% faster.

Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cc6714bb16b1f0716ba43701d47273dbe9657b8b
---

 libavcodec/lpc.c |    2 +-
 libavutil/lls.c  |    7 +++----
 libavutil/lls.h  |    2 +-
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/libavcodec/lpc.c b/libavcodec/lpc.c
index bada368..c098b0f 100644
--- a/libavcodec/lpc.c
+++ b/libavcodec/lpc.c
@@ -222,7 +222,7 @@ int ff_lpc_calc_coefs(LPCContext *s,
                 }else
                     weight++;
 
-                avpriv_update_lls(&m[pass&1], var, 1.0);
+                avpriv_update_lls(&m[pass&1], var);
             }
             avpriv_solve_lls(&m[pass&1], 0.001, 0);
         }
diff --git a/libavutil/lls.c b/libavutil/lls.c
index 246189b..2061e6a 100644
--- a/libavutil/lls.c
+++ b/libavutil/lls.c
@@ -38,13 +38,12 @@ av_cold void avpriv_init_lls(LLSModel *m, int indep_count)
     m->indep_count = indep_count;
 }
 
-void avpriv_update_lls(LLSModel *m, double *var, double decay)
+void avpriv_update_lls(LLSModel *m, double *var)
 {
     int i, j;
 
     for (i = 0; i <= m->indep_count; i++) {
         for (j = i; j <= m->indep_count; j++) {
-            m->covariance[i][j] *= decay;
             m->covariance[i][j] += var[i] * var[j];
         }
     }
@@ -125,7 +124,7 @@ av_cold void av_init_lls(LLSModel *m, int indep_count)
 }
 void av_update_lls(LLSModel *m, double *param, double decay)
 {
-    avpriv_update_lls(m, param, decay);
+    avpriv_update_lls(m, param);
 }
 void av_solve_lls(LLSModel *m, double threshold, int min_order)
 {
@@ -160,7 +159,7 @@ 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;
-        avpriv_update_lls(&m, var, 0.99);
+        avpriv_update_lls(&m, var);
         avpriv_solve_lls(&m, 0.001, 0);
         for (order = 0; order < 3; order++) {
             eval = avpriv_evaluate_lls(&m, var + 1, order);
diff --git a/libavutil/lls.h b/libavutil/lls.h
index f493076..9c71cf9 100644
--- a/libavutil/lls.h
+++ b/libavutil/lls.h
@@ -40,7 +40,7 @@ typedef struct LLSModel {
 } LLSModel;
 
 void avpriv_init_lls(LLSModel *m, int indep_count);
-void avpriv_update_lls(LLSModel *m, double *param, double decay);
+void avpriv_update_lls(LLSModel *m, double *param);
 void avpriv_solve_lls(LLSModel *m, double threshold, unsigned short min_order);
 double avpriv_evaluate_lls(LLSModel *m, double *param, int order);
 



More information about the ffmpeg-cvslog mailing list