Bob Deinterlacing
There are many different ways to deinterlace video. Done correctly, bobbing will arguably result in better quality than any other method. In its most basic form, bobbing simply involves making each field in an interlaced video frame into a separate picture (frame) and then doubling its vertical size to give it the same resolution as the original.
This can introduce some problems with your video. The most obvious is the framerate, which will be double the original. Depending on what you're playing your video back with this may or may not be a problem. If you need to maintain the original framerate (such as for DVD applications) you can use either SelectEven or SelectOdd.
Bob
Bob (clip Clip, float "b", float "c", int "Height")
Argument | Type | Default | Req | Description |
Clip | Clip | last | Clip to bob | |
"b" | Floating Point Decimal | 1/3 | b (blurring) value for bicubic algorithm | |
"c" | Floating Point Decimal | 1/3 | c (ringing) value for bicubic algorithm | |
"Height" | Integer | Same as interlaced source | See the Bicubic Resize filter |
Bob is the simplest implementation of a bobbing deinterlacer in AviSynth. It's referred to as a dumb bobber because it doesn't take any information from surrounding fields/frames into account to create the missing lines. Instead a BicubicResize is performed on each new frame (separated field), which is why some options mirror those from that filter.
Bob doesn't have an argument to specify field order, which means it will use whatever order AviSynth guesses for your clip. It's best to explicitly set the field order of each clip using AssumeTFF for clips where the top field comes before the bottom or AssumeBFF if the bottom field should be displayed before the top.
b
See the BicubicResize filter
c
See the BicubicResize filter.
Height
See the Bicubic Resize filter
Example Code
Bob an interlaced video clip:Mpeg2Source("VideoFile.d2v")
Bob()
When To Use It
Due to the availability of plugins which add smart bobbing capabilities to AviSynth, there's rarely any good reason to use the built in Bob filter. It's included here primarily to provide a baseline for the other filters on the page.Download Plugin |
Yadif
Yadif (clip Clip, int "Mode", int "Order")
Argument | Type | Default | Req | Description |
Clip | Clip | last | Clip to bob | |
"Mode" | Integer | 0 | Deinterlacing method | |
"Order" | Integer | -1 | Field order of source video |
Yadif is a sort of general purpose deinterlacer which happens to include two different bobbing modes. It is popular, thanks in part to being relatively fast while still producing high quality results. It's particularly good at recognizing and deinterlacing static (non-moving) areas.
Mode
Although you technically may omit the Mode argument, it's required in order to use Yadif as a bobber. The following values perform a bob, rather than some other form of deinterlacing.
- 1 = Consider same frame and adjacent frames
- 3 = Only consider opposite field from same frame
Order
It's recommended that you always explicitly set the field order for an interlaced video clip using AssumeTFF if the top field should display first or AssumeBFF if the bottom field is first. If you do that there's no reason to use the Order argument here. If you need to set the order within Yadif here are the options:
- -1 = Use parity from AviSynth
- 0 = Bottom Field First (BFF)
- 1 = Top Field First (TFF)
Example Code
Deinterlace to get a clip with double the original framerate, using both spatial (same frame) and temporal (adjacent frame) information:Mpeg2Source("Clip.d2v")
Yadif(Mode=1)
Deinterlace to get a clip with the same framerate as the original, using only spatial (same frame) information:
Mpeg2Source("Clip.d2v")
Yadif(Mode="3")
SelectOdd()
When To Use It
Yadif is a good choice when you need a balance of speed and quality. It's particularly good if your video includes static (non-moving) areas.
Download Plugin |
SBdeint
SBdeint (clip Clip, int "Mode", int "FieldFirst")
Argument | Type | Default | Req | Description |
Clip | Clip | last | Clip to bob | |
"Mode" | Integer | 0 | Search area | |
"FieldFirst" | Integer | -1 | Field Order of source video |
SBDeint is a bobber which is optimized for motion. It tends to create artifacts in static (non-moving) areas - especially when there are horizontal lines.
Mode
When there is less fine detail or horizontal lines in a video frame, a larger search area will generally produce better results. If there is a lot of fine detail, a smaller area (Mode 1) is generally preferable.
- 0 = Full Search
- 1 = Restricted Search
FieldFirst
It's recommended that you always explicitly set the field order for an interlaced video clip using AssumeTFF if the top field should display first or AssumeBFF if the bottom field is first. If you do that there's no reason to use the Order argument here. If you need to set the order within Yadif here are the options:
- -1 = Use parity from AviSynth
- 0 = Top Field First (TFF)
- 1 = Bottom Field First (BFF)
Example Code
Deinterlace a clip with very little fine detail or horizontal lines to get output with double the original framerate:Mpeg2Source("Clip.d2v")
SBDeint(Mode=0)
Deinterlace a clip with a lot of fine detail to get output with the same framerate as the original:
Mpeg2Source("Clip.d2v")
SBDeint(Mode="1")
SelectOdd()
When To Use It
SBDeint is best suited for video with a lot of motion and very few still areas. It's very fast, but may give you artifacts in static (non-moving) areas, particularly if there are horizontal lines.
Written by: Rich Fiscus