From 2cf3c8632cb8d2819942f45aefd1cb5faa014da0 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 28 Jul 2008 15:47:06 +0000 Subject: Document av_lfg_get(). Originally committed as revision 14461 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavutil/lfg.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libavutil/lfg.h') diff --git a/libavutil/lfg.h b/libavutil/lfg.h index 0882faab02..36c36f446b 100644 --- a/libavutil/lfg.h +++ b/libavutil/lfg.h @@ -29,6 +29,12 @@ typedef struct { 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]; -- cgit v1.2.3