Commit 54887f4a authored by diego's avatar diego

misc spelling/wording fixes


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@14539 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 820b2bb7
...@@ -41,7 +41,7 @@ void av_init_random(unsigned int seed, AVRandomState *state) ...@@ -41,7 +41,7 @@ void av_init_random(unsigned int seed, AVRandomState *state)
int index; int index;
/* /*
This differs from the wikipedia article. Source is from the Makoto This differs from the wikipedia article. Source is from the
Makoto Matsumoto and Takuji Nishimura code, with the following comment: Makoto Matsumoto and Takuji Nishimura code, with the following comment:
*/ */
/* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */ /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */
......
...@@ -28,17 +28,17 @@ ...@@ -28,17 +28,17 @@
typedef struct { typedef struct {
unsigned int mt[AV_RANDOM_N]; ///< the array for the state vector unsigned int mt[AV_RANDOM_N]; ///< the array for the state vector
int index; ///< current untempered value we use as the base. int index; ///< Current untempered value we use as the base.
} AVRandomState; } AVRandomState;
void av_init_random(unsigned int seed, AVRandomState *state); ///< to be inlined, the struct must be visible, so it doesn't make sense to try and keep it opaque with malloc/free like calls void av_init_random(unsigned int seed, AVRandomState *state); ///< To be inlined, the struct must be visible. So it does not make sense to try and keep it opaque with malloc/free-like calls.
void av_random_generate_untempered_numbers(AVRandomState *state); ///< Regenerate the untempered numbers (must be done every 624 iterations, or it will loop) void av_random_generate_untempered_numbers(AVRandomState *state); ///< Regenerate the untempered numbers (must be done every 624 iterations, or it will loop).
/** /**
* generates a random number on [0,0xffffffff]-interval * Generates a random number from the interval [0,0xffffffff].
* *
* Please do NOT use the mersenne twister, it is slow, use the random generator * Please do NOT use the Mersenne Twister, it is slow. Use the random generator
* from lfg.c/h or a simple LCG like state= state*1664525+1013904223. * from lfg.c/h or a simple LCG like state= state*1664525+1013904223.
* If you still choose to use MT, expect that you will have to provide * If you still choose to use MT, expect that you will have to provide
* some evidence that it makes a difference for the case where you use it. * some evidence that it makes a difference for the case where you use it.
...@@ -47,14 +47,14 @@ static inline unsigned int av_random(AVRandomState *state) ...@@ -47,14 +47,14 @@ static inline unsigned int av_random(AVRandomState *state)
{ {
unsigned int y; unsigned int y;
// regenerate the untempered numbers if we should... // Regenerate the untempered numbers if we should...
if (state->index >= AV_RANDOM_N) if (state->index >= AV_RANDOM_N)
av_random_generate_untempered_numbers(state); av_random_generate_untempered_numbers(state);
// grab one... // Grab one...
y = state->mt[state->index++]; y = state->mt[state->index++];
/* Now temper (Mersenne Twister coefficients) The coefficients for MT19937 are.. */ /* Now temper (Mersenne Twister coefficients). The coefficients for MT19937 are.. */
y ^= (y >> 11); y ^= (y >> 11);
y ^= (y << 7) & 0x9d2c5680; y ^= (y << 7) & 0x9d2c5680;
y ^= (y << 15) & 0xefc60000; y ^= (y << 15) & 0xefc60000;
...@@ -63,7 +63,7 @@ static inline unsigned int av_random(AVRandomState *state) ...@@ -63,7 +63,7 @@ static inline unsigned int av_random(AVRandomState *state)
return y; return y;
} }
/** return random in range [0-1] as double */ /** Return random in range [0-1] as double. */
static inline double av_random_real1(AVRandomState *state) static inline double av_random_real1(AVRandomState *state)
{ {
/* divided by 2^32-1 */ /* divided by 2^32-1 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment