ffmpeg | branch: master | Rémi Denis-Courmont <r...@remlab.net> | Wed May 29 
17:50:37 2024 +0300| [98405d28fab14933a0ef0d76d61d9806bbb912ba] | committer: 
Rémi Denis-Courmont

checkasm/float_dsp: add double-precision scalar product

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

 tests/checkasm/float_dsp.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/tests/checkasm/float_dsp.c b/tests/checkasm/float_dsp.c
index cadfa65e2a..296db1cff9 100644
--- a/tests/checkasm/float_dsp.c
+++ b/tests/checkasm/float_dsp.c
@@ -278,6 +278,22 @@ static void test_scalarproduct_float(const float *src0, 
const float *src1)
     bench_new(src0, src1, LEN);
 }
 
+static void test_scalarproduct_double(const double *src0, const double *src1)
+{
+    double cprod, oprod;
+
+    declare_func_float(double, const double *, const double *, size_t);
+
+    cprod = call_ref(src0, src1, LEN);
+    oprod = call_new(src0, src1, LEN);
+    if (!double_near_abs_eps(cprod, oprod, ARBITRARY_SCALARPRODUCT_CONST)) {
+        fprintf(stderr, "%- .12f - %- .12f = % .12g\n",
+                cprod, oprod, cprod - oprod);
+        fail();
+    }
+    bench_new(src0, src1, LEN);
+}
+
 void checkasm_check_float_dsp(void)
 {
     LOCAL_ALIGNED_32(float,  src0,     [LEN]);
@@ -334,6 +350,9 @@ void checkasm_check_float_dsp(void)
     if (check_func(fdsp->scalarproduct_float, "scalarproduct_float"))
         test_scalarproduct_float(src3, src4);
     report("scalarproduct_float");
+    if (check_func(fdsp->scalarproduct_double, "scalarproduct_double"))
+        test_scalarproduct_double(dbl_src0, dbl_src1);
+    report("scalarproduct_double");
 
     av_freep(&fdsp);
 }

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to