Browse Source

Document av_lfg_get().

Originally committed as revision 14461 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Michael Niedermayer 17 years ago
parent
commit
2cf3c8632c
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      libavutil/lfg.h

+ 6
- 0
libavutil/lfg.h View File

@@ -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];


Loading…
Cancel
Save