summaryrefslogtreecommitdiff
path: root/libavutil/lfg.h
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2009-12-12 16:24:37 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2009-12-12 16:24:37 +0000
commit3ba69a15c680596feeef1d213ce2b85823dde985 (patch)
treef0921738d1342b2c1edd70c69cd54a8bd771d9a4 /libavutil/lfg.h
parent62d75662391733cb97edfe1ed000afe2360bc0f3 (diff)
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.h8
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 */