[FFmpeg-cvslog] avutil/softfloat: properly separate testcode

Michael Niedermayer git at videolan.org
Thu Jun 11 17:00:28 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Jun 11 16:12:24 2015 +0200| [54f685a0ee5e0953d6e4792205d0634a5a74ad54] | committer: Michael Niedermayer

avutil/softfloat: properly separate testcode

This matches how other self tests are implemented

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavutil/Makefile    |    1 +
 libavutil/softfloat.c |   17 +++++++++--------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/libavutil/Makefile b/libavutil/Makefile
index df85cd1..abfd10f 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -126,6 +126,7 @@ OBJS = adler32.o                                                        \
        samplefmt.o                                                      \
        sha.o                                                            \
        sha512.o                                                         \
+       softfloat.o                                                      \
        stereo3d.o                                                       \
        threadmessage.o                                                  \
        time.o                                                           \
diff --git a/libavutil/softfloat.c b/libavutil/softfloat.c
index 4fc6860..980e556 100644
--- a/libavutil/softfloat.c
+++ b/libavutil/softfloat.c
@@ -19,18 +19,10 @@
  */
 
 #include <inttypes.h>
-#include <stdio.h>
 #include "softfloat.h"
 #include "common.h"
 #include "log.h"
 
-#undef printf
-
-static const SoftFloat FLOAT_0_017776489257 = {0x1234, 12};
-static const SoftFloat FLOAT_1374_40625 = {0xabcd, 25};
-static const SoftFloat FLOAT_0_1249694824218 = {0xFFF, 15};
-
-
 static av_const double av_sf2double(SoftFloat v) {
     v.exp -= ONE_BITS +1;
     if(v.exp > 0) return (double)v.mant * (double)(1 << v.exp);
@@ -86,6 +78,14 @@ void av_sincos_sf(int a, int *s, int *c)
     *s = (int)(((int64_t)cv * st + (int64_t)sv * ct + 0x20000000) >> 30);
 }
 
+#ifdef TEST
+#include <stdio.h>
+
+static const SoftFloat FLOAT_0_017776489257 = {0x1234, 12};
+static const SoftFloat FLOAT_1374_40625 = {0xabcd, 25};
+static const SoftFloat FLOAT_0_1249694824218 = {0xFFF, 15};
+
+
 int main(void){
     SoftFloat one= av_int2sf(1, 0);
     SoftFloat sf1, sf2, sf3;
@@ -155,3 +155,4 @@ int main(void){
     return 0;
 
 }
+#endif



More information about the ffmpeg-cvslog mailing list