:: Re: [Frei0r] "rgbnoise" plugin
Top Pagina
Delete this message
Reply to this message
Auteur: Janne Liljeblad
Datum:  
Aan: Minimalistic plugin API for video effects
Onderwerp: Re: [Frei0r] "rgbnoise" plugin
> Why 32767 and not 32768? (Also, seemingly, you are only using 32766 of the
> values.) You usually either want a power-of-two (for fast mod) or a prime
> (for not getting into sync with other factors). Power-of-two-minus-two is
> just odd.


32767 is a number I got from internet as a (probably) guaranteed min
value for RAND_MAX. Just to keep things simple, I do not want to
discover what the number is runtime -1 is just to be sure that no
overflows happen, ugly, but always works.

> You still multiply noise and 127.0 together for every single pixel.


True, will fix.

> Note that you are creating a bias here; the patterns in the middle of the
> array are much more likely to be seen than, say, gaussian_lookup[0..10].
> This might not matter, though.


I'm quite sure that this does not matter visually.

Tomorrow I'll send a patch to avoid the unnecessary multiplication by 127.0