[FFmpeg-cvslog] avutil/softfloat: Add a test for av_sincos_sf()

Michael Niedermayer git at videolan.org
Sat Jul 25 22:05:33 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat Jul 25 21:28:05 2015 +0200| [e171309756cb0e407632b163ce588ea8262bc50e] | committer: Michael Niedermayer

avutil/softfloat: Add a test for av_sincos_sf()

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavutil/softfloat.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/libavutil/softfloat.c b/libavutil/softfloat.c
index afce358..a9d1b0c 100644
--- a/libavutil/softfloat.c
+++ b/libavutil/softfloat.c
@@ -97,6 +97,18 @@ int main(void){
     sf1 = av_int2sf(0xE0000001, 0);
     printf("test4 softfloat: %.10lf (0x%08x %d)\n", (double)av_sf2double(sf1), sf1.mant, sf1.exp);
 
+    for(i= 0; i<4*36; i++){
+        int s, c;
+        double errs, errc;
+
+        av_sincos_sf(i*(1ULL<<32)/36/4, &s, &c);
+        errs = (double)s/ (1<<30) - sin(i*M_PI/36);
+        errc = (double)c/ (1<<30) - cos(i*M_PI/36);
+        if (fabs(errs) > 0.00000002 || fabs(errc) >0.001) {
+            printf("sincos FAIL %d %f %f %f %f\n", i, (float)s/ (1<<30), (float)c/ (1<<30), sin(i*M_PI/36), cos(i*M_PI/36));
+        }
+
+    }
     return 0;
 
 }



More information about the ffmpeg-cvslog mailing list