libavutil/random.c File Reference

#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 Documentation

#define A   0x9908b0df

Definition at line 41 of file random.c.

#define LOWER_MASK   0x7fffffff

Definition at line 43 of file random.c.

Referenced by av_random_generate_untempered_numbers().

#define M   397

see http://en.wikipedia.org/wiki/Mersenne_twister for an explanation of this algorithm.

Definition at line 40 of file random.c.

#define UPPER_MASK   0x80000000

Definition at line 42 of file random.c.

Referenced by av_random_generate_untempered_numbers().


Function Documentation

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().


Generated on Sat Sep 6 21:25:20 2008 for ffmpeg by  doxygen 1.5.6