[FFmpeg-devel] [PATCH] normal PRNG using ziggurat method
Tue Sep 9 02:05:34 CEST 2008
This is a patch to add a PRNG which generates numbers with standard
normal distribution. It uses the ziggurat method, which is quite fast
compared to other methods.
I was working on another implementation based on the original paper,
which had sample code in it that I was using as a starting point. Then
I noticed the teeny tiny print at the bottom of the journal's download
page which states that the code is under GPL... :( I found another
implementation which was based on the paper without using the
accompanying code and is under a BSD-style license. I trimmed it down,
cleaned-up it up, and adapted it for FFmpeg.
I need this for spectral extension processing in the E-AC-3 decoder.
The spec requires that the generated noise which is blended with
translated coeffs have "zero-mean, unity variance".
For my needs in E-AC-3, I chose to make it output fixed-point values.
Due to the range needed for normal distribution, I made it signed
4.28-bit instead of 32-bit. If floating-point output is preferred, I
could change it and just do the conversion in the decoder.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 8889 bytes
Desc: not available
More information about the ffmpeg-devel