Log in

View Full Version : fast deinterlacing revisited


vampiredom
4th September 2008, 18:36
Greetings fellow AviSynth fans. Although I just recently joined the Doom9 forums, I have been a long-time reader of these threads. I am simply in awe of some of the tools and scripts that have come out of them. In particular, Scharfi and Didee have made great strides toward the "perfect" deinterlacer.

The quality of MVBob, MCBob, TempGaussMC, etc. is excellent -- but very slow. Since I am an impatient person by nature, I often prefer something that gives faster results. Through some experimentation, I found that TomsMoComp + Yadifmod gives quite good and fast results in many cases:

yadifmod(mode=1, edeint=Interleave(TomsMoComp(-1, 0, 0), DoubleWeave().SelectOdd().TomsMoComp(-1, 0, 0)))

It is certainly not "perfect" by any means, but is really very fast -- and is well suited for bobbing HD prior to SD conversion.

I hope others find this useful also!

Gavino
4th September 2008, 20:41
yadifmod(mode=1, edeint=Interleave(v.TomsMoComp(-1, 0, 0), v.DoubleWeave().SelectOdd().TomsMoComp(-1, 0, 0)))
You haven't defined what 'v' is.
Can we assume it is the same as 'last' (and therefore "'v." can be omitted)?

vampiredom
4th September 2008, 20:58
Oops! I extracted it from another script (in which "v" was defined... sorry. I fixed my earlier post.

Something else: I have heard of issues with TomsMoComp on certain older machines (Pentium 4?) when the dimensions are not mod16. This can be an issue when processing HDV 1080i, for example. Here's a "safe" version that pads, bobs, and crops -- maintaining the original dimensions but processing at the nearest mod16-compliant size:

mpeg2source("hdv1080i.d2v", cpu=4)

# padding or mod16 width and height
w16 = ceil(float(width()) / 16.0) * 16
h16 = ceil(float(height()) / 16.0) * 16
bL = (w16 - width()) / 2
bR = (bL % 2 != 0) ? bL - 1 : bL
bL = (bL % 2 != 0) ? bL + 1 : bL
bT = (h16 - height()) / 2
bB = (bT % 2 != 0) ? bT - 1 : bT
bT = (bT % 2 != 0) ? bT + 1 : bT

(bL > 0 || bR > 0 || bT > 0 || bB > 0) ? AddBorders(bL, bT, bR, bB) : last

yadifmod(mode=1, edeint=Interleave(TomsMoComp(-1, 0, 0), DoubleWeave().SelectOdd().TomsMoComp(-1, 0, 0)))

(bL > 0 || bR > 0 || bT > 0 || bB > 0) ? Crop(bL, bT, bR * -1, bB * -1) : last