Log in

View Full Version : Any IVTC filters which utilize frame duplication?


LB
24th October 2004, 11:33
I've been looking around for a filter which relies on detecting jagged horizontal lines and if it finds a good bit of them on edges, then returns the frame as interlaced. If the frame is interlaced, it then looks at the fields BEFORE and the fields AFTER for a non-interlaced frame. If none are found, then it simply copies either the non-interlaced frame BEFORE or non-interlaced frame AFTER. Finally, if a non-interlaced frame before/after do not exist, then it simply uses the interlaced frame.

Kind of the TMPG route. Anything like that out there?

Basically something that can be applied to this HERE (http://www.perrywigsbooks.com/FixMe.avi) (avi - right click, save as).

scharfis_brain
24th October 2004, 11:37
for what purpose should such a filter be good for?

IVTCing is usually being set up by matching fields before decimation.

LB
24th October 2004, 11:48
Originally posted by scharfis_brain
for what purpose should such a filter be good for?

IVTCing is usually being set up by matching fields before decimation.

Hmm... how do I explain this. Within 5 fields, sometimes there aren't any non-interlaced frames. The IVTC programs I have used simply return the interlaced frame if it cannot find a non-interlaced one w/in 5 fields.

I don't want that. I want an IVTC program which if it cannot find a non-interlaced frame, duplicates the frame BEFORE or AFTER if the before/after is non-interlaced.

Example:

Field 01-05&nbsp&nbsp&nbsp&nbspField 05-10&nbsp&nbsp&nbspField 11-15
&nbspA B C D E&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspF G H I J&nbsp&nbsp&nbsp&nbsp&nbsp&nbspK L M N O

Of those 15 fields, only C and M are non-interlaced.
Normal IVTC programs (that I have used) would return say C,G,M. But G is interlaced. So I would like to find a program that in this situation, returned C,C,M or C,M,M. Do you follow me?

And maybe my usage of the term IVTC is off. But I have always considered IVTC to mean going from 30fps->24fps. So IVTC field matches + decimates.

scharfis_brain
24th October 2004, 12:09
for sure, it should be possible with a conglomerate of scriptclip's and frameevaluate's after the decimation.

maybe, conditionalfilter & iscombed is sufficient for that job:


xxxsource("video.xxx")
yourdecimationhere()
video=last
delayed=video.duplicateframe(0)
analysis=video
conditionalfilter(analysis, video, delayed, "iscombed(10)", "==", "true")

maybe you have to swap video & delayed within conditionalfilter. I do not know it exactly, cause it came straight out of my mind without testing.

Mug Funky
24th October 2004, 14:05
that is one MESSED UP clip there... like it's been dumb-bobbed, decimated, then telecined.

i'll play with this and see what can be got out of it.

[edit]

is it possible to find a better source for this? it looks like a digitally made anime, so there's no reason for there to be that weird bobbing effect there.

does the video go on like this all the way through? that's terrible.

LB
25th October 2004, 02:40
Originally posted by Mug Funky
that is one MESSED UP clip there... like it's been dumb-bobbed, decimated, then telecined.

i'll play with this and see what can be got out of it.

[edit]

is it possible to find a better source for this? it looks like a digitally made anime, so there's no reason for there to be that weird bobbing effect there.

does the video go on like this all the way through? that's terrible.

That's straight from the R2 DVD. The entire DVD isn't like this, but I always run into like 100 frames now and then that are like this. I can fix it in TMPG by doing the method I described above (manually copy a before/after frame if no valid non-interlaced frame is found within so many fields, but it sure would be nice to have an avs filter which could do this.

I uploaded two new files:
VOB: HERE (http://www.perrywigsbooks.com/Sample_1.vob).
FIXED (as fixed as it's gonna get) in TMPG: HERE (http://www.perrywigsbooks.com/Sample_1_FIXED.IN.TMPG.avi).

So any ideas on IVTC filters which will duplicate previous frames if no non-interlaced field is found?

scharfis_brain
25th October 2004, 05:00
So any ideas on IVTC filters which will duplicate previous frames if no non-interlaced field is found?

Did you read, what I wrote?

(I haven't seen the sample jet, lacking time.....)

ObiKenobi
25th October 2004, 09:07
I was able to fix all but a few frames creating a manual override to telecide, but that probably isn't what you want as it would be just as tedious as using your TMPenc method. Though it did result in a somewhat less jerky looking clip.

LB
25th October 2004, 13:54
Originally posted by scharfis_brain
So any ideas on IVTC filters which will duplicate previous frames if no non-interlaced field is found?

Did you read, what I wrote?

(I haven't seen the sample jet, lacking time.....)

Yeah. Thanks for the tip. I was thinking of something along those lines, but IsCombed() isn't sensitive enough for me. For 99% of anime it works great, but it's these crazy scenes that it has trouble on. If you were to try an IsCombed on the vob I posted, you'd see that the entire clip would return a "true" at a reasonable comb setting. :( So I need to find something that works better.

I keep wondering though why there isn't something which uses masktools. Like, the problem areas I encounter generally only have combing on the "edges". So if someone built a detector which used masktools to locate the edges, then determine if there were "horizontal lines" (i.e., jaggies) in the edges, it would EASILY detect this problem, and I presume solve a lot of other people's problems regarding comb detection too. Thinking more about this, most edges in anime are straight obviously, so detecting short + horizontal / jagged edges would really pick this up. Any ideas?

Mug Funky
25th October 2004, 18:06
convolution puts the combs in sharp relief. you could probably use some kind of averageluma or something to make this useful, but here's the comb-detector i use for masking purposes:

yv12convolution(horizontal="1",vertical="1 -2 1",Y=3,U=0,V=0,usemmx=true)

it makes non-comb black and comb-like white. of course, it picks up on sharp vertical detail as well, but there didn't seem to be much of that in your clip :)

LB
25th October 2004, 18:42
Originally posted by Mug Funky
convolution puts the combs in sharp relief. you could probably use some kind of averageluma or something to make this useful, but here's the comb-detector i use for masking purposes:

yv12convolution(horizontal="1",vertical="1 -2 1",Y=3,U=0,V=0,usemmx=true)

it makes non-comb black and comb-like white. of course, it picks up on sharp vertical detail as well, but there didn't seem to be much of that in your clip :)

Thanks! I'll try it out when I get home!!

Aktan
26th October 2004, 10:19
The clip you posted seems to have the colors off. You should add ColorMatrix() to your script.

LB
26th October 2004, 15:15
Originally posted by Aktan

The clip you posted seems to have the colors off. You should add ColorMatrix() to your script.


What do you mean?

Aktan
26th October 2004, 18:04
If you open the vob with vdubmod directly and compare it to your clip, you can see the colors are very off. The reason why it is off is explained well in the readme that comes with ColorMatrix(). I htink there is also some information here:

http://forum.doom9.org/showthread.php?s=&threadid=82217

as well as where to get the plugin.

I have seen ColorMatrix() mess up deinterlacing, so I recommend it be the last filter you use in your avs script.


On a side note, I was kind of like @#$^%&! when I found out that prob 99% of the backups I made had the color off...

LB
27th October 2004, 19:10
@Mug Funky

It doesn't work :(

Works well on true interlaced parts, but IT() or Telecide() can detect those easily. What I need to detect is interlacing, but it's only visible on the edges. Here are two shots. The top shot is what IVTC programs "think" is a non-interlaced frame, but if you look at the edges you see all the jaggies. The bottom shot is the field directly adjacent to it, and if you look at the edges you can see that it is the "true" non-interlaced frame. (and sorry for the size; but they need to be this quality to see what I'm talking about).

INTERLACED
http://www.perrywigsbooks.com/1.png

NON-INTERLACED
http://www.perrywigsbooks.com/2.png