sconv: Fix generation of floats in SSE test code

the random floats x should be zero-mean with -(1+eps)<x<(1+eps) for some
small epsilon; previously only negative x were generated
This commit is contained in:
Peter Meerwald 2012-01-09 13:51:27 +01:00 committed by Arun Raghavan
parent 66d2f15f90
commit c6e6d682ed

View file

@ -182,7 +182,7 @@ static void run_test(void) {
memset(samples, 0, sizeof(samples)); memset(samples, 0, sizeof(samples));
for (i = 0; i < SAMPLES; i++) { for (i = 0; i < SAMPLES; i++) {
floats[i] = (rand()/(RAND_MAX+2.2)) - 1.1; floats[i] = 2.1f * (rand()/(float) RAND_MAX - 0.5f);
} }
func = pa_get_convert_from_float32ne_function(PA_SAMPLE_S16LE); func = pa_get_convert_from_float32ne_function(PA_SAMPLE_S16LE);