FFmpeg
|
#include <stdint.h>
Go to the source code of this file.
Data Structures | |
struct | AVLFG |
Context structure for the Lagged Fibonacci PRNG. More... | |
Functions | |
void | av_lfg_init (AVLFG *c, unsigned int seed) |
int | av_lfg_init_from_data (AVLFG *c, const uint8_t *data, unsigned int length) |
Seed the state of the ALFG using binary data. More... | |
static unsigned int | av_lfg_get (AVLFG *c) |
Get the next random unsigned 32-bit number using an ALFG. More... | |
static unsigned int | av_mlfg_get (AVLFG *c) |
Get the next random unsigned 32-bit number using a MLFG. More... | |
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. More... | |
Definition at line 32 of file lfg.c.
Referenced by a64multi_encode_init(), ac3_decode_init(), amrwb_decode_init(), atrac9_decode_init(), cinepak_encode_init(), cng_decode_init(), config_input(), config_output(), config_props(), cook_decode_init(), dct_error(), decode_init(), deshake_opencl_init(), encode_init(), fill_random(), idct248_error(), init(), init_noise(), main(), mkv_init(), mpc7_decode_init(), mpc8_decode_init(), roq_encode_init(), and rtmp_handshake().
Seed the state of the ALFG using binary data.
Definition at line 64 of file lfg.c.
Referenced by ac3_decode_frame().
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 53 of file lfg.h.
Referenced by ac3_decode_transform_coeffs_ch(), activate(), av_bmg_get(), cng_decode_frame(), config_input(), config_output(), drand(), draw_sierpinski(), ff_eac3_apply_spectral_extension(), ff_eac3_decode_transform_coeffs_aht_ch(), fill_random(), filter_frame(), get_high_utility_cell(), idct248_error(), idx_to_quant(), init(), init_block(), init_noise(), main(), make_block_map(), make_horizontal_map(), make_vertical_map(), mkv_get_uid(), mkv_init(), mpc8_decode_frame(), nelly_decode_block(), process_frame(), rand_in(), rtmp_handshake(), scalar_dequant_float(), and scaled_hb_excitation().
Get the next random unsigned 32-bit number using a MLFG.
Please also consider av_lfg_get() above, it is faster.
Get the next two numbers generated by a Box-Muller Gaussian generator using the random numbers issued by lfg.
lfg | pointer to the contex structure |
out | array where the two generated numbers are placed |
Definition at line 49 of file lfg.c.
Referenced by fill_with_noise(), and main().