Log in

View Full Version : Double-blend IVTC Removal


Pages : 1 2 [3]

foxyshadis
16th February 2006, 21:44
It's not really designed for 3+2 blend pattern, anymore, I use it on crazily edited blended shows with no pattern at all with fair success (course, nothing's perfect, but it's close). And that's with mpeg artifacts and all. With a VCR's artifacts a preliminary reconstruction would be a better method, I've seen a few ideas here on fixing it.

You should probably use "separatefields().selecteven().FixBlendIVTC()" and selectodd, then reweave. Since you can't run two copies in parallel, you'd have to put each in its own avs, then a third avs with "Interleave(avisource("even.avs"),avisource("odd.avs"))". At least, that sounds like the cleanest solution with the current script.

Momonster, in testing I found a few tweaks that helped a tiny bit, or not at all, but this one made a noticeable difference by reducing the effect of compression noise:


global rev_diff = mt_lutxy(f_diff.trim(1,0), f_plus, yexpr="x y - 2 ^ x 0.3 ^ /", uexpr="x", vexpr="x")
\ .mt_inpand().DeGrainMedian(limitY=20,limitUV=0,mode=0)
global single = mt_lut(f_diff, yexpr="x 128 - abs 4 < 0 x 128 - 2 ^ ?", uexpr="x", vexpr="x")
\ .mt_inpand().DeGrainMedian(limitY=20,limitUV=0,mode=0)

MOmonster
17th February 2006, 02:13
@jmac698
Could you please upload a small sample? It would be nice for me to have a look on it.
The idea for version 0.9 is allready in my head, but of course all ideas, problems and samples are welcome.;)

@foxyshadis
Yes something similar is also planned for v 0.9, but only optional, because it kills fine movements and give worse results for good sources. But for anime, yes really good. I tried it and it seems to work just a little bit better. maybe a better alternative to the clip2 option. WeŽll see. The next version should work better with low motion scenes, but IŽll need some time, because other things.

foxyshadis
17th February 2006, 02:29
You're right, of course. All of my samples are anime, except two I made up myself, but I have no idea if those are representative of "clean" sources at all. Thanks for the clarification. You're the brains behind the operation after all, I'm just a tweaker. :p

Edit: Howabout replacing single-blend with an "anime" bool? Then you can have difference optimized defaults for film vs. cartoons.

jmac698
19th February 2006, 23:25
Hello,
as requested,
http://rapidshare.de/files/13662957/sample.avi.html (25 frames, xvid, 450kb)

I wasn't able to get good results with your script yet. Bit of a newbie as scripting.
I did use something which works well, but I would still like to try the deblend idea.

AVISource("C:\sample.avi")
TDeint(Mode=1,order=1)#or LeakKernelBob(Order=1)
RePAL(quality=3)

Anyhow, if you get a chance to try my sample I would be very interested in the script you used. I hope this can help you tweak your future release. Thanks.

jmac698
20th February 2006, 01:13
success!
MOmonster:
even.avs:
Import("C:\Program Files\AviSynth 2.5\plugins\FixBlendIVTC.avs")
AVISource("c:\sample.avi")
separatefields().selecteven().FixBlendIVTC(sbd=false)
#separatefields().selecteven()

odd.avs:
Import("C:\Program Files\AviSynth 2.5\plugins\FixBlendIVTC.avs")
AVISource("c:\sample.avi")
separatefields().selectodd().FixBlendIVTC()

deblend.avs:
interleave(avisource("even.avs"),avisource("odd.avs"))
assumefieldbased()
AssumeTFF()
weave()

looking at even.avs by itself, without FixBlend (uncomment line),
I see 10,11,16,17,22,23 fields are blended (of 0-25). Ie, field 10 is blended with field 9 (of only even fields).
With your function, only 22,23 are blended. I'm guessing you need some frames ahead to perform your function? Or there is some lag, or something.
So, it seems to remove all blends quite well, and they are close to 50%.
But when I put them together, there is combing.
Which frame do you output when it is blended? And it seems some frames are decimated? I think it would be easier for me to have duplicates, that may be why I can't weave it back together.
Thanks for your help, this is very close...

MOmonster
22nd February 2006, 12:10
@jmac698
FixBlendIVTC is not the right function for you, what you need is restore24 or Cdeblend.
Your source is a pal->ntsc norm conversion. There are all clear fields you need for a good restoring I think. We just have to pick up the clear fields. Cdeblend works fine for me with this settigns:
leakkernelbob(order=1,sharp=false,twoway=true,threshold=4)

a = last.bilinearresize(480,352)

Cdeblend(dmode=1, omode=3, dthresh=70, perc=2, thresh=111, clip2=a)
Of course you can use tdeint for better bobbing results. After this you have to decimate the source back to 25fps with smartdecimate() or changefps() + decimate() (with other decimators you can sometimes get strange results).
I didnŽt test restore24, but it should also work for your source.

The blendweights are near to 50% every pattern end. But this idea can only used for this one of five fields and I donŽt think that this will higher the quality. But IŽll test it this weekend.

Edit: A longer sample would be nice, yes.

jmac698
22nd February 2006, 17:14
Mo,
New sample http://rapidshare.de/files/13872642/sample1.avi.html 1mb xvid
from your own postings, I got these ideas:

tdeint(mode=1) #bobbing to double rate
Cdeblend() #tweak higher thresh and include clip2 is useful
smartdecimate() #or changefps() decimate()

leakkernelbob(order=1,sharp=false,twoway=true,threshold=4)
a = last.bilinearresize(480,352) #or tdeint
#cdeblend replaces blended frames
Cdeblend(dmode=1, omode=3, dthresh=70, perc=2, thresh=111, clip2=a)
smartdecimate() #or changefps() decimate()

#order TFF,guess bottom field (unused), bob, kernel deint, tryweave means use clean frames
TDeint(order=1,field=1,mode=1,type=2,tryweave=true)
RePal(quality=3) #discard blended frames
AssumeFPS(25,1,true) #change playback speed to 25/1, audio rate to match
SSRC(48000) #resample back to sane samplerate

I don't know why you had field=1? I don't quite understand the cdeblend/smart or repal operations.

If I wanted to go all the way to do a full 24p restore, is there a function smart enough to find that 1 repeated frame in 25 despite editing? Or will I sometimes lose a random frame to keep up the sync?
It seems to be that editing in pal-format could ruin the 24p...

How do you use restore24()?

MOmonster
21st December 2006, 09:04
I took up time for FixBlendIVTC v0.9, but yesterday I decided to finish my work. I included it to the R_pack, so you can download it here (http://forum.doom9.org/showthread.php?t=95924).
changes:
- faster and saver detection
- completely rewritten code
- new, faster postprocessing modes