Mercurial > libavcodec.hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
9198:342e95d4784b | 9199:ea0e5e9a520f |
---|---|
21 /** | 21 /** |
22 * @file libavcodec/fft-test.c | 22 * @file libavcodec/fft-test.c |
23 * FFT and MDCT tests. | 23 * FFT and MDCT tests. |
24 */ | 24 */ |
25 | 25 |
26 #include "libavutil/lfg.h" | |
26 #include "dsputil.h" | 27 #include "dsputil.h" |
27 #include <math.h> | 28 #include <math.h> |
28 #include <unistd.h> | 29 #include <unistd.h> |
29 #include <sys/time.h> | 30 #include <sys/time.h> |
30 #include <stdlib.h> | 31 #include <stdlib.h> |
31 #include <string.h> | 32 #include <string.h> |
32 | 33 |
33 #undef exit | 34 #undef exit |
34 #undef random | |
35 | 35 |
36 /* reference fft */ | 36 /* reference fft */ |
37 | 37 |
38 #define MUL16(a,b) ((a) * (b)) | 38 #define MUL16(a,b) ((a) * (b)) |
39 | 39 |
129 } | 129 } |
130 | 130 |
131 | 131 |
132 float frandom(void) | 132 float frandom(void) |
133 { | 133 { |
134 return (float)((random() & 0xffff) - 32768) / 32768.0; | 134 AVLFG prn; |
135 av_lfg_init(&prn, 1); | |
136 return (float)((av_lfg_get(&prn) & 0xffff) - 32768) / 32768.0; | |
135 } | 137 } |
136 | 138 |
137 int64_t gettime(void) | 139 int64_t gettime(void) |
138 { | 140 { |
139 struct timeval tv; | 141 struct timeval tv; |