diff options
Diffstat (limited to 'libavutil/lfg.h')
-rw-r--r-- | libavutil/lfg.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavutil/lfg.h b/libavutil/lfg.h index ec90562cf2..03f779ad8a 100644 --- a/libavutil/lfg.h +++ b/libavutil/lfg.h @@ -22,6 +22,8 @@ #ifndef AVUTIL_LFG_H #define AVUTIL_LFG_H +#include <stdint.h> + typedef struct AVLFG { unsigned int state[64]; int index; @@ -30,6 +32,13 @@ typedef struct AVLFG { void av_lfg_init(AVLFG *c, unsigned int seed); /** + * Seed the state of the ALFG using binary data. + * + * Return value: 0 on success, negative value (AVERROR) on failure. + */ +int av_lfg_init_from_data(AVLFG *c, const uint8_t *data, unsigned int length); + +/** * Get the next random unsigned 32-bit number using an ALFG. * * Please also consider a simple LCG like state= state*1664525+1013904223, |