pcm_prng: renamed prng() to pcm_prng()

This commit is contained in:
Max Kellermann 2009-01-07 18:07:19 +01:00
parent 3fd1fa31ca
commit b7b5e3f9c3
3 changed files with 4 additions and 3 deletions

View File

@ -43,7 +43,7 @@ pcm_dither_sample_24_to_16(int32_t sample, struct pcm_dither_24 *dither)
/* round */ /* round */
output = sample + round; output = sample + round;
rnd = prng(dither->random); rnd = pcm_prng(dither->random);
output += (rnd & mask) - (dither->random & mask); output += (rnd & mask) - (dither->random & mask);
dither->random = rnd; dither->random = rnd;

View File

@ -23,7 +23,8 @@
* A very simple linear congruential PRNG. It's good enough for PCM * A very simple linear congruential PRNG. It's good enough for PCM
* dithering. * dithering.
*/ */
static unsigned long prng(unsigned long state) static unsigned long
pcm_prng(unsigned long state)
{ {
return (state * 0x0019660dL + 0x3c6ef35fL) & 0xffffffffL; return (state * 0x0019660dL + 0x3c6ef35fL) & 0xffffffffL;
} }

View File

@ -46,7 +46,7 @@ pcm_dither(void)
static unsigned long state; static unsigned long state;
uint32_t r; uint32_t r;
r = state = prng(state); r = state = pcm_prng(state);
return (r & 511) - ((r >> 9) & 511); return (r & 511) - ((r >> 9) & 511);
} }