View Single Post
Old 31st May 2006, 20:51   #1  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
AddGrainC (now with Chroma noise & YUY2, RGB)

As an experiment I made a version of Tom Barry's AddGrain with chroma noise, no more need for scripting workarounds.

AddGrain(var,hcorr,vcorr,uvar,seed)
AddGrainC(var,uvar,hcorr,vcorr,seed)

var, uvar:
luma and chroma variance.
chroma does nothing in rgb mode.

hcorr,vcorr:
horizontal & veritcal correlation.

seed:
int, to keep the same grain on every frame.

Unlike the original, these are all named and optional and default to 0.0 except var, which is 1.0.

It may be faster, it may also be SSE2 only (haven't run it on the Athlon yet). Thought it might be useful to others, I'll finish up the readme if there's any demand.

Download v1.7.1 here.

One name is meant to be backward compatible, one is meant to make more sense, I don't know which I prefer so I just left both.

Code:
Changelist:
1.0	2003/06/18   Tom Barry    Initial Release
1.1	2006/06/01   Foxyshadis   Chroma grain + constant seed
1.2	2006/06/06   Foxyshadis   Supports YUY2, RGB. Fix cache mess.
1.3	2006/06/10   Foxyshadis   Crashfix, noisegen optimization
1.4	2006/08/11   Foxyshadis   Constant replaces seed, seed repeatable
1.5	2010/05/07   Foxyshadis   Limit the initial seed generation to fix memory issues.
1.5.1   2010/05/13   Firesledge   The source code compiles on Visual C++ versions older than 2008
1.5.2   2011/10/26   Firesledge   Removed the SSE2 requirement.
1.5.3   2011/10/26   Firesledge   Fixed coloring and bluring in RGB24 mode.
1.5.4   2011/10/27   Firesledge   Fixed bad pixels on the last line in YV12 mode when constant=true,
                                  fixed potential problems with frame width > 4096 pixels
                                  and fixed several other minor things.
1.6.0   2011/10/28   LaTo INV.    Added SSE2 code (50% faster than MMX).
1.6.1   2011/10/29   LaTo INV.    Automatic switch to MMX if SSE2 is not supported by the CPU.
1.7.0   2012/08/16   Firesledge   Supports Y8, YV16, YV24 and YV411 colorspaces.
1.7.1   2013/11/25   Firesledge   64-bit version.

Last edited by foxyshadis; 15th May 2014 at 01:21. Reason: new v1.7.1
foxyshadis is offline   Reply With Quote