Video Artifact Filters

The Complete Reference for All Editions

For versions 1.9.0+

Press Ctrl+F in a browser to search by name.

The complete AviSynth language reference with internal filters is here: avisynth.nl.

Low-level filters used to create another filters are not included in this manual. See documentations from the filter developers.

Colors: Licensed to use with Video Artifact only, Video Artifact Player and Premium only, Extended filters.

Multithreading

function MTMode(int mode, int "threads")

Sets AviSynth MT Mode.

mode is AviSynth MT mode. Values: 2 is for processing code; 3,5 are for read filters.

threads is a threads count from 1. If you specify zero or negative values it will keep 1. Do not specify a big value or you will get a crash. Better values for a 1920x1080 source are 2..8. Second use cannot change the thread count. Only the first call sets threads. It is an AviSynth MT limitation.

returns nothing.

This function is compatible with AviSynth Plus MT. Do not use AviSynth default function SetMTMode.

function MTModeLast(clip c)

The last multithreading function.

c is clip.

returns clip.

Every multithreading processing code must have this function call at the end of scripts. This function is compatible with AviSynth MT and AviSynth Plus MT. Do not use the AviSynth Plus MT default function Prefetch.

function GetMTModeCompatible()

Returns a current AviSynth MT Mode.

return value is 0 if MT is disabled. Values: 2 is for processing code; 3,5 are for read filters.

This function is compatible with AviSynth Plus MT. Do not use the AviSynth default function GetMTMode.

Memory

function SetMemoryMax(int amount)

AviSynth internal

Set AviSynth cache memory.

amount is memory value in megabytes. Try 3000 as a good default. Maximal value is 3700.

returns nothing.

AviSynth works in a 32-bit memory model. This mean only 3.5 GB memory can be used. Do not use big or small values or you can get very slow processing or crash. Better values for multithreading are 1000...3500. Try find a bigger value to get faster processing speed. Please note that memory is also shared for filters, so using big values these filters cannot work properly without free memory and you will get a crash. 3000 is a good value for most complex scripts.

function LoadAllPlugins()

Load all VACore plug-ins.

returns nothing.

This function loads all VACore filters to use in your code. By default only core filters are available. This function is good for AviSynth developers in VA Basic edition. It is not required call if you use camera templates from extended editions.

Read Source Files

function VideoLA(string file, int "fpsnum", int "fpsden", int "subsampling", int "bitdepth", string "fmt", int "threads", bool "dr")

Read video using L-SMASH decoder with *.lwi index files.

file is a video file path.

fpsnum is a fps numerator. Try 24, 25, 50, 60.

fpsden is a fps denumerator. Try 1.

subsampling is a result subsampling mode: 420, 422 or 444.

bitdepth is a clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

fmt is an alternative clip format for special read cases, for example RGB24. It is not recommended to use with VA because VA processes video in YUV.

threads is a thread count. Try 4. More threads require more memory cache, so do not use big count of threads or you can get crash. Do not use SetMemoryMax with extreme big values, or this function will also fail.

dr is a direct render mode for some videos. Try false.

returns video-only clip.

This function is recommended for all video file formats. External FFmpeg libraries are required to support extended formats.

Special TV-compatible fps codes: 24000/1001 for 23.975, 30000/1001 for 29.970, 60000/1001 for 59.940.

This function saves *.lwi files and does not replace them if they already exist. If you replace your original video with a new version, read will work incorrectly. So, always delete the index files in these cases.

function AudioLA(clip c, string file, int "stream_index", string "layout", int "rate")

Read audio using L-SMASH decoder with *.lwi index files.

c is a video clip from VideoLA().

file is a video or audio file path.

stream_index is a stream index. Try 1. Value -1 means trying to get the first detected audio stream.

layout is a channel layout. More info about values.

rate is a sampling rate or sampling frequency in units of Hz. Try 0 for native.

returns a clip with audio.

This function is recommended for all files. External FFmpeg libraries are required to support extended formats.

This function saves *.lwi files and does not replace them if already exist. If you replace your original file with a new version, read will work incorrectly. So, always delete the index files in these cases.

function VideoLS(string file, int "fpsnum", int "fpsden", int "subsampling", int "bitdepth", string "fmt", int "threads", bool "dr")

Read video using native L-SMASH decoder without indexing.

file is a video file path.

fpsnum is a fps numerator. Try 24, 25, 50, 60.

fpsden is a fps denumerator. Try 1.

subsampling is a result subsampling mode: 420, 422 or 444.

bitdepth is a clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

fmt is an alternative clip format for special read cases, for example RGB24. It is not recommended to use with VA because VA processes video in YUV.

threads is a thread count. Try 4. More threads require more memory cache, so do not use big count of threads or you can get crash. Do not use SetMemoryMax with extreme big values, or this function will also fail.

dr is a direct render mode for some videos. Try false.

returns video-only clip.

This function is recommended for MP4 files only. External FFmpeg libraries are required to support.

Special TV-compatible fps codes: 24000/1001 for 23.975, 30000/1001 for 29.970, 60000/1001 for 59.940.

function AudioLS(clip c, string file, int "track", string "layout", int "rate")

Read audio using native L-SMASH decoder without indexing.

c is a video clip from VideoLS().

file is a video or audio file path.

track is a track number. Try 0. The value 0 means trying to get the first detected audio stream.

layout is a channel layout. More info about values.

rate is a sampling rate or sampling frequency in units of Hz. Try 0 for native.

returns a clip with audio.

This function is recommended for MP4 files only. External FFmpeg libraries are required to support.

Service String Functions for File Names

function FileName(string file)

Extract a file name part without an extension.

file is file path.

returns a file name only.

Useful function to change path or to make audio file path from a video file path.

Bitdepth Conversion

function Bitdepth(clip c, int "from", int "to")

HDRCore

Convert YUV or Y bitdepth.

c is clip.

from and to are clip bitdepth codes: 8, 16, 32 or 88 for stacked 16-bit.

returns clip.

This is a core function to convert video bitdepth. Sierra 2-4A dithering is used for 8 bit output.

function BitdepthLsb(clip c)

HDRCore

Returns a 8-bit clip with LSB truncate.

c is clip.

returns clip.

This is a core function to get a 8-bit clip from 16 or 32 bit using value truncate.

function BitdepthMsb(clip c)

HDRCore

Returns LSB values in 8-bit clip.

c is clip.

returns clip.

Useful to see high-bitdepth bits or to process 16-bit video using 8-bit AviSynth filters.

function BitdepthMsbLsb(clip msb, clip lsb, int "bitdepth")

HDRCore

Combines two 8-bit clip parts to the final HDR clip.

msb is a msb clip.

lsb is a lsb clip.

bitdepth is an output clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns clip.

Useful to process 16-bit video using 8-bit AviSynth filters.

function Dither8bit(clip c, int "mode", int "bitdepth")

Returns 8-bit clip using different dither algorithms.

c is clip.

mode is dither mode code: 0=ordered, 1-5=dither, 6=Floyd-Steinberg, 7=Stucki, 8=Atkinson.

bitdepth is an input clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns 8-bit clip.

For most screen source types Atkinson dithering is recommended.

Range and Levels

function RangeY(clip c, float "a", float "b", float "ao", float "bo", float "g", int "mode", int "bitdepth")

HDRCore

Levels filter for Y.

c is clip.

a and b are clip Y-channel input range. For TV standard it is 16...235.

ao and bo are clip Y-channel output range. For TV standard it is 16...235.

g is gamma correction value. Try 1.0 for a neutral value.

mode is 8-bit quality mode: 0 - draft calculation with rounding. 1 - precise Sierra 2-4A dithering.

bitdepth is a clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns clip.

This function scales a brightness range. No clipping. Useful to correct non-standard camera range 16..255 or simple gamma correction. You can also convert clip values: gamma-to-linear and back, using g=2.2 or 1.0/2.2.

function RangeUV(clip c, float "au", float "bu", float "aou", float "bou", float "av", float "bv", float "aov", float "bov", int "mode", int "bitdepth")

HDRCore

Levels filter for U and V.

c is clip.

au and bu are clip U-channel input range. For TV standard it is 16...240.

aou and bou are clip U-channel output range. For TV standard it is 16...240.

av and bv are clip V-channel input range. For TV standard it is 16...240.

aov and bov are clip V-channel output range. For TV standard it is 16...240.

mode is 8-bit quality mode: 0 - draft calculation with rounding. 1 - precise Sierra 2-4A dithering.

bitdepth is a clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns clip.

This function scales color range. No clipping.

function ClampHDR(clip c, float "ay", float "by", float "au", float "bu", float "av", float "bv", int "bitdepth")

HDRCore

Truncate YUV values.

c is clip.

ay and by are Y-channel truncate range. For TV standard it is 16...235.

au and bu are clip U-channel truncate range. For TV standard it is 16...240.

av and bv are clip V-channel truncate range. For TV standard it is 16...240.

bitdepth is a clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns clip.

This function makes broadcast-compatible TV signal.

Color Correction

function Saturation(clip c, float "sat", float "satyb", float "satgr", float "dyb", float "dgr", int "mode", int "bitdepth")

Color saturation for YUV.

c is a clip.

sat is a saturation value. Try 1.0 as no changes.

satyb is a saturation value for yellow/blue tones. Try 1.0 as no changes.

satgr is a saturation value for green/red tones. Try 1.0 as no changes.

dyb is a yellow/blue balance difference. Try 0.0 as no changes.

dgr is a red/green balance difference. Try 0.0 as no changes.

mode is a quality processing mode for 8-bit clips: 0 - draft calculation with rounding. 1 - precise Sierra 2-4A dithering.

bitdepth is a clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns a clip.

Try small variations 0.7...1.5 for better results.

function Matrix(clip c, int "from", int "to", float "rg", float "gg", float "bg", float "a", float "b", float "ao", float "bo", int "bitdepth")

HDRMartix

TV standard matrix conversion, color correction and levels.

c is clip.

from and to are TV standard codes: 601 or 709. Use 601 for SD clips or 709 for HD clips.

rg, gg and gb are RGB gain values. Use 1.0 for no brightness correction.

a and b are clip Y-channel input range. For TV standard it is 16...235.

ao and bo are clip Y-channel output range. For TV standard it is 16...235.

bitdepth is a clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns clip.

This function uses very quality 32-bit matrix conversion between TV standards. You can also use it for color correction in RGB and level correction in YUV.

function Cube(clip c, string "file", int "from", int "to", float "rg", float "gg", float "bg", float "a", float "b", float "ao", float "bo", float "sat", float "sato", int "bitdepth")

HDRColor

3D LUT, color correction and levels.

c is clip.

file is a 3D LUT file. *.cube or *.3dl is supported. If you specify "", no 3D LUT operation will apply.

from and to are TV standard codes: 601 or 709. Use 601 for SD clips or 709 for HD clips.

rg, gg and gb are RGB gain values. Use 1.0 for no brightness correction.

a and b are clip Y-channel input range. For TV standard it is 16...235.

ao and bo are clip Y-channel output range. For TV standard it is 16...235.

sat is a clip input saturation before 3D LUT. Try 1.0 for no changes.

sato is a clip output saturation after 3D LUT. Try 1.0 for no changes.

bitdepth is a clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns clip.

This function uses very quality 32-bit color correction algorithms.

function DynRangeY(clip c, float "a1", float "b1", float "a2", float "b2", float "g1", float "g2", float "ao", float "bo", int "mode", int "bitdepth")

HDRColor

Dynamic Levels filter for Y.

c is clip.

a1 and b1 are clip Y-channel input range in the begin frames. For TV standard it is 16...235.

a2 and b2 are clip Y-channel input range in the end frames. For TV standard it is 16...235.

g1 is gamma correction value in the begin frames. Try 1.0 for a neutral value.

g2 is gamma correction value in the end frames. Try 1.0 for a neutral value.

ao and bo are clip Y-channel output range. For TV standard it is 16...235.

mode is 8-bit quality mode: 0 - draft calculation with rounding. 1 - precise Sierra 2-4A dithering.

bitdepth is a clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns clip.

This function scales brightness range. No clipping. Useful to correct evening scene in which the light changes with the sunset.

function Color(clip c, float "sat", float "g", float "saty", float "satb", float "satg", float "satr", float "gy", float "gb", float "gg", float "gr", float "dyb", float "dgr", int "mode", int "bitdepth")

HDRColor

Advanced color saturation corrector for YUV.

c is a clip.

sat is a common saturation value. Try 1.0 as no changes.

g is a common saturation gamma value. Try 1.0 as no changes.

saty is a yellow saturation value. Try 1.0 as no changes.

satb is a blue saturation value. Try 1.0 as no changes.

satg is a green saturation value. Try 1.0 as no changes.

satr is a red saturation value. Try 1.0 as no changes.

gy is a yellow saturation gamma value. Try 1.0 as no changes.

gb is a blue saturation gamma value. Try 1.0 as no changes.

gg is a green saturation gamma value. Try 1.0 as no changes.

gr is a red saturation gamma value. Try 1.0 as no changes.

dyb is a yellow/blue balance difference. Try 0.0 as no changes.

dgr is a red/green balance difference. Try 0.0 as no changes.

mode is a quality processing mode for 8-bit clips: 0 - draft calculation with rounding. 1 - precise Sierra 2-4A dithering.

bitdepth is a clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns a clip.

It is very complex per-color YUV saturation filter to fine tone image saturation.

function DynColor(clip c, float "sat1", float "sat2", float "g1", float "g2", float "saty1", float "saty2", float "satb1", float "satb2", float "satg1", float "satg2", float "satr1", float "satr2", float "gy1", float "gy2", float "gb1", float "gb2", float "gg1", float "gg2", float "gr1", float "gr2", float "dyb1", float "dyb2", float "dgr1", float "dgr2", int "mode", int "bitdepth")

HDRColor

Advanced color saturation corrector for YUV.

c is a clip.

sat1 is a common saturation value in the begin frames. Try 1.0 as no changes.

sat2 is a common saturation value in the end frames. Try 1.0 as no changes.

g1 is a common saturation gamma value in the begin frames. Try 1.0 as no changes.

g2 is a common saturation gamma value in the end frames. Try 1.0 as no changes.

saty1 is a yellow saturation value in the begin frames. Try 1.0 as no changes.

saty2 is a yellow saturation value in the end frames. Try 1.0 as no changes.

satb1 is a blue saturation value in the begin frames. Try 1.0 as no changes.

satb2 is a blue saturation value in the end frames. Try 1.0 as no changes.

satg1 is a green saturation value in the begin frames. Try 1.0 as no changes.

satg2 is a green saturation value in the end frames. Try 1.0 as no changes.

satr1 is a red saturation value in the begin frames. Try 1.0 as no changes.

satr2 is a red saturation value in the end frames. Try 1.0 as no changes.

gy1 is a yellow saturation gamma value in the begin frames. Try 1.0 as no changes.

gy2 is a yellow saturation gamma value in the end frames. Try 1.0 as no changes.

gb1 is a blue saturation gamma value in the begin frames. Try 1.0 as no changes.

gb2 is a blue saturation gamma value in the end frames. Try 1.0 as no changes.

gg1 is a green saturation gamma value in the begin frames. Try 1.0 as no changes.

gg2 is a green saturation gamma value in the end frames. Try 1.0 as no changes.

gr1 is a red saturation gamma value in the begin frames. Try 1.0 as no changes.

gr2 is a red saturation gamma value in the end frames. Try 1.0 as no changes.

dyb1 is a yellow/blue balance difference in the begin frames. Try 0.0 as no changes.

dyb2 is a yellow/blue balance difference in the end frames. Try 0.0 as no changes.

dgr1 is a red/green balance difference in the begin frames. Try 0.0 as no changes.

dgr2 is a red/green balance difference in the end frames. Try 0.0 as no changes.

mode is a quality processing mode for 8-bit clips: 0 - draft calculation with rounding. 1 - precise Sierra 2-4A dithering.

bitdepth is a clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns a clip.

It is very complex dynamic per-color YUV saturation filter to fine tone image saturation. Useful to correct evening scene in which the light changes with the sunset.

Subsampling

function Subsampling(clip c, int "to", string "chroma", string "chromato", int "bitdepth")

Convert YUV subsampling.

c is clip.

to is a result subsampling mode: 420, 422 or 444.

chroma is a source chroma placement mode: "MPEG1", "MPEG2" or "DV".

chromato is a result chroma placement mode: "MPEG1", "MPEG2" or "DV".

bitdepth is a clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns clip.

This is a core function to convert video subsampling.

function RepairChroma8(clip c, clip "m", int "depth", int "r", int "nr")

Repair U and V channel edges in Y8 to make 4:2:2 or 4:4:4.

c is clip.

m is a mask clip from Y-channel to calculate edges. Must be resized.

depth is a repair depth steps from 1. Try 4.

r is a repair radius from 1. Try 1.

nr is an additional repair mode switch 0/1.

returns clip.

Can produce edge artifacts. So use carefully.

Crop

function CropHDR(clip c, int x, int y, int w, int h, int "bitdepth")

Crop frame.

c is clip.

x, y are a crop corner coordinate.

w, h are width and height of crop.

bitdepth is a clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns a cropped clip.

This function can fail if crop is out of the source frame. For 4:2:0 and 4:2:2 use mod 4 values to get correct cropping of U and V channels. Negative values have special meaning to set the cropping of the right and bottom edges respectively.

function Crop(clip c, int x, int y, int w, int h)

AviSynth internal

Crop frame in 8-bit.

c is clip.

x, y are a crop corner coordinate.

w, h are width and height of crop.

returns a cropped clip.

This function can fail if crop is out of the source frame. For 4:2:0 and 4:2:2 use mod 4 values to get correct cropping of U and V channels. Negative values have special meaning to set the cropping of the right and bottom edges respectively.

Resize

function Spline16Resize(clip c, int w, int h)

AviSynth internal

8-bit spline resize.

c is clip.

w, h are target width and height.

returns a clip.

Basic recommended non-ringing resize filter for 8-bit clips.

function ResizeHDR(clip c, int w, int h, string "chroma", int "subsampling", int "bitdepth")

High-quality spline resize.

c is clip.

w, h are target width and height.

chroma is a chroma placement code: "DV", "MPEG1" or "MPEG2".

subsampling is a subsampling mode: 420, 422 or 444.

bitdepth is a clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns a clip.

High-quality resize filter.

function LinearResizeHDR(clip c, int w, int h, float "g", float "a", float "b", string "chroma", int "subsampling", int "bitdepth")

High-quality linear-light spline resize.

c is clip.

w, h are target width and height.

g is a clip gamma value. Try 2.2 for default.

a and b are clip Y-channel input range values. For TV standard it is 16...235.

chroma is a chroma placement code: "DV", "MPEG1" or "MPEG2".

subsampling is a subsampling mode: 420, 422 or 444.

bitdepth is a clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns a clip.

High-quality resize filter that works in linear light.

Trim

function Trim(clip c, int first_frame, int "last_frame", int "end", int "length")

AviSynth internal

Trim frames.

c is clip.

first_frame, last_frame are frame numbers.

end is alternative way to include last frame. Use it instead of last_frame.

length is alternative way to count frames. Use it instead of last_frame.

returns a clip.

Returns a clip starting at first_frame and running up to and including last_frame. If you set last_frame to 0, you will get a clip starting at first_frame and running to the end of the clip. With a negative value for the second argument, you get a clip starting at first_frame and running for num_frames frames.

function MotionDenoiseCompensateTrim(clip c, int frames)

Remove noised frames after motion denoise.

c is a clip.

frames is frame count to trim from begin and also from end. Try 3 for maximal compatible value.

returns a trimmed clip.

This function works with motion denoisers.

Deinterlace

function nnedi3(clip c, int "field", int "nsize", int "nns", int "qual", int "threads", ...)

NNEDI3

High-quality neural network 8-bit deinterlace.

c is clip.

field is the mode of operation (double vs same rate) and which field is kept. Possible settings: -2=double rate, -1=same rate, 0=same rate, keep bottom field, 1=same rate, keep top field, 2=double rate (alternates each frame), starts with bottom, 3=double rate (alternates each frame), starts with top.

nsize is the size code of the local neighborhood around each pixel that is used by the predictor neural network. Try values from 0 to 6: 0 - 8x6, 1 - 16x6, 2 - 32x6, 3 - 48x6, 4 - 8x4, 5 - 16x4, 6 - 32x4.

nns is the number of neurons in the predictor neural network. Possible settings are 0..4. 0 is fastest. 4 is slowest, but should give the best quality.

qual is the number of different neural network predictions that are blended together to compute the final output value. Each neural network was trained on a different set of training data. Blending the results of these different networks improves generalization to unseen data. Possible values are 1 or 2. Essentially this is a quality vs speed option. Larger values will result in more processing time, but should give better results. However, the difference is usually pretty small.

threads is a threads count. Use 0 for auto detect. But manual selection can give better results in complex processing.

returns a clip.

Very high-quality filter. Not all filter parameters are used in this manual. Another minor parameters are in this complete manual

Repair Compression Artifacts

function MosquitoNR8(clip c, float "str", float "restore", int "radius", int "threads")

Remove mosquito noise in 8-bit Y channel.

c is clip.

str is a blur strength in a range 0.0...1.0. Try 0.5 as a good start value.

restore is a restore level in a range 0.0...1.0. Try 1.0 as good and fast start value.

radius is a blur radius, 1 or 2.

threads is a thread count used or 0 for auto detect.

returns a clip.

This filter can destroy image details, so use carefully.

function RepairMpeg8(clip c, float "r", int "mode", float "str")

Remove MPEG/MJPEG compression artifacts in 8-bit Y channel.

c is clip.

r is a blur radius, from 1.0. Try 1.5 as a good start value.

mode is a Repair filter mode code. Try 6. Reference codes.

str is a repair mix strength, in the range 0.0...1.0. Try 0.5 as a good start value.

returns a clip.

This filter can destroy image details, so use carefully.

Deblock

function Deblock8(clip c, float "str", int "shifts", int "mat", int "threads")

Remove sharp halos in 8-bit Y channel using a specialized blur matrices.

c is clip.

str is a deblock strength, in the range 0.0...1.0. Try 0.5 as a good start value.

shifts is a deblock step count: 1(fast)..4(quality).

mat is a deblock martix id from a range 1..110. Try 3. Reference

threads is a thread count or 0 for auto detect.

returns a clip.

This filter can destroy image details, so use carefully.

Oversharp and Halo Removal

function Desharp8(clip c, float "r", float "str")

Remove sharp halos in 8-bit Y channel.

c is clip.

r is a blur radius, from 1.0. Try 1.1 as a good start value.

str is a repair mix strength, in the range 0.0...1.0. Try 0.5 as a good start value.

returns a clip.

This filter can destroy image details, so use carefully.

function HairDesharp8(clip c, float "r", int "mul", int "th")

Remove sharp artifacts from hairs in 8-bit Y channel.

c is clip.

r is a blur radius, from 1.0. Try 1.1 as a good start value.

mul is an edge mask multiplication to get it bolder. Try 15 as a good start value.

th is a threshold in 8-bit scale to mask only black areas. Try 180 as a good start value.

returns a clip.

This filter can destroy image details and makes hairs blurred, so use carefully.

Dehalo

function Dehalo8(clip c, float "r", float "los", float "his", int "th", float "str")

Remove halos in 8-bit Y channel.

c is clip.

r is a halo radius, from 1.0. Try 1.5 as a good start value.

los is a low brightness halo strength. Try 0.5 as a good start value.

his is a high brightness halo strength. Try 0.5 as a good start value.

th is a brightness threshold in 8-bit range. Try 30.

str is a mix strength, in the range 0.0...1.0. Try 0.5 as a good start value.

returns a clip.

This filter can destroy image details, so use carefully.

Color Channel Halos

function EdgeDesaturate8(clip c, clip "m", float "r", float "str", int "th1", int "th2")

Desaturate color halos in 8-bit U or V channel (Y8).

c is clip.

m is a mask clip from Y-channel to calculate edges. Must be resized.

r is a halo radius, from 1.0. Try 2.5 as a good start value.

str is a mix strength, in the range 0.0...1.0. Try 0.5 as a good start value.

th1 is a low channel threshold in 8-bit range. Try 15.

th2 is a high channel threshold in 8-bit range. Try 15.

returns a clip.

This filter can destroy image details, so use carefully. Use in U and V channels. th1 and th2 are calculated as an offset from the starting gray level (128).

function ColorDehalo8(clip c, float "r", float "los", float "his", int "th1", int "th2")

Remove halos in 8-bit U or V channel (Y8).

c is clip.

r is a halo radius, from 1.0. Try 2.5 as a good start value.

los is a low channel halo strength. Try 0.5 as a good start value.

his is a high channel halo strength. Try 0.5 as a good start value.

th1 is a low channel threshold in 8-bit range. Try 15.

th2 is a high channel threshold in 8-bit range. Try 15.

returns a clip.

This filter can destroy image details, so use carefully. Use in U and V channels. th1 and th2 are calculated as an offset from the starting gray level (128). Works like Dehalo8, but with double thresholds.

Antialiasing

function NnediAA8(clip c, clip "m", int "strh", int "strv", int "bold", float "str")

NNEDI-based antialiasing in 8-bit Y.

c is clip.

m is optional mask clip to calculate edges. May be the same as c.

strh is a horizontal strength, in NNEDI steps: 1,2 or bigger.

strv is a vertical strength, in NNEDI steps: 1,2 or bigger.

bold is a bold mode 1/0 to enable bolder antialiasing.

str is an edge mix strength, in the range 0.0...1.0. Try 0.5 as a good start value.

returns a clip.

Basic antialiasing filter.

function EediAA8(clip c, clip "m", int "strh", int "strv", float "str")

EEDI-based antialiasing in 8-bit Y.

c is clip.

m is optional mask clip to calculate edges. May be the same as c.

strh is a horizontal strength, in NNEDI steps: 1,2 or bigger.

strv is a vertical strength, in NNEDI steps: 1,2 or bigger.

str is an edge mix strength, in the range 0.0...1.0. Try 0.5 as a good start value.

returns a clip.

Very slow antialiasing filter, but works better for bold aliasing.

function BoldAA8(clip c, clip "m", float "r", int "mode", float "str")

Low quality blur-based antialiasing in 8-bit Y.

c is clip.

m is optional mask clip to calculate edges. May be the same as c.

r is a blur radius from 1.0.

mode is a Repair filter mode code. Try 4. Reference codes.

str is an edge mix strength, in the range 0.0...1.0. Try 0.5 as a good start value.

returns a clip.

Fast antialiasing filter, good for low quality U and V channel compression aliasing artifacts.

Sharp

function Sharpen(clip c, float amount)

AviSynth internal

3x3 kernel sharpening.

c is clip.

amount is a sharp level in range -1.58 to +1.0. Try 0.25 as a good start point.

returns clip.

This function works in 8-bit only and not recommended, because can produce a color posterization.

function BicubicSharp(clip c, float "r", float "edges", float "g", float "wg", float "bl", float "str", int "mode", int "bitdepth")

Halo-free radis-depended high-quality sharp.

c is clip.

r is a radius, from 0.001. Try 1.0 as a good start value.

edges is a edges/flat ratio in range 0.0...1.0. Try 0.5 as a good start value.

g is an image gamma. Try 2.2 as a good start value.

wg is a white halo removal gamma. Try 5.0 as a good start value.

bl is a black level offset. Try 0.0 as default value.

str is a filter strength, in the range 0.0...100.0. Try 1.0 as a good start value.

mode is a quality processing mode for 8-bit clips: 0 - draft calculation with rounding. 1 - precise Sierra 2-4A dithering.

bitdepth is a clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns a clip.

This is a very quality sharp filter.

function BicubicSharp8(clip c, float "r", float "edges", float "g", float "wg", float "bl", float "str", int "mode", int "bitdepth")

Halo-free radis-depended low-quality sharp.

c is clip.

r is a radius, from 0.001. Try 1.0 as a good start value.

edges is a edges/flat ratio in range 0.0...1.0. Try 0.5 as a good start value.

g is an image gamma. Try 2.2 as a good start value.

wg is a white halo removal gamma. Try 5.0 as a good start value.

bl is a black level offset. Try 0.0 as default value.

str is a filter strength, in the range 0.0...100.0. Try 1.0 as a good start value.

mode is a quality processing mode for 8-bit clips: 0 - draft calculation with rounding. 1 - precise Sierra 2-4A dithering.

bitdepth is a clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns a clip.

This version is faster, but uses 8-bit blur mask, so can produce posterization.

function BoxSharp(clip c, float "r", float "edges", float "g", float "wg", float "bl", float "str", int "mode", int "bitdepth")

Halo-free radis-depended high-quality sharp for bold values.

c is clip.

r is a radius, from 0.001. Try 1.0 as a good start value.

edges is a edges/flat ratio in range 0.0...1.0. Try 0.5 as a good start value.

g is an image gamma. Try 2.2 as a good start value.

wg is a white halo removal gamma. Try 5.0 as a good start value.

bl is a black level offset. Try 0.0 as default value.

str is a filter strength, in the range 0.0...100.0. Try 1.0 as a good start value.

mode is a quality processing mode for 8-bit clips: 0 - draft calculation with rounding. 1 - precise Sierra 2-4A dithering.

bitdepth is a clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns a clip.

This is a very quality sharp filter.

function GrainSharp(clip c, float "r", float "edges", float "g", float "wg", float "bl", float "str", int "mode", int "bitdepth")

Halo-free radis-depended high-quality sharp for grain areas.

c is clip.

r is a radius, from 0.001. Try 1.0 as a good start value.

edges is a edges/flat ratio in range 0.0...1.0. Try 0.5 as a good start value.

g is an image gamma. Try 2.2 as a good start value.

wg is a white halo removal gamma. Try 5.0 as a good start value.

bl is a black level offset. Try 0.0 as default value.

str is a filter strength, in the range 0.0...100.0. Try 1.0 as a good start value.

mode is a quality processing mode for 8-bit clips: 0 - draft calculation with rounding. 1 - precise Sierra 2-4A dithering.

bitdepth is a clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns a clip.

This is a very quality sharp filter.

function GrainSharp8(clip c, float "r", float "edges", float "g", float "wg", float "bl", float "str", int "mode", int "bitdepth")

Halo-free radis-depended low-quality sharp.

c is clip.

r is a radius, from 0.001. Try 1.0 as a good start value.

edges is a edges/flat ratio in range 0.0...1.0. Try 0.5 as a good start value.

g is an image gamma. Try 2.2 as a good start value.

wg is a white halo removal gamma. Try 5.0 as a good start value.

bl is a black level offset. Try 0.0 as default value.

str is a filter strength, in the range 0.0...100.0. Try 1.0 as a good start value.

mode is a quality processing mode for 8-bit clips: 0 - draft calculation with rounding. 1 - precise Sierra 2-4A dithering.

bitdepth is a clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns a clip.

This version is faster, but uses 8-bit blur mask, so can produce posterization.

Denoise

function MotionDenoise420(clip c, clip "m", int "bs", int "overlap", int "frames", int "th", int "limit", int "badth", int "smotion", int "pel", int "dct", int "smode", int "ssteps", int "show", bool "mt", int "bitdepth")

Motion denoise and bitdepth increase in 4:2:0.

c is a 8-bit 4:2:0 clip.

m is a prepared 8-bit clip to calculate motion vectors. You can do pre-denoise, levels, sharp or something similar. You can specify the same as c, if not used.

bs is a search block size. Use only these: 4, 8, 16, 32. Bigger values are faster and in most cases better for H.264.

overlap is a block overlap value. Try bs/2. Bigger values have better quality, but slower.

frames is a count of frames to mix together after motion compensation. Try 1..6. Bigger values have better quality, but may produce dynamic noise artifacts. Use bigger values for static scenes.

th is a threshold value to getting blurring. Try 250 for start. Bigger values can destroy image details, so search a bigger value without a blurring. Try 900+ for heavy blurring.

limit is a color value difference to limit fast motion object blurring. Try 10. Bigger values can blur fast motion objects. 255 is no limit.

badth is a bad motion vector threshold value. Useful to get better motion blurring look. Try 500. 5000 is to disable.

smotion is a static background mode: 0/1. Use 1 to remove the H.264 compression artifact "dancing block". Use 0 if you have static areas after high denoise.

pel is the accuracy of the motion estimation. 1:whole pixel, 2:1/2, 4:1/4-very slow. Try 2 for most sources.

dct is a DCT frequency spectrum code algorithm. In particular it can improve motion vector estimation at luma flicker and fades. 0:none, 1:dct, 2:mixed, 3:adapt1, 4:adapt2, 5:satd, 6:mixed_s, 7:adapt1_s, 8:adapt1_s, 9:mixed_s2, 10:adapt_strong. Reference of MAnalyse. Try 9 as a good default method.

smode is a motion block search mode. 0:onestep, 1:n-step, 2:diamond, 3:slow, 4:hex, 5:umh. Modes 3 and 5 are high quality but slow. Try 4 as a good quality for most videos.

ssteps is a motion block search distance. For every smode this distance has special meaning. Try 2 for a default fast value. Bigger values potentially can give better sharping. But it is not good for a processing speed.

show is 0/1. It enables a debug show of motion vectors. Useful to search better values or to prevent wrong vector blurring.

mt is a multithreading mode switcher. Try true for default. There is no real reason to set it false, but is some rare cases single threading mode can improve a speed.

bitdepth is a return clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns a denoised clip.

This function works with 4:2:0 8-bit sources only. It is a VA Basic edition denoiser. Can produce noise artifacts. Can produce artifacts on video borders. First and last video frames may look noised. You can trim them using MotionDenoiseCompensateTrim.

function MotionDenoiseY(clip c, clip "m", int "bs", int "overlap", int "frames", int "th", int "limit", int "badth", int "smotion", int "pel", int "dct", int "smode", int "ssteps", int "show", bool "mt", int "bitdepth")

Motion denoise and bitdepth increase in Y.

c is a 8-bit Y clip.

m is a prepared 8-bit clip to calculate motion vectors. You can do pre-denoise, levels, sharp or something similar. You can specify the same as c, if not used.

bs is a search block size. Use only these: 4, 8, 16, 32. Bigger values are faster and in most cases better for H.264.

overlap is a block overlap value. Try bs/2. Bigger values have better quality, but slower.

frames is a count of frames to mix together after motion compensation. Try 1..6. Bigger values have better quality, but may produce dynamic noise artifacts. Use bigger values for static scenes.

th is a threshold value to getting blurring. Try 250 for start. Bigger values can destroy image details, so search a bigger value without a blurring. Try 900+ for heavy blurring.

limit is a color value difference to limit fast motion object blurring. Try 10. Bigger values can blur fast motion objects. 255 is no limit.

badth is a bad motion vector threshold value. Useful to get better motion blurring look. Try 500. 5000 is to disable.

smotion is a static background mode: 0/1. Use 1 to remove the H.264 compression artifact "dancing block". Use 0 if you have static areas after high denoise.

pel is the accuracy of the motion estimation. 1:whole pixel, 2:1/2, 4:1/4-very slow. Try 2 for most sources.

dct is a DCT frequency spectrum code algorithm. In particular it can improve motion vector estimation at luma flicker and fades. 0:none, 1:dct, 2:mixed, 3:adapt1, 4:adapt2, 5:satd, 6:mixed_s, 7:adapt1_s, 8:adapt1_s, 9:mixed_s2, 10:adapt_strong. Reference of MAnalyse. Try 9 as a good default method.

smode is a motion block search mode. 0:onestep, 1:n-step, 2:diamond, 3:slow, 4:hex, 5:umh. Modes 3 and 5 are high quality but slow. Try 4 as a good quality for most videos.

ssteps is a motion block search distance. For every smode this distance has special meaning. Try 2 for a default fast value. Bigger values potentially can give better sharping. But it is not good for a processing speed.

show is 0/1. It enables a debug show of motion vectors. Useful to search better values or to prevent wrong vector blurring.

mt is a multithreading mode switcher. Try true for default. There is no real reason to set it false, but is some rare cases single threading mode can improve a speed.

bitdepth is a return clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns a denoised clip.

This function works in Y-channel 8-bit sources only. Can be used to process Y, U, V separately. Can produce noise artifacts. Can produce artifacts on video borders. First and last video frames may look noised. You can trim them using MotionDenoiseCompensateTrim.

function MotionDftDenoiseY(clip c, clip "m", string "s", int "bs", int "overlap", int "frames", int "th", int "badth", int "smotion", int "pel", int "dct", int "smode", int "ssteps", int "show", bool "mt", int "threads", int "dither", int "bitdepth")

Motion denoise and bitdepth increase in Y using Dft denoise.

c is a 8-bit Y clip.

m is a prepared 8-bit clip to calculate motion vectors. You can do pre-denoise, levels, sharp or something similar. You can specify the same as c, if not used.

s is a strength string that provides a noise reduction curve from low to high frequencies. Try "0.0:9 0.5:9 1.0:9" as default. This example contains 3 curve points in 0.0, 0.5 and 1.0 where strength is 9.0. You can use more points if required.

bs is a search block size. Use only these: 4, 8, 16, 32. Bigger values are faster and in most cases better for H.264.

overlap is a block overlap value. Try bs/2. Bigger values have better quality, but slower.

frames is a count of frames to mix together after motion compensation. Try 1..6. Bigger values have better quality, but may produce dynamic noise artifacts. Use bigger values for static scenes.

th is a threshold value to getting blurring. Try 250 for start. Bigger values can destroy image details, so search a bigger value without a blurring. Try 900+ for heavy blurring.

badth is a bad motion vector threshold value. Useful to get better motion blurring look. Try 500. 5000 is to disable.

smotion is a static background mode: 0/1. Use 1 to remove the H.264 compression artifact "dancing block". Use 0 if you have static areas after high denoise.

pel is the accuracy of the motion estimation. 1:whole pixel, 2:1/2, 4:1/4-very slow. Try 2 for most sources.

dct is a DCT frequency spectrum code algorithm. In particular it can improve motion vector estimation at luma flicker and fades. 0:none, 1:dct, 2:mixed, 3:adapt1, 4:adapt2, 5:satd, 6:mixed_s, 7:adapt1_s, 8:adapt1_s, 9:mixed_s2, 10:adapt_strong. Reference of MAnalyse. Try 9 as a good default method.

smode is a motion block search mode. 0:onestep, 1:n-step, 2:diamond, 3:slow, 4:hex, 5:umh. Modes 3 and 5 are high quality but slow. Try 4 as a good quality for most videos.

ssteps is a motion block search distance. For every smode this distance has special meaning. Try 2 for a default fast value. Bigger values potentially can give better sharping. But it is not good for a processing speed.

show is 0/1. It enables a debug show of motion vectors. Useful to search better values or to prevent wrong vector blurring.

mt is a multithreading mode switcher. Try true for default. There is no real reason to set it false, but is some rare cases single threading mode can improve a speed.

threads is a thread count or 0 for autodetect.

dither is a dither enable mode: 0 or 1 if used for 8-bit.

bitdepth is a return clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns a denoised clip.

This function works in Y-channel 8-bit sources only. Can be used to process Y, U, V separately. First and last video frames may look noised. You can trim them using MotionDenoiseCompensateTrim.

function DftDenoiseY(clip c, string "s", int "frames", int "threads", int "dither", int "from", int "bitdepth")

Dft 3D denoise and bitdepth increase filter in Y.

c is a 8/16/32-bit Y clip.

s is a strength string that provides a noise reduction curve from low to high frequencies. Try "0.0:9 0.5:9 1.0:9" as default. This example contains 3 curve points in 0.0, 0.5 and 1.0 where strength is 9.0. You can use more points if required.

frames is a count of frames to mix together: 1, 3 or 5. Bigger values have better quality, but slow.

threads is a thread count or 0 for autodetect.

dither is a dither enable mode: 0 or 1 if used for 8-bit.

from is a source clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

bitdepth is a return clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns a denoised clip.

This function works in Y-channel only. Can be used to process Y, U, V separately. First and last video frames may look noised. You can trim them using MotionDenoiseCompensateTrim. Useful for careful high-bitdepth denoise.

function MotionHqdn3dDenoiseY(clip c, clip "m", float "sp", float "tp", int "bs", int "overlap", int "frames", int "th", int "badth", int "smotion", int "pel", int "dct", int "smode", int "ssteps", int "show", bool "mt", int "bitdepth")

Motion denoise and bitdepth increase in Y using Hqdn3DY denoiser.

c is a 8-bit Y clip.

m is a prepared 8-bit clip to calculate motion vectors. You can do pre-denoise, levels, sharp or something similar. You can specify the same as c, if not used.

sp is a spatial denoise level in range 0.0..1000. Try 2.0 as a start value.

tp is a temporal denoise level in range 0.0..1000. Try 2.0 as a start value.

bs is a search block size. Use only these: 4, 8, 16, 32. Bigger values are faster and in most cases better for H.264.

overlap is a block overlap value. Try bs/2. Bigger values have better quality, but slower.

frames is a count of frames to mix together after motion compensation. Try 1..6. Bigger values have better quality, but may produce dynamic noise artifacts. Use bigger values for static scenes.

th is a threshold value to getting blurring. Try 250 for start. Bigger values can destroy image details, so search a bigger value without a blurring. Try 900+ for heavy blurring.

badth is a bad motion vector threshold value. Useful to get better motion blurring look. Try 500. 5000 is to disable.

smotion is a static background mode: 0/1. Use 1 to remove the H.264 compression artifact "dancing block". Use 0 if you have static areas after high denoise.

pel is the accuracy of the motion estimation. 1:whole pixel, 2:1/2, 4:1/4-very slow. Try 2 for most sources.

dct is a DCT frequency spectrum code algorithm. In particular it can improve motion vector estimation at luma flicker and fades. 0:none, 1:dct, 2:mixed, 3:adapt1, 4:adapt2, 5:satd, 6:mixed_s, 7:adapt1_s, 8:adapt1_s, 9:mixed_s2, 10:adapt_strong. Reference of MAnalyse. Try 9 as a good default method.

smode is a motion block search mode. 0:onestep, 1:n-step, 2:diamond, 3:slow, 4:hex, 5:umh. Modes 3 and 5 are high quality but slow. Try 4 as a good quality for most videos.

ssteps is a motion block search distance. For every smode this distance has special meaning. Try 2 for a default fast value. Bigger values potentially can give better sharping. But it is not good for a processing speed.

show is 0/1. It enables a debug show of motion vectors. Useful to search better values or to prevent wrong vector blurring.

mt is a multithreading mode switcher. Try true for default. There is no real reason to set it false, but is some rare cases single threading mode can improve a speed.

bitdepth is a return clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns a denoised clip.

This function works in Y-channel 8-bit sources only. Can be used to process Y, U, V separately. First and last video frames may look noised. You can trim them using MotionDenoiseCompensateTrim.

function Hqdn3dY(clip c, float sp, float tp)

Hqdn3dY

8-bit Y-channel 3D denoiser.

c is clip.

sp is a spatial denoise level in range 0.0..1000. Try 2.0 as a start value.

tp is a temporal denoise level in range 0.0..1000. Try 2.0 as a start value.

returns clip.

Very fast filter. This function works in 8-bit only and not recommended, because can produce a color posterization.

function Hqdn3dYHDR(clip c, float "sp", float "tp", int "bitdepth")

16-bit Y-channel 3D denoiser.

c is clip.

sp is a spatial denoise level in range 0.0..1000. Try 2.0 as a start value.

tp is a temporal denoise level in range 0.0..1000. Try 2.0 as a start value.

bitdepth is a clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns clip.

Very fast filter.

Noise and Film Grain

function NoiseY(clip c, float "amp", int "seed", int "mode", int "bitdepth")

HDRNoise

Y-channel noise generator.

c is clip.

amp is a noise amplitude in a 8-bit range scale. Try 1.0 for ±1.0 variation.

seed is a random generator seed. Useful to mix different noise generators. Try any integer value.

mode is a quality processing mode for 8-bit clips: 0 - draft calculation with rounding. 1 - precise Sierra 2-4A dithering.

bitdepth is a clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns clip.

Basic Y-channel random noise generator.

function NoiseUV(clip c, float "ampu", float "ampv", int "seed", int "mode", int "bitdepth")

HDRNoise

UV-channel noise generator.

c is clip.

ampu is a U-channel noise amplitude in a 8-bit range scale. Try 1.0 for ±1.0 variation.

ampv is a V-channel noise amplitude in a 8-bit range scale. Try 1.0 for ±1.0 variation.

seed is a random generator seed. Useful to mix different noise generators. Try any integer value.

mode is a quality processing mode for 8-bit clips: 0 - draft calculation with rounding. 1 - precise Sierra 2-4A dithering.

bitdepth is a clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns clip.

Basic UV-channel random noise generator.

function FilmGrain1(clip c, float "amp", float "r", float "sh", float "ldiff", int "seed", int "bitdepth")

Y-channel film grain generator.

c is clip.

amp is a noise amplitude in a 8-bit range scale. Try 1.0 for ±1.0 variation.

r is a grain radius from 1.0. Try 1.5.

sh is a grain sharpening from range 0..1.0. Try 0.9.

ldiff is a black/white difference to emulate 16mm film look. Try 1.5.

seed is a random generator seed. Useful to mix different noise generators. Try any integer value.

bitdepth is a clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns clip.

Basic Y-channel film grain generator.

function FilmGrain2(clip c, float "amp1", float "amp2", float "r1", float "r2", float "sh1", float "sh2", float "ldiff", int "seed", int "bitdepth")

2 grain sizes Y-channel film grain generator.

c is clip.

amp1 and amp2 are a noise amplitude in a 8-bit range scale. Try 1.0 for ±1.0 variation.

r1 and r2 are a grain radius from 1.0. Try 1.5.

sh1 and sh2 are a grain sharpening from range 0..1.0. Try 0.9.

ldiff is a black/white difference to emulate 16mm film look. Try 1.5.

seed is a random generator seed. Useful to mix different noise generators. Try any integer value.

bitdepth is a clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns clip.

Extended Y-channel film grain generator.

Blending and Masks

function Blend8(clip c, clip co, float "str")

Blend two frames in 8 bit.

c is processed clip.

co is original clip.

str is blending strength in range 0.0...1.0.

returns a clip.

Can produce posterization, but it is fast.

function PassEdge8(clip c, clip co, clip m, int "mul", int "expand")

Pass edge areas in 8 bit.

c is processed clip.

co is original clip.

m is a mask clip to calculate edges.

mul is an edge value multiplication count. Useful to get different edge strength.

expand is an edge expand count: 0, 1 or 2 to make bolder edges.

returns a clip.

Can produce posterization. But usually very low visible, because mask.

function PassFlat8(clip c, clip co, clip m, int "mul", int "expand")

Pass flat areas in 8 bit.

c is processed clip.

co is original clip.

m is a mask clip to calculate edges.

mul is an edge value multiplication count. Useful to get different edge strength.

expand is an edge expand count: 0, 1 or 2 to make bolder edges.

returns a clip.

Can produce posterization. But usually very low visible, because mask.

function PassBlack8(clip c, clip co, clip m, int "th")

Pass black areas in 8 bit.

c is processed clip.

co is original clip.

m is a mask clip to calculate areas.

th is a mask value threshold in 8-bit scale. Try 128.

returns a clip.

Can produce posterization.

function PassWhite8(clip c, clip co, clip m, int "th")

Pass white areas in 8 bit.

c is processed clip.

co is original clip.

m is a mask clip to calculate areas.

th is a mask value threshold in 8-bit scale. Try 128.

returns a clip.

Can produce posterization.

Final Viewers

function ViewOutRGB(clip c, string "view", int "matrix", string "chroma", int "bitdepth")

RGB viewer last function.

c is clip.

view is a view mode: "" - normal; "y","u","v" - for YUV output; "lsb" - lsb data for 16/32-bit clips.

matrix is a color space matrix code: 601 or 709.

chroma is a chroma placement mode: "MPEG1", "MPEG2" or "DV".

bitdepth is a clip bitdepth code: 8, 16, 32 or 88 for stacked 16-bit.

returns RGB clip that is compatible with PlayRGB source.

This is a service function to use in editor scripts.

function ViewOutStereo(clip c)

Audio viewer last function. It converts multichannel audio to stereo.

c is clip.

returns clip.

This is a service function to use in editor scripts.

Difference Viewer

function DiffAB(clip a, clip b, float "x", float "d")

Show a difference between two clips.

a is a clip.

b is b clip.

x is a x-coordinate to show difference from. Try 0.4.

d is a part of screen width to show. Try 0.2.

returns a clip.

Clips should have the same dimensions.

Deshaker

function Deshaker8Pass1(clip c, string "desfile", int "rolling_shutter")

The first pass of Deshaker. Works in YUV.

c is clip.

desfile is a *.deshaker file to create.

rolling_shutter is a rolling shutter coefficient from 0 to 100. Try 88.

returns a clip.

This step creates desfile. Compatible with AviSynth MT. Partially compatible with AviSynth Plus MT, but very slow.

function Deshaker8Pass2(clip c, string "desfile", int "enabled", int "rolling_shutter", int "w", int "h", int "hpan", int "vpan", int "rot", int "zoom", int "adapt_zoom", int "adapt_zoom_amount", int "hpan_perc", int "vpan_perc", int "rot_deg", int "zoom_perc", int "fill_with_frames", int "soft_border", int "mode", float "extra_zoom")

The second pass of Deshaker. Works in YUV.

c is clip.

desfile is a *.deshaker file created in the first step.

enabled is on/off switcher. Use 0 or 1.

rolling_shutter is a rolling shutter coefficient from 0 to 100. Try 88.

v and h are result dimensions.

hpan and hpan are panning time coefficients in milliseconds. Try 1000.

rot and zoom are rotation and zoom time coefficients in milliseconds. Try 1000.

adapt_zoom_amount is zoom adaptation coefficient in percent. Try 100. If you use one of the adaptive zoom edge compensation options, this setting adjusts the amount (or amplitude) of this zooming. For example, if you set it to 50%, Deshaker will only add half the adaptive zoom as normal, for each frame. Note that this may obviously cause borders to become visible even when using Adaptive zoom full.

hpan_perc and vpan_perc are panning coefficients in percents. Try 15.

rot_deg is a maximal rotation degree. Try 5.

zoom_perc is a zoom percent. Try 15.

fill_with_frames is a frame fill mode switcher. Try 0 or 1.

soft_border is a soft border mode. Try 0/1. If enabled, all relevant previous and future frames that Deshaker has stored in memory will be used to calculate the border.

mode is a zoom mode. 1-zoom average (some borders), 2-zoom full, 3-fixed zoom, 4-average+fixed.

extra_zoom is additional zoom to prevent border artifacts. Try 1.003.

returns a clip.

This step makes all job. Compatible with AviSynth MT. Partially compatible with AviSynth Plus MT, but very slow.

Audio Processing

function AudioSilent(clip c)

Replace audio with a silence.

c is clip.

returns clip.

This function removes unwanted audio signal.

function Convert51ToStereo(clip c, float "center", float "rear", float "lfe")

Convert a multichannel audio to stereo.

c is clip.

center is a center channel volume. Try 0.5.

rear is a rear channels volume. Try 0.3.

lfe is a lfe channel volume. Try 0.3.

returns clip.

Mix audio channels to get clean sound.

function ConvertAudioTo16bit(clip c)

AviSynth internal

Convert audio to 16-bit integer.

c is clip.

returns clip.

Integer audio transformation.

function ConvertAudioTo24bit(clip c)

AviSynth internal

Convert audio to 24-bit integer.

c is clip.

returns clip.

Integer audio transformation.

function DelayAudio(clip c, float seconds)

AviSynth internal

Delay the audio track.

c is clip.

seconds is a delay time in seconds. You can use negative values. To delay by a frame use a trick value like 1/25 - where 25 is a fps value.

returns clip.

This function corrects wrong audio placement.

function Normalize(clip c, float "value")

AviSynth internal

Audio normalization.

c is clip.

value is a maximal peak audio amplitude. Optional parameter. Try 0.0 for 0db, 0.7079 for -3db.

returns clip.

This function raises or lowers the loudest peak of the audio track to a given volume.

function AmplifyDB(clip c, float decibels)

function AmplifyDB(clip c, float left, float right, ...)

AviSynth internal

Audio loudness and balance.

c is clip.

decibels is a loudness correction in decibels. Try 0.0 for no changes.

left, right are channels loudness correction in decibels. Try 0.0 for no changes.

returns clip.

This function makes audio loudness correction.

Fps

function ChangeFPS(clip c, float fps, bool "linear")

function ChangeFPS(clip c, int numerator, int "denominator", bool "linear")

AviSynth internal

Change FPS by deleting or duplicating frames.

c is clip.

fps is a new fps value. Try 25.0.

numerator and denominator is an alternative way to specify a new fps value. Try 24000/1001.

linear if true (the default), this will make AviSynth request frames in a linear fashion when skipping frames.

returns clip.

Recommended way is: ChangeFps(FrameRate()/2, linear=false).

function AssumeFPS(clip c, float fps, bool "sync_audio")

function AssumeFPS(clip c, int numerator, int "denominator", bool "sync_audio")

AviSynth internal

Play video faster or slower.

c is clip.

fps is a new fps value. Try 25.0.

numerator and denominator is an alternative way to specify a new fps value. Try 24000/1001.

sync_audio If true, the audio sample rate is changed by the same amount; the pitch of the resulting audio is shifted. If false (the default), the audio is unchanged; this means the audio will lose synchronization over time.

returns clip.

Recommended way is: AssumeFPS(FrameRate()/2, sync_audio=true).

function ConvertFPS(clip c, float fps)

function ConvertFPS(clip c, int numerator, int "denominator")

AviSynth internal

Change FPS by blending frames.

c is clip.

fps is a new fps value. Try 25.0.

numerator and denominator is an alternative way to specify a new fps value. Try 24000/1001.

returns clip.

Recommended way is: ConvertFps(FrameRate()*2).

function BlendTwoFrames8(clip c)

Blend two adjacent frames in 8 bit, the result fps will be decreased by 2 times.

c is clip.

returns a clip.

Can produce posterization, but it is fast.

function MotionBlurMV8(clip c, int "num", int "den", int "soften", int "mult", int "bs", int "pel")

Change FPS with a motion blur.

c is clip.

num and den is a new fps value. Try 24000/1001. If not specified the current fps is used. It is useful to add a motion blur.

soften is a temporal soften frames count to add more motion blur. Try 0..

mult is a fps multiplication for temporal soften. More multiplication causes less temporal blur.

bs is a search block size. Use only these: 8, 16, 32. Bigger values are faster and in most cases better for H.264. Recommended value is 16.

pel is the accuracy of the motion estimation. 1:whole pixel, 2:1/2, 4:1/4-very slow. Try 2 for most sources.

returns clip.

This filter works in 4:2:0 and 4:2:2 only. It can produce very visible motion artifacts. Use MotionBlurGPU8 for less artifacts.

function MotionBlurGPU8(clip c, int "num", int "den", int "soften", int "mult", int "bs", int "pel", int "threads", int "algo")

Change FPS with a motion blur. Fast GPU-accelerated version with very small artifacts.

c is clip.

num and den is a new fps value. Try 24000/1001. If not specified the current fps is used. It is useful to add a motion blur.

soften is a temporal soften frames count to add more motion blur. Try 0..

mult is a fps multiplication for temporal soften. More multiplication causes less temporal blur.

bs is a search block size. Use only these: 8, 16, 32. Bigger values are faster and in most cases better for H.264. Recommended value is 16.

pel is the accuracy of the motion estimation. 1:whole pixel, 2:1/2, 4:1/4-very slow. Try 2 for most sources.

threads is a thread count. Recommended value is 4.

algo is motion algorithm. Try 13 for motion blurring or 23 for pixel move.

returns clip.

This filter requires manual SWPflow plugin installations. This filter works in 4:2:0 only.

function FlowChangeFps8(clip c, int "bs", int "overlap", int "num", int "den", int "smooth", int "softnum", int "temporal", int "badth", int "smotion", int "pel", int "dct", int "smode", int "ssteps", bool "mt")

Change FPS by blending frames using motion calculation. Very slow. Do not use, it is depricated and may be removed from future VA versions.

c is clip.

bs is a search block size. Use only these: 4, 8, 16, 32. Bigger values are faster and in most cases better for H.264.

overlap is a block overlap value. Try bs/2. Bigger values have better quality, but slower.

num and den is a new fps value. Try 24000/1001.

smooth is average mix steps in range 1..4. Try 4.

softnum is a temporal soften fps multiplication. Try 1...

temporal is a temporal soften frames count if softnum>1. Try 4.

badth is a bad motion vector threshold value. Useful to get better motion blurring look. Try 500. 5000 is to disable.

smotion is a static background mode: 0/1. Use 1 if video has H.264 compression artifact "dancing block". Use 0 if you have static areas.

pel is the accuracy of the motion estimation. 1:whole pixel, 2:1/2, 4:1/4-very slow. Try 2 for most sources.

dct is a DCT frequency spectrum code algorithm. In particular it can improve motion vector estimation at luma flicker and fades. 0:none, 1:dct, 2:mixed, 3:adapt1, 4:adapt2, 5:satd, 6:mixed_s, 7:adapt1_s, 8:adapt1_s, 9:mixed_s2, 10:adapt_strong. Reference of MAnalyse. Try 9 as a good default method.

smode is a motion block search mode. 0:onestep, 1:n-step, 2:diamond, 3:slow, 4:hex, 5:umh. Modes 3 and 5 are high quality but slow. Try 4 as a good quality for most videos.

ssteps is a motion block search distance. For every smode this distance has special meaning. Try 2 for a default fast value. Bigger values potentially can give better sharping. But it is not good for a processing speed.

mt is a multithreading mode switcher. Try true for default. There is no real reason to set it false, but is some rare cases single threading mode can improve a speed.

returns clip.

Very qiality but slow. Can produce motion artifacts. This filter works in 4:2:0 and 4:2:2 only.