summaryrefslogtreecommitdiff
path: root/libavutil/lfg.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-07-28 15:47:06 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-07-28 15:47:06 +0000
commit2cf3c8632cb8d2819942f45aefd1cb5faa014da0 (patch)
treee99f6b8c52fcaa073fb047f2f13d0e126e7a3439 /libavutil/lfg.h
parente80d47411902929c3acecb7c2e3a8116095f4c70 (diff)
Document av_lfg_get().
Originally committed as revision 14461 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/lfg.h')
-rw-r--r--libavutil/lfg.h6
1 files changed, 6 insertions, 0 deletions
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];