Mercurial > libavutil.hg
changeset 535:4ea718352036 libavutil
Document av_lfg_get().
author | michael |
---|---|
date | Mon, 28 Jul 2008 15:47:06 +0000 |
parents | 0f5a73051b25 |
children | 5aa27a4a9e45 |
files | lfg.h |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/lfg.h Mon Jul 28 15:44:00 2008 +0000 +++ b/lfg.h Mon Jul 28 15:47:06 2008 +0000 @@ -29,6 +29,12 @@ void av_lfg_init(AVLFG *c, unsigned int seed); +/** + * Gets the next random unsigned 32bit number. + * + * Please also consider a simple LCG like state= state*1664525+1013904223, + * it may be good enough and faster for your specific use case. + */ static inline unsigned int av_lfg_get(AVLFG *c){ c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63]; return c->state[c->index++ & 63];