Log in

View Full Version : 4 pass encoding


DarkT
31st January 2007, 20:02
I don't know if it belongs here, so please move it if it doesn't

Guys, tell me if this makes sense:

1)TFM+TDecimate for the IVTC, Safe filters - VirtualDub+huffyuv.

2)Unsafe filters - now instead of 46k frames I have ~34k frames, and I can go frame by frame easier and apply the "unsafe" filters (SSIQ where DiFrost failed me, Tcomb[mode1/2] where neccesairy - because sometimes it completly and utterly trashes the frames, and MFToon - again, VirtualDub, loseless.

3)Megui 2 passes x.264 - no filtering at all, pure bit assasination/compression.

Does this make any sense to you guys? Why I am trying to work this way is because I have Full Metal Panic? Fumoffu! as a source(a very VERY bad anime source - R1 atleast) - and I simply MUST clean it up...

Anyway, lemme know.

Thanks.

chipzoller
31st January 2007, 23:24
Well, assuming you construct your avs script properly, you should be able to combine the first two steps safely applying the "unsafe" filters after your IVTC. There really should be no need to do two lossless encodes just for filtering (that I can see).

DarkT
1st February 2007, 00:06
How can I combine those two steps? My problem is that after the Tdecimate, the frames on which the filters should apply are no longer correct... Hence I split it into two steps... Otherwise I'd do it all in a one big happy .avs :). The frames the "unsafe" filters apply to are for some reason the frames pre-decimation, not post decimation, and the ones I'd have would be post decimation, since I'm recording frame numbers from the 2nd step - while working on the already decimated piece...

chipzoller
1st February 2007, 00:15
I'm a bit confused here...
Have you not made a script just with your IVTC method and run it through Vdub to record frames (this would be post decimation) on which you'd like to apply a certain filter chain?
Can you post the script you had in mind?

DarkT
1st February 2007, 00:35
1st script does IVTC and applies safe filters:

LoadPlugin("C:\Program Files\AviSynth 2.5\EXTRA\DGDecode.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\EXTRA\ColorMatrix.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\EXTRA\UnDot.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\EXTRA\Deen.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\EXTRA\BiFrost.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\EXTRA\fft3dfilter.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\EXTRA\LimitedSharpen\MaskTools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\EXTRA\Tivtc.dll")
MPEG2Source("C:\NEW\NEWindex.d2v")
ColorMatrix(interlaced=true)
crop( 8, 0, -8, -0)
TFM(order=1,mode=2,PP=7,slow=2,ovr="C:\NEW\ovr.txt")
Tdecimate(mode=1)
undot()
fft3dfilter()
BiFrost()
deblock()
Tweak(cont=1, sat=1.3,bright=-12, hue=-1)

So after this, with virtual dub, I have a file which is already Decimated, right? THEN on THAT file I write the 2nd script, with the unsafe filters... That one goes something like this - bare in mind it's not finished, I still need to add smartsharpen and complete de-rainbowing and mftooning:

2nd script:

Import("C:\Program Files\AviSynth 2.5\EXTRA\mfToon\mfToon-v0.44.avs")
Import("C:\Program Files\AviSynth 2.5\EXTRA\DFMDeRainbow\DFMDeRainbow.avs")
Import("C:\Program Files\AviSynth 2.5\EXTRA\LUTDeRainbow-20050902.avs")
LoadPlugin("C:\Program Files\AviSynth 2.5\EXTRA\mfToon\aWarpSharp.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\EXTRA\mfToon\MaskTools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\EXTRA\mfToon\WarpSharp.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\EXTRA\LimitedSharpen\MaskTools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\EXTRA\DFMDeRainbow\FluxSmooth.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\EXTRA\DFMDeRainbow\MSharpen.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\EXTRA\Tcomb.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\EXTRA\SSIQ.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\EXTRA\Tisophote.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\EXTRA\ColorMatrix.dll")

function FunctionTcombUni(clip a, int start, int end)
{return (a.trim(0,start)+a.trim(start+1,end).Tcomb(mode=2,fthreshl=12, othreshl=19)+a.trim(end+1,0))}

function FunctionTcombL(clip a, int start, int end)
{return (a.trim(0,start)+a.trim(start+1,end).Tcomb(mode=0,fthreshL=5,othreshL=5)+a.trim(end+1,0))}

function FunctionMFToon(clip a, int start, int end)
{return (a.trim(0,start)+a.trim(start+1,end).mftoon(strength=25)+a.trim(end+1,0))}

function FunctionDFMDeRainbow(clip a, int start, int end)
{return (a.trim(0,start)+a.trim(start+1,end).DFMDeRainbow()+a.trim(end+1,0))}

function FunctionLUTDeRainbow(clip a, int start, int end)
{return (a.trim(0,start)+a.trim(start+1,end).LUTDeRainbow()+a.trim(end+1,0))}

function FunctionSSIQL1(clip a, int start, int end)
{return (a.trim(0,start)+a.trim(start+1,end).SSIQ(diameter=11,strength=100,interlaced=false)+a.trim(end+1,0))}

function FunctionTiso(clip a, int start, int end)
{return (a.trim(0,start)+a.trim(start+1,end).Tisophote()+a.trim(end+1,0))}

avisource("d:\1.avi")
ColorMatrix(interlaced=true)

#FunctionLUTDeRainbow(,)

#FunctionTcombUni(106,218)
#FunctionTcombUni(491,540)
#FunctionTcombUni(563,755)
#FunctionTcombUni(1023,1095)
#FunctionTcombUni(1212,1253)
#FunctionTcombUni(1346,1504)
#FunctionTcombUni(1761,1771)
#FunctionTcombUni(2093,2115)
#FunctionTcombUni(2544,2593)
#FunctionTcombUni(2939,3030)
#FunctionTcombUni(3138,3317)
#FunctionTcombUni(3417,3505)
#FunctionTcombUni(3635,3756)
#FunctionTcombUni(3814,3853)
#FunctionTcombUni(3976,4088)
#FunctionTcombUni(4187,4288)
#FunctionTcombUni(4347,4812)
#FunctionTcombUni(4920,5086)
#FunctionTcombL(5269,5403)
#FunctionTcombUni(5533,5627)
#FunctionTcombUni(6208,6606)
#FunctionTcombUni(6702,6836)
#FunctionTcombUni(7087,7363)
#FunctionTcombUni(7620,7703)
#FunctionTcombUni(8248,8345)
#FunctionTcombUni(8527,9138)
#FunctionTcombUni(9431,9911)
#FunctionTcombUni(9989,11183)
#FunctionTcombUni(11259,11344)
#FunctionTcombUni(11832,12206)
#FunctionTcombUni(12542,12892)
#FunctionTcombUni(13000,13408)
#FunctionTcombUni(13424,13471)
#FunctionTcombUni(13512,13621)
#FunctionTcombUni(13640,13794)
#FunctionTcombUni(13863,14256)
#FunctionTcombUni(14401,14561)
#FunctionTcombUni(14760,14824)
#FunctionTcombUni(14932,15323)
#FunctionTcombUni(15496,15619)
#FunctionTcombUni(15695,15756)
#FunctionTcombUni(15853,16017)
#FunctionTcombUni(16162,16257)
#FunctionTcombUni(16721,16802)
#FunctionTcombUni(16838,17020)
#FunctionTcombUni(1750114582,)
#FunctionTcombUni(17647,17716)
#FunctionTcombUni(17801,18640)
#FunctionTcombUni(18699,19202)
#FunctionTcombUni(19438,20115)
#FunctionTcombUni(20210,20571)
#FunctionTcombUni(21200,21467)
#FunctionTcombUni(21888,22130)
#FunctionTcombUni(22981,23076)
#FunctionTcombUni(23391,23598)
#FunctionTcombUni(24579,24828)
#FunctionTcombUni(24997,25111)
#FunctionTcombUni(25510,25646)
#FunctionTcombUni(25703,25851)
#FunctionTcombUni(23521,26650)
#FunctionTcombUni(27441,27552)
#FunctionTcombUni(27659,27844)
#FunctionTcombUni(28128,28163)
#FunctionTcombUni(28421,28471)
#FunctionTcombUni(30130,30315)
#FunctionTcombUni(30495,30990)
#FunctionTcombUni(31178,31346)
#FunctionTcombUni(31624,31751)
#FunctionTcombUni(31814,33226)
#FunctionTcombUni(33282,33334)
#FunctionTcombUni(33419,33434)
#FunctionTcombUni(33478,33558)
#FunctionTcombUni(33587,33614)
#FunctionTcombUni(33850,33947)


So as you can see, the 2nd script uses the frame numbers which are after decimation... IF I try and apply it in the first script, then it does NOT apply to the decimated frames, but for some reason to the original frames, example:

I have frames 1 to 10, and I do decimation, and am left with 8 frames.

I then apply in the 2nd script a filter to frames 5,6,7 - if however I would try that in the 1st script, it would not apply to the 5,6,7 decimated frames, but 5,6,7 ORIGINAL frames...

Am I making any sense? Should I just shoot myself? I don't know, I just don't know...

check
1st February 2007, 00:43
It makes sense. Have you heard of YATTA? It's a tool that you may find useful. http://ivtc.org/

Mug Funky
1st February 2007, 01:01
the only problem with fumoffu is the composite transfer (which was used for all regions).

that means you can get away with dedot and an IVTC (and a few spot fixes where dedot mungs back-and-forth motion in 3:2).

DarkT
1st February 2007, 01:23
Noooooes, please, no Yatta, I would like to keep my yatta-virginity for as much as possile ;) - for reasons unknown even to myself! I think it's my inner sanity - with a voice now only as a whisper - "nooo, don't do it! don't dl yatta!" :).

StanleyD
1st February 2007, 20:38
Everything youve said went straight over my head. Dont mean to threadcrap but I do think its the wrong place for this topic. I hope you are able to get what yopu want though. Maybe I can learn something by listening to these more complicated threads.

DarkT
1st February 2007, 20:46
Here's the thing, it might not be too noobish in itself, but I - personally, am an utter noob to this... So like, I've been going through SOME parts more then others, but overall, *I* am a noob... So for example I wouldn't get any complicated explanation...

Besides, it is utterly noobish - I only started liek 2 months ago and been at it for like 5-10 hours a week... So I consider myself a noob, in about 3 more month time I'll be able to call myself a "novice" of sorts...

And don't think I wrote the functions themselves on my own, this really nice dude from darkhold - Mentar, helped me out with it(he write it and I replaced the variables) - though I did go frame by frame with the script, but that's just manual labour ;).