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

Michael Niedermayer git at videolan.org
Thu Nov 12 00:24:08 CET 2015


ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Sun Nov  8 14:39:46 2015 +0100| [43ada90fc5d9bcd1da44493e31b5cb86f3fe1ff1] | committer: Michael Niedermayer

avutil/softfloat: Add test for av_cmp_sf()

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit df2a2117d280a1579500034a8a3c79dc64b90c78)

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

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

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

diff --git a/libavutil/softfloat.c b/libavutil/softfloat.c
index 1691de8..e525c97 100644
--- a/libavutil/softfloat.c
+++ b/libavutil/softfloat.c
@@ -109,6 +109,19 @@ int main(void){
     sf1 = av_div_sf(sf1, sf2);
     printf("test6 softfloat: %.10lf (0x%08x %d) %d %d\n", (double)av_sf2double(sf1), sf1.mant, sf1.exp, i, j);
 
+    for(i= 0; i<100; i++) {
+        sf1= av_int2sf(i, 0);
+        for(j= 0; j<100; j++) {
+            int c;
+            sf2= av_int2sf(j, 0);
+            c = av_cmp_sf(sf1, sf2);
+            if (FFDIFFSIGN(i,j) != c && (FFDIFFSIGN(i,j)^c)<0) {
+                printf("av_cmp_sf failed at %d %d as %X\n", i, j, c);
+            }
+        }
+    }
+
+
     for(i= 0; i<4*36; i++){
         int s, c;
         double errs, errc;



More information about the ffmpeg-cvslog mailing list