This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 84f2449940584f952db0b39cac0dbe072b13782b
Author:     Kacper Michajłow <[email protected]>
AuthorDate: Tue Sep 22 23:05:22 2026 +0200
Commit:     Kacper Michajłow <[email protected]>
CommitDate: Tue Sep 29 22:39:09 2026 +0200

    avutil/tests/lls: make the printed values platform independent
    
    The residual variance of an exact fit ends up a few ulp below zero, so
    the square root printed for it is NaN. glibc prints it as -nan, mingw as
    nan. The coefficient of an undetermined order is rounding noise around
    zero whose sign varies the same way. Clamp the variance and print values
    below the shown precision as zero.
    
    Signed-off-by: Kacper Michajłow <[email protected]>
---
 libavutil/tests/lls.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/libavutil/tests/lls.c b/libavutil/tests/lls.c
index 4c14c0c4b4..c70a766a19 100644
--- a/libavutil/tests/lls.c
+++ b/libavutil/tests/lls.c
@@ -24,6 +24,13 @@
 #include "libavutil/lls.h"
 #include "libavutil/mem_internal.h"
 
+/* Values below the printed precision are rounding noise whose sign varies
+ * between platforms, so print them as zero. */
+static double clean(double v)
+{
+    return fabs(v) < 1e-9 ? 0.0 : v;
+}
+
 int main(void)
 {
     LLSModel m;
@@ -46,9 +53,10 @@ int main(void)
         for (order = 0; order < 3; order++) {
             eval = m.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],
-                   m.coeff[order][2]);
+                   var[0], order, eval,
+                   sqrt(FFMAX(m.variance[order], 0) / (i + 1)),
+                   clean(m.coeff[order][0]), clean(m.coeff[order][1]),
+                   clean(m.coeff[order][2]));
         }
     }
     return 0;

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to