[FFmpeg-devel] [PATCHv3 1/3] lavu/rand: add 64 bit random number generator

Michael Niedermayer michael at niedermayer.cc
Wed Mar 16 02:24:25 CET 2016

On Wed, Mar 16, 2016 at 02:18:54AM +0100, Michael Niedermayer wrote:
> On Tue, Mar 15, 2016 at 11:37:30PM +0000, Derek Buitenhuis wrote:
> > On 3/15/2016 10:26 PM, Ganesh Ajjanagadde wrote:
> > > If one wants good Gaussian samples, then yes, I need a 64 bit rng.
> > > Please also note that I can use av_lfg_get, it does not result in
> > > slowdown, since speed benefits here come from the ziggurat algo.
> > > Concretely, it is 82 cycles vs 81 cycles; too little to clearly
> > > distinguish. I was just not too happy with av_lfg_get << 32 |
> > > av_lfg_get as it resulted in some bad values in the Anderson Darling
> > > tests.
> > 
> > "If one wants good Gaussian samples" doesn't explain at all how it is
> > relevant to a set of multimedia libraries like FFmpeg. Why do we want
> > those? That is the relevant information which should be mentioned
> > in the commit message.
> i cant speak for AACs need for gaussian RNG but for example
> libavfilter/vf_noise.c supports gaussian noise and as i realize now
> does so by duplicating a BMG
> audio noise generation similarly would need some gausian RNG to
> generate gaussian noise.
> The random samples should be good enough to appear random to humans or
> any subsequent filters (it would be bad if artifacts appear after
> subsequent filters due to defects in the priorly added noise)
> so i think there are cases in multimedia where gausian noise is needed,
> "good Gaussian samples" is too vague but as a user i would want a
> noise filter to produce good noise

also for an actual use case, consider someone writing a paper and
needing some noisy video for some experiments. One really wants
flawless noise for such experiments even if that is slow.
Noone wants one paper screwed up due to some flawed random number

so id say yes multimedia (filters) do need good Gaussian samples


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No snowflake in an avalanche ever feels responsible. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160316/8e6d593e/attachment.sig>

More information about the ffmpeg-devel mailing list