From 3ba69a15c680596feeef1d213ce2b85823dde985 Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Sat, 12 Dec 2009 16:24:37 +0000 Subject: 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 --- libavutil/lfg.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libavutil/lfg.h') 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 */ -- cgit v1.2.1