Functions regarding interlace treatment by scharfis_brain | Dec. 20th, 2005
===========================================================================

Misc.:
------

function reYV12(clip i)

	- reverts YUY2 decoded PAL-DV to its native DV-YV12
	- will enhance quality and processing speed
	- todo: add a function reYUY2(), to reacreate YUY2 after conversion, 
	  because U and V aren't in place with MPEG2-YV12!


reinterlace(clip i, bool "enableyv12output")

	- returns a progressive clip into an interlaced one. Output framerate will be halved.
	- by default it converts YV12 to YUY2, because most of the encoders will NOT treat
	  interlaced YV12 the correct way.
	- if you should need interlaced YV12 though, you may set enableyv12output=true .
	  This obviously only works if the input is YV12 already.


mvconv(clip i, int "num", int "den", int "blk")
	- motion compensated framerate conversion. Simply stolen from mvtools documentation
	- if neither "num" nor "den" are given, and the input framerate is
	  50.0 fps or lies between 59.9 and 60.1 fps mvconv() will assume the user wishes
	  to do a standards conversion.
	  input 50.0 fps will be converted to 59.94 fps
	  input 59.9 to 60.1 fps will be converted to 50.0 fps.
	- int "blk" specifies the blocksize. Everything different from 8 will be assumed as 4.


Wrapped deinterlacing functions:
--------------------------------

all these wrapped deinterlacing functions have those behaviours in common:
	- taking care of the fieldorder of the input
	- assuming framebased and the fieldorder of the input for the output
	- being compatible with YUY2 and YV12
	- doing a dumb (non-thresholded) bob


dumbbob(clip i, int "height")

	- a wrapped bob(0,1,height) (lossless for the current field)
	- height specifies a new image height


tomsbob(clip i, int "se")

	- wrapped tomsmocomp(-1, se, 0)
	- fast ELA-bob, se=0 by default


krnlbob(clip i, int "th")

	- fast kernel bob, th=0 by default


eedibob(clip i)

	- slow, but accurate EEDI-bob, always dumb ;)


Advanced deinterlacing functions:
---------------------------------
They have the same in common like the wrapped functions, except the dumb-bob thing.


securedeint(clip i, int "th", int "l", int "type")

	- deinterlacer that avoids residual combing with tricky motion at all cost 
	  using a quite long temporal motion mask.
	- int "l" specifies that lenght:
		0 -> 17 (16+1) fields motion mask -> for the tough cases
		1 -> 9  ( 8+1) fields motion mask -> default
		2 -> 5  ( 4+1) fields motion mask
		any other value -> 3 fields motion mask -> don't use!
	- int "th" specifies the deinterlacing threshold similar to the one of kerneldeint:
		0 -> dumb bob
		6 -> default
	- int "type" sets the interpolation to use in motion areas (similar to TDeint):
		0 -> bicubic
		1 -> simple ELA (tomsmocomp's ELA)
		2 -> kernel
		3 -> advanced EDI (Triticals EEDI2)
	- securedeint bases on the previously described wrapped deinterlacing functions




MVbob(clip c,int "blksize", int "pel", int "th", int "ths", int "bobth", bool "quick")

	- it is a motion compensated deinterlacer. Its image quality is superiour to all
	  other deinterlacers in most cases. It calms down moving image detail (no flicker), 
	  reduces noise (by accident :) ) and of course squeezes out every bit of image 
	  detail without introducing new kinds of artifacts.

	- int "blksize" and "pel" are directly taken from mvtools. Defaults 8 and 2
	- int "bobth" is the deinterlacing threshold of the internal motion adaptive
	  deinterlacer. In this case securedeint(th=bobth) is used. Default 6
	- int "th" threshold for correcting false compensated areas. The higher the threshold
	  the more combing you'll get. Default 8
	- int "ths" threshold to calm bobbing areas which weren't captured by the internal
	  deinterlacer. Default 3. Don't raise it too much, it will result in combing quickly.
	  (Static-O-Matic)
	- bool "quick" enabling this will use ELA instead of EEDI2 interpolation. 
	  It also turns off the Static-O-Matic 

needed plugins:
---------------
LoadPlugin("RemoveGrain_v10pre1.dll") # by kassandro      ( http://home.arcor.de/kassandro/ )

loadplugin("masktools.dll")           # by manao          ( http://manao4.free.fr/ )

loadplugin("mvtools.dll")             # by manao & fizick ( http://avisynth.org.ru/fizick.html )

loadplugin("leakkerneldeint.dll")     # by neuron2        ( http://neuron2.net/ ) 
                                         & leak           ( http://gast3.ssw.uni-linz.ac.at/~kp/AviSynth/ )

loadplugin("eedi2.dll")               # by tritical       ( http://bengal.missouri.edu/~kes25c/ )

loadplugin("tomsmocomp.dll")          # by TR Barry       ( http://home.comcast.net/~trbarry/downloads.htm )
loadplugin("undot.dll")               # by TR Barry 


These plugins are released under the terms of the GPL.
A complete package with sources can be found at: http://home.arcor.de/scharfis_brain/mvbob/mvbob-sources.rar