Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
27th September 2002, 14:06 | #1 | Link |
Registered User
Join Date: Oct 2001
Location: Gainesville FL USA
Posts: 2,092
|
Useful function for checking TopFirst
When is a clip "TopFirst"?
Interlaced video clips have 2 different fields in each frame and you are never quite sure which one was intended to be displayed first and which second when displaying interlaced or when deinterlacing. But some of my filters (GreedyHMA, TomsMoComp) make you specify that when invoking them. So I just wrote a quickie Avisynth function that makes it easy to know if the clip is stored "TopFirst". The following function will do it fairly reliably: later edit: see updated version on page 2 of this thread. Code:
function CheckTopFirst(clip v1){ t0=v1.ComplementParity t1=t0.separatefields t2=compare(t1.trim(1,0),t1) b1=v1.separatefields b2=compare(b1.trim(1,0),b1) return stackvertical(t2,b2)} v=AVISource("C:\whatever\bikes.avi") CheckTopFirst(v) Then preview a few frames. It will use Compare to evaluate the two possibilities and vertically stack the results. This shows 2 useful pieces of info. First the preview of either the top or bottom half of the screen will probably be jerky, so choose the other one. But just as reliable is the "Avg Mean Abs Dev" value that is displayed for each. Choose either the top (TopFirst=1) or bottom (TopFirst=0) clip that has the LOWEST value for Avg Mean Abs Dev. Picture attached. In this example the Avg Mean Abs Dev is 6.143 for the top and 7.549 for the bottom, so the clip is TopFirst. - Tom Last edited by trbarry; 12th December 2002 at 14:48. |
Thread Tools | Search this Thread |
Display Modes | |
|
|