libavutil/lfg.h File Reference

Go to the source code of this file.

Data Structures

struct  AVLFG

Functions

void av_lfg_init (AVLFG *c, unsigned int seed)
static unsigned int av_lfg_get (AVLFG *c)
 Get the next random unsigned 32-bit number using an ALFG.
static unsigned int av_mlfg_get (AVLFG *c)
 Get the next random unsigned 32-bit number using a MLFG.
void av_bmg_get (AVLFG *lfg, double out[2])
 Get the next two numbers generated by a Box-Muller Gaussian generator using the random numbers issued by lfg.


Function Documentation

void av_bmg_get ( AVLFG lfg,
double  out[2] 
)

Get the next two numbers generated by a Box-Muller Gaussian generator using the random numbers issued by lfg.

Parameters:
out array where the two generated numbers are placed

Definition at line 45 of file lfg.c.

static unsigned int av_lfg_get ( AVLFG c  )  [inline, static]

Get the next random unsigned 32-bit number using an ALFG.

Please also consider a simple LCG like state= state*1664525+1013904223, it may be good enough and faster for your specific use case.

Definition at line 38 of file lfg.h.

Referenced by ac3_decode_transform_coeffs_ch(), av_bmg_get(), dct_error(), ff_eac3_apply_spectral_extension(), ff_eac3_decode_transform_coeffs_aht_ch(), fill_random(), frandom(), get_high_utility_cell(), http_parse_request(), idct248_error(), idx_to_quant(), main(), mkv_write_header(), mpc8_decode_frame(), nelly_decode_block(), rtmp_handshake(), rtsp_cmd_setup(), scalar_dequant_float(), scaled_hb_excitation(), and start_multicast().

void av_lfg_init ( AVLFG c,
unsigned int  seed 
)

static unsigned int av_mlfg_get ( AVLFG c  )  [inline, static]

Get the next random unsigned 32-bit number using a MLFG.

Please also consider av_lfg_get() above, it is faster.

Definition at line 48 of file lfg.h.


Generated on Fri Oct 26 02:39:49 2012 for FFmpeg by  doxygen 1.5.8