diff mbox series

[FFmpeg-devel,2/5] lavu/lls: use ff_scalarproduct_double_c()

Message ID 20240530190659.65309-2-remi@remlab.net
State Accepted
Commit 73c278d2702cbf07d6c011c5867e08eab43896b0
Headers show
Series [FFmpeg-devel,PATCHv2,1/5] lavu/float_dsp: add double-precision scalar product | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Rémi Denis-Courmont May 30, 2024, 7:06 p.m. UTC
---
 libavutil/lls.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/libavutil/lls.c b/libavutil/lls.c
index c1e038daf1..1096ae69d5 100644
--- a/libavutil/lls.c
+++ b/libavutil/lls.c
@@ -30,6 +30,7 @@ 
 
 #include "config.h"
 #include "attributes.h"
+#include "float_dsp.h"
 #include "lls.h"
 
 static void update_lls(LLSModel *m, const double *var)
@@ -102,13 +103,7 @@  void avpriv_solve_lls(LLSModel *m, double threshold, unsigned short min_order)
 
 static double evaluate_lls(LLSModel *m, const double *param, int order)
 {
-    int i;
-    double out = 0;
-
-    for (i = 0; i <= order; i++)
-        out += param[i] * m->coeff[order][i];
-
-    return out;
+    return ff_scalarproduct_double_c(m->coeff[order], param, order + 1);
 }
 
 av_cold void avpriv_init_lls(LLSModel *m, int indep_count)