# AddGrain

## Übersicht

Autor: Tom Barry
Version: 0.1.0.0
Download: http://mywebpages.comcast.net/trbarry/downloads.htm
Kategorie: Verschiedenes
Anforderungen: YV12 Farbformat

## Description

AddGrain generates film like grain or other effects (like rain) by adding random noise to a video clip. This noise may optionally be horizontally or vertically correlated to cause streaking.

### Usage

1) Place the AddGrain.dll in a directory somewhere. If that is the C:\Program Files\AviSynth 2.5\plugins folder folder (recommended) then you can omit the LoadPlugin command in your script. In your Avisynth file use commands similar to

LoadPlugin("F:\AddGrain\AddGrain.dll")
Avisource("D:\wherever\myfile.avi")
AddGrain(20,0,0)

Of course replace the file and directory names with your own.

### P arameters

AddGrain(float stddev, float HorizCorr, float VerticalCorr)

where:

stddev = the standard deviation of the noise generated.

HorizCorr = the horizontal correlation factor, causing horizontal steaking. (0.0 to 1.0)

VerticalCorr = the vertical correlation factor. (0.0 to 1.0)

The correlation factors are actually just implemented as exponential smoothing which give a weird side affect that I did not attempt to adjust. But this means that as you increase either corr factor you will have to also increase the stddev (grain amount) in order to get the same visible amount of grain, since it is being smooth out a bit.

Increase both corr factors can somewhat give clumps, or larger grain size.

And there is an interesting effect with, say, AddGrain(800,0,.9) or any huge amount of strongly vertical grain. It can make any scene look like it is raining.