#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_random_init (AVRandomState *state, unsigned int seed) |
Initializes mt[AV_RANDOM_N] with a seed. | |
void | av_init_random (unsigned int seed, AVRandomState *state) |
void | av_random_generate_untempered_numbers (AVRandomState *state) |
Generates AV_RANDOM_N words at one time (which will then be tempered later). |
#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 | |||
) |
void av_random_generate_untempered_numbers | ( | AVRandomState * | state | ) |
Generates AV_RANDOM_N words at one time (which will then be tempered later).
Regenerate the untempered numbers (must be done every 624 iterations, or it will loop).
av_random calls this; you shouldn't.
Definition at line 68 of file random.c.
Referenced by av_random().
void av_random_init | ( | AVRandomState * | state, | |
unsigned int | seed | |||
) |
Initializes mt[AV_RANDOM_N] with a seed.
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.
Definition at line 40 of file random.c.
Referenced by av_init_random(), cook_decode_init(), decode_init(), main(), mpc7_decode_init(), mpc8_decode_init(), and roq_encode_init().