diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2009-12-12 16:24:37 +0000 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2009-12-12 16:24:37 +0000 |
commit | 3ba69a15c680596feeef1d213ce2b85823dde985 (patch) | |
tree | f0921738d1342b2c1edd70c69cd54a8bd771d9a4 /libavutil/lfg.h | |
parent | 62d75662391733cb97edfe1ed000afe2360bc0f3 (diff) | |
download | ffmpeg-3ba69a15c680596feeef1d213ce2b85823dde985.tar.gz |
Implement av_bmg_next(), a Box-Muller Gaussian random generator.
See the thread:
"[FFmpeg-devel] [PATCH] Box-Muller gaussian generator".
Originally committed as revision 20808 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/lfg.h')
-rw-r--r-- | libavutil/lfg.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavutil/lfg.h b/libavutil/lfg.h index 3250c18e79..ac89d120d5 100644 --- a/libavutil/lfg.h +++ b/libavutil/lfg.h @@ -51,4 +51,12 @@ static inline unsigned int av_mlfg_get(AVLFG *c){ return c->state[c->index++ & 63] = 2*a*b+a+b; } +/** + * Gets the next two numbers generated by a Box-Muller Gaussian + * generator using the random numbers issued by lfg. + * + * @param out[2] array where are placed the two generated numbers + */ +void av_bmg_get(AVLFG *lfg, double out[2]); + #endif /* AVUTIL_LFG_H */ |