diff fft-test.c @ 9199:ea0e5e9a520f libavcodec

Replace random() usage in test programs by av_lfg_*().
author diego
date Fri, 20 Mar 2009 11:48:27 +0000
parents e9d9d946f213
children b225f51903af
line wrap: on
line diff
--- a/fft-test.c	Fri Mar 20 11:43:58 2009 +0000
+++ b/fft-test.c	Fri Mar 20 11:48:27 2009 +0000
@@ -23,6 +23,7 @@
  * FFT and MDCT tests.
  */
 
+#include "libavutil/lfg.h"
 #include "dsputil.h"
 #include <math.h>
 #include <unistd.h>
@@ -31,7 +32,6 @@
 #include <string.h>
 
 #undef exit
-#undef random
 
 /* reference fft */
 
@@ -131,7 +131,9 @@
 
 float frandom(void)
 {
-    return (float)((random() & 0xffff) - 32768) / 32768.0;
+    AVLFG prn;
+    av_lfg_init(&prn, 1);
+    return (float)((av_lfg_get(&prn) & 0xffff) - 32768) / 32768.0;
 }
 
 int64_t gettime(void)