#include <stdio.h>
#include "random.h"
Go to the source code of this file.
Defines | |
#define | M 397 |
see http://en.wikipedia.org/wiki/Mersenne_twister for an explanation of this algorithm. | |
#define | A 0x9908b0df |
#define | UPPER_MASK 0x80000000 |
#define | LOWER_MASK 0x7fffffff |
Functions | |
void | av_init_random (unsigned int seed, AVRandomState *state) |
initializes mt[AV_RANDOM_N] with a seed | |
void | av_random_generate_untempered_numbers (AVRandomState *state) |
generate AV_RANDOM_N words at one time (which will then be tempered later) (av_random calls this; you shouldn't) |
#define LOWER_MASK 0x7fffffff |
#define M 397 |
see http://en.wikipedia.org/wiki/Mersenne_twister for an explanation of this algorithm.
#define UPPER_MASK 0x80000000 |
void av_init_random | ( | unsigned int | seed, | |
AVRandomState * | state | |||
) |
initializes mt[AV_RANDOM_N] with a seed
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
Definition at line 46 of file random.c.
Referenced by ac3_decode_init(), cook_decode_init(), decode_init(), main(), mpc7_decode_init(), mpc8_decode_init(), and roq_encode_init().
void av_random_generate_untempered_numbers | ( | AVRandomState * | state | ) |
generate AV_RANDOM_N words at one time (which will then be tempered later) (av_random calls this; you shouldn't)
Regenerate the untempered numbers (must be done every 624 iterations, or it will loop).
Definition at line 66 of file random.c.
Referenced by av_random().