Log in

View Full Version : Deinterlacing Problems


dansrfe
26th September 2009, 07:57
Source: DVD9 owned by me named "Namastey London" (Bollywood)

Problem: The source is fieldblended and some ghosting is present as well. It is a bad PAL -> NTSC conversion. I have used the folowing deinterlace methods however they both result with "horizontal wavy, "melting" lines" and jerky playback hence frame drops even though the resultant output is 25 fps. Also the frame itself is wobbly throughout my sample encodes including the deinterlcing parts.

{...
yadif(mode=1,order=1)
srestore()
...}

{...
yadif(mode=1,order=1)
repal()
...}

Sample Encodes tested with both deinterlacing methods above^:

Sample Encode 1: no filters
Sample Encode 2: crop, resize
Sample Encode 3: crop, resize, deinterlace
Sample Encode 4: crop, resize, deinterlace, vinverse, mdegrain, lsf
Sample Encode 5: crop, resize, vinverse, mdegrain, lsf
Sample Encode 6: deinterlace

Sample Encodes 1,2,and 6 resulted in no deinterlacing artifacts obviously because I used no deinterlacer in them. Therefore my tests prove that there is something wrong with the deinterlacer method that I have used or some incorrect or missing parameters.

My Script:

{
DGDecode_mpeg2source("F:\Namastey London DVD9\VTS_01_1.d2v", cpu=2, info=3)
ColorMatrix(hints=true, interlaced=true, threads=0)
crop(2,62,0,-62)
Spline36Resize(864,368)
Load_Stdcall_Plugin("C:\Program Files\AviSynth 2.5\plugins\yadif.dll")
yadif(mode=1,order=1)
srestore()
Vinverse()
super = MSuper(pel=2, sharp=1)
backward_vec2 = super.MAnalyse(isb = true, delta = 2, overlap=4, blksize=16,chroma=true)
backward_vec1 = super.MAnalyse(isb = true, delta = 1, overlap=4, blksize=16,chroma=true)
forward_vec1 = super.MAnalyse(isb = false, delta = 1, overlap=4, blksize=16,chroma=true)
forward_vec2 = super.MAnalyse(isb = false, delta = 2, overlap=4, blksize=16,chroma=true)
MDegrain2(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=280)
LimitedSharpenFaster(Smode=4, strength=100)
}

Sample VOB:

Here (http://www.sendspace.com/file/2zjf0m)

Waiting for some expert help on this. As a side note I just want to point out that I have yet to use restore24() on this. I have heard that though it is an excellent deinterlacer, it is very difficult to use for the average avisynth scripter. Therefore, if I will end up needing to use this then I will need some guidance in so. :thanks:

manono
26th September 2009, 09:25
Try again with the crop and resize lines moved after the unblending. You've messed up any chance of ever getting it unblended properly with that script.

Both RePAL and SRestore work fine on that source. There's some other screwy stuff in that script, in my opinion, but you didn't ask about anything else.

Gavino
26th September 2009, 09:27
You need to deinterlace before resizing.
Also, if you crop before deinterlacing, vertical cropping must be on mod4 boundaries.

Arshad07
26th September 2009, 13:04
Just so you know guys, this script isnt complete. He removed some of the functions in it, before posting it here. And i'm pretty sure thats what is causing the flickering and stuff.

Arshad07
26th September 2009, 14:01
Script

DGDecode_mpeg2source("C:\Users\Arsha\Desktop\Sample_2.d2v", cpu=4, info=3)
ColorMatrix(hints=true, interlaced=true, threads=0)
Load_Stdcall_Plugin("C:\Program Files (x86)\megui\tools\yadif\yadif.dll")
Yadif(mode=1, order=1)
SRestore(frate=25)
crop( 2, 58, 0, -58)
Spline64Resize(640,272)

Result (http://www.sendspace.com/file/b8qkqm)

dansrfe
26th September 2009, 16:27
Try again with the crop and resize lines moved after the unblending. You've messed up any chance of ever getting it unblended properly with that script.

Both RePAL and SRestore work fine on that source. There's some other screwy stuff in that script, in my opinion, but you didn't ask about anything else.

You need to deinterlace before resizing.
Also, if you crop before deinterlacing, vertical cropping must be on mod4 boundaries.

Thanks so much for your help guys. I completely forgot about the position of the resizing function in relation to the unblending :eek:. It works fine now. Plus if you can post any other suggestions as to the placement or anything better I can do with this updated script, please comment. :) (I added some variable cropping removal stuff to it) Updated Script:

{

DGDecode_mpeg2source("F:\Namastey London DVD9\VTS_01_1.d2v", cpu=2, info=3)
ColorMatrix(hints=true, interlaced=true, threads=0)
Load_Stdcall_Plugin("C:\Program Files\AviSynth 2.5\plugins\yadif.dll")
yadif(mode=1,order=1)
srestore()
a=Trim(0, 1875).crop(2,62,-14,-64).Spline64Resize(864,368)
b=Trim(1876,2881).crop(2,62,0,-62).Spline64Resize(864,368)
c=Trim(2882, 3239).crop(2,62,-4,-62).Spline64Resize(864,368)
d=Trim(3240,0).crop(2,62,0,-62).Spline64Resize(864,368)
a+b+c+d
Vinverse()
super = MSuper(pel=2, sharp=1)
backward_vec2 = super.MAnalyse(isb = true, delta = 2, overlap=4, blksize=16,chroma=true)
backward_vec1 = super.MAnalyse(isb = true, delta = 1, overlap=4, blksize=16,chroma=true)
forward_vec1 = super.MAnalyse(isb = false, delta = 1, overlap=4, blksize=16,chroma=true)
forward_vec2 = super.MAnalyse(isb = false, delta = 2, overlap=4, blksize=16,chroma=true)
MDegrain2(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=280)
LimitedSharpenFaster(smode=4, strength=100)

}

dansrfe
26th September 2009, 16:37
Also is there a general guide or advanced guide for that matter that tells what the general placement of the different class of functions within the script is considered the best or optimal?

manono
26th September 2009, 17:02
You don't need ColorMatrix. You don't need Vinverse as there shouldn't be any left over interlacing after SRestore. In my opinion you don't need to degrain it as that sample is already way too smooth and I didn't notice any grain at all. Sometimes less is more and one of the mistakes beginners make most often is to overfilter everything.

You should do something about the crushed blacks. And you should do something about that pinkish/bluish tint over everything.