diff --git a/libavcodec/fft-test.c b/libavcodec/fft-test.c index 421f8bb7bf..3da7a23714 100644 --- a/libavcodec/fft-test.c +++ b/libavcodec/fft-test.c @@ -129,11 +129,9 @@ static void mdct_ref(float *output, float *input, int nbits) } -static float frandom(void) +static float frandom(AVLFG *prng) { - AVLFG prng; - av_lfg_init(&prng, 1); - return (float)((av_lfg_get(&prng) & 0xffff) - 32768) / 32768.0; + return (int16_t)av_lfg_get(prng) / 32768.0; } static int64_t gettime(void) @@ -189,6 +187,8 @@ int main(int argc, char **argv) MDCTContext m1, *m = &m1; int fft_nbits, fft_size; double scale = 1.0; + AVLFG prng; + av_lfg_init(&prng, 1); fft_nbits = 9; for(;;) { @@ -243,8 +243,8 @@ int main(int argc, char **argv) /* generate random data */ for(i=0;i