#include "avutil.h"
#include "common.h"
Go to the source code of this file.
Data Structures | |
struct | AVRandomState |
Defines | |
#define | AV_RANDOM_N 624 |
Functions | |
attribute_deprecated void | av_init_random (unsigned int seed, AVRandomState *state) |
void | av_random_init (AVRandomState *state, unsigned int 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. | |
void | av_random_generate_untempered_numbers (AVRandomState *state) |
Regenerate the untempered numbers (must be done every 624 iterations, or it will loop). | |
static unsigned int | av_random (AVRandomState *state) |
Generates a random number from the interval [0,0xffffffff]. | |
static double | av_random_real1 (AVRandomState *state) |
Returns a random number in the range [0-1] as double. |
#define AV_RANDOM_N 624 |
Definition at line 27 of file random.h.
Referenced by av_random(), av_random_generate_untempered_numbers(), and av_random_init().
attribute_deprecated void av_init_random | ( | unsigned int | seed, | |
AVRandomState * | state | |||
) |
static unsigned int av_random | ( | AVRandomState * | state | ) | [inline, static] |
Generates a random number from the interval [0,0xffffffff].
Please do NOT use the Mersenne Twister, it is slow. Use the random number generator 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 some evidence that it makes a difference for the case where you use it.
Definition at line 52 of file random.h.
Referenced by av_random_real1(), get_high_utility_cell(), http_parse_request(), idx_to_quant(), mpc8_decode_frame(), nelly_decode_block(), rtsp_cmd_setup(), scalar_dequant_float(), and start_multicast().
void av_random_generate_untempered_numbers | ( | AVRandomState * | state | ) |
Regenerate the untempered numbers (must be done every 624 iterations, or it will loop).
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 | |||
) |
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().
static double av_random_real1 | ( | AVRandomState * | state | ) | [inline, static] |