View Full Version : Optimize Script? How?
COREiP
14th November 2004, 07:56
I have this script to backup anime but its really slow. I can only achive .10 frames a sec. Is is there any way to optimize this script and make it faster?
loadplugin("loadpluginex.dll")
loadplugin("decomb521.dll")
loadplugin("dup.dll")
loadplugin("MPEG2Dec3.dll")
loadplugin("blockbuster.dll")
loadplugin("deen.dll")
loadplugin("MaskTools149.dll")
loadplugin("aWarpSharp.dll")
loadplugin("WarpSharp.dll")
loadplugin("fluxsmooth")
import("mfToon-v0.52.avs")
import("SharpTools-v0.3.avs")
avisource("test.avi")
#Mpeg2Source("test.d2v")
#Telecide(order=1,post=2,blend=false,vthresh=30,back=1)
#Decimate(cycle=5,mode=3,quality=3)
BlindPP(ipp=true,cpu=6)
deen("a2d",1,4,10,12)
fluxsmooth()
converttoyv12()
mfToon()
SSXSharpen()
colorYUV(gain_u=15)
tweak(sat=1.2)
Blockbuster(method="noise",block_size=3,detail_min=1,detail_max=100,luma_offset=0,luma_threshold=100,mean=0,variance=1)
dup(threshold=2,chroma=true,copy=true,maxcopies=20,blend=true)
#bilinearresize(576,432)
#crop(0,60,0,-60)
Manao
14th November 2004, 12:25
Easy : don't use mfToon or any filters beginning by mf :)
More seriously, if you want a faster script, use less filters, there nothing else you can do to speed things up.
M7S
14th November 2004, 13:58
Limitedshapen should be faster than SSXsharpen with similar results, I belive.
But your filterchain looks a little long to me too. Does it bring nice enough result to justify it?
Mug Funky
14th November 2004, 14:49
what's blockbuster in there for? if it's because the other filters made it too soft, you can simply remove them :) otherwise your encodes will just get needlessly bigger. you can add noise at playback if you like the look of it.
also, depending on your source, you could probably use something like ffdshow to do the deblocking (it's more accurate because it's quantizer aware, and can use Nic's deblock filters as well). that means you can get rid of blindpp for deblocking. also, the "ipp=true" option is only a good idea for interlaced stuff (in which case you're doing a lot of damage to the video by running deen, fluxsmooth and mftoon on an interlaced image :eek: )
basically, it is probably best to keep things down to 1 or maybe 2 denoisers, usually complimentary (like removegrain+removedirt combo). unless you want to have really low bitrates at the expense of detail.
ChronoCross
14th November 2004, 20:17
looking at that script I'd have to say that's a bit overkill. with all them filters it has to oversmooth the anime as well as super blurring everything. I'd suggest not using mftoon unless there is a problem with huge lines. Also you should Always crop your source before you begin filtering, that'll save time and besides the black lines do nothing.
Something like this would be faster
Crop(numbers here)
deen("a3d")
LimitedSharpen(ss_x=2.0,ss_y=2.0)
SharpResize(640,480)
Even that would give you better results, granted there will be more noise but alot more preserved detail. over smoothed anime sources tend to look pretty bad once encoding because Xvid's H.263 smooths as well. So if you have a little noise usually it will get reduced even more by xvid and should be hardly noticeable.
Depending on the anime though there really is a debate on whether to use mftoon to thin the lines. mftoon although good at what it does, has some side effects. Even the much faster FastlineDarken() isn't perfect but doesn't produce the artifacts/ darkening of mftoon.
I'm not suite sure why your using blockbuster and dup but you can add them anywhere you like.
COREiP
15th November 2004, 00:12
Yea thnx for the replies. I tried most of the filters and suggestions you guys made but the original script makes any anime stand out. By the way anyone tried it yet.
ObiKenobi
15th November 2004, 02:19
I tried your script and I get a weird blue tint as compared to the original, and for the slowness of the script I see no real benefits of it. I get just as good of results using just deen alone and is far faster.
COREiP
15th November 2004, 02:25
Disable
#colorYUV(gain_u=15)
#tweak(sat=1.2)
In order to not get the blue tint
loadplugin("loadpluginex.dll")
loadplugin("decomb521.dll")
loadplugin("dup.dll")
loadplugin("MPEG2Dec3.dll")
loadplugin("blockbuster.dll")
loadplugin("deen.dll")
loadplugin("MaskTools149.dll")
loadplugin("aWarpSharp.dll")
loadplugin("WarpSharp.dll")
loadplugin("fluxsmooth")
import("mfToon-v0.52.avs")
import("SharpTools-v0.3.avs")
Mpeg2Source("test.d2v")
Telecide(order=0,guide=1)
Decimate()
BlindPP(cpu=6)
deen("a3d",1,4,12,12)
fluxsmooth()
converttoyv12()
mfToon()
SSXSharpen()
colorYUV(gain_u=15)
tweak(sat=1.2)
Blockbuster(method="noise",block_size=3,detail_min=1,detail_max=100,luma_offset=0,luma_threshold=100,mean=0,variance=1)
dup(threshold=2,chroma=true,copy=true,maxcopies=20,blend=true)
LanczosResize(576,432)
ObiKenobi
15th November 2004, 02:27
Okay that fixed that, but I still don't see the benefit of all those extra filters when I can get just as good and faster results using deen and limitedsharpen.
COREiP
15th November 2004, 02:42
One more thing, are you sure you used all the filters in this script? The image looks bluried. You should get a much sharper image with more detail.
COREiP
15th November 2004, 02:51
Here is an example
Original
http://img38.exs.cx/img38/1848/493.png
Filtered
http://img38.exs.cx/img38/3938/492.png
ObiKenobi
15th November 2004, 03:01
Yeah, but I turned down the sharpening cause it was causing some pretty bad haloing like in that second picture you posted, which IMO looks far too oversmoothed and oversharpened.
ObiKenobi
15th November 2004, 03:37
On the Future Boy Conan theme here's some screenshots using this script from the Japanese DVDs (Episode 1, Time: 00:04.10)
deen("a2d",2,5,5)
deen("a3d",1,5,5)
LanczosResize(640,480)
asharp(1,2.5)
I use a script similar to this for most things, but it can be altered for sources with more noise and blocking. And I average around 6-8 fps when encoding with xvid, XP2000+ and 512 megs of ram, goes to as low as 3-4 if I have to do things like chroma smoothing.
http://img96.exs.cx/img96/9240/Unfiltered.png
http://img96.exs.cx/img96/7821/Filtered.png
ObiKenobi
15th November 2004, 04:15
Here's are shots from filtering a grainier source with a slight bit of blocks.
Script:
mpeg2source("thing.d2v",cpu=4)
Crop(8,0,-8,0)
UnDot()
DeGrainMedian()
deen("a2d",2,5,5)
deen("a3d",1,5,5)
LanczosResize(640,480)
asharp(1,1.5)
Which still yields around 5-6 fps.
Unfiltered:
http://img120.exs.cx/img120/4339/SaintSeiya-Unfiltered.png
Filtered:
http://img120.exs.cx/img120/5641/SaintSeiya-Filtered.png
COREiP
15th November 2004, 05:16
Nice!! I tried it and looks really good. I get about 10-14 fps on my Athlon XP2400+ 512MB DDR Using this script
loadplugin("loadpluginex.dll")
loadplugin("Decomb521.dll")
loadplugin("dup.dll")
loadplugin("MPEG2Dec3.dll")
loadplugin("deen.dll")
loadplugin("UnDot.dll")
loadplugin("aSharp.dll")
loadplugin("FluxSmooth")
Mpeg2Source("test.d2v")
#crop()
undot()
Telecide(order=0,guide=1)
Decimate()
BlindPP(cpu=4)
deen("a2d",2,5,5)
deen("a3d",1,5,5)
FluxSmooth()
asharp(1,2)
dup(threshold=2,chroma=true,copy=true,maxcopies=20,blend=true)
LanczosResize(576,432)
ObiKenobi
15th November 2004, 05:22
I'd recommend you to get DGDecode to replace mpeg2dec3, and DGIndex as well (both which can be gotten on http://neuron2.net). Secondly you don't need BlindPP to do the deblocking when using mpeg2source; you can just do mpeg2source("test.d2v",cpu=4) so you can save on using another filter.
ChronoCross
15th November 2004, 08:13
it would also probably be a good idea to put undot after Telecide(). *MOST* filters should go after the IVTC stuff.
COREiP
15th November 2004, 22:40
This are results from this script
loadplugin("loadpluginex.dll")
loadplugin("Decomb521.dll")
loadplugin("Dup.dll")
loadPlugin("DGDecode.dll")
loadplugin("Deen.dll")
loadplugin("UnDot.dll")
loadplugin("aSharp.dll")
loadplugin("FluxSmooth.dll")
AVISource("test.avi")
LanczosResize(512,384)
BlindPP(cpu=4)
convertTOYV12()
UnDot()
Deen("a2d",2,5,5)
Deen("a3d",1,5,5)
FluxSmooth()
aSharp(1,2)
ColorYUV(gain_u=15)
Tweak(sat=1.2)
Dup(threshold=2,chroma=true,copy=true,maxcopies=20,blend=true)
Source
http://img38.exs.cx/img38/1848/493.png
Filtered
http://img56.exs.cx/img56/7561/348.png
M7S
16th November 2004, 18:13
Did you try FastLineDarken (http://forum.doom9.org/showthread.php?s=&threadid=82125&highlight=fastlinedarken) which ChronoCross already mentioned? Or maybe you are happy with the results you got? :)
COREiP
16th November 2004, 19:22
I can't get it to work the script gives me an error.
M7S
16th November 2004, 21:25
Just to make sure... You did load masktools 1.5.1, right?
If that's not it I'm not the right person to help you.
COREiP
11th December 2004, 00:00
Im trying to back-up some lain dvd's but I get some greenish ghost colors on gray backgrounds. Is there anyway to remove these? Im using this script:
loadplugin("LoadPluginEX.dll")
loadplugin("Decomb.dll")
loadPlugin("DGDecode.dll")
loadplugin("Deen.dll")
loadplugin("UnDot.dll")
loadplugin("FluxSmooth.dll")
loadplugin("DeGrainMedian.dll")
loadplugin("asharp.dll")
MPEG2Source("test.d2v",cpu=4)
Telecide(post=false,guide=1)
Decimate(cycle=5)
crop(8,0,-8,0)
UnDot()
DeGrainMedian()
Deen("a2d",2,5,5)
Deen("a3d",2,5,5)
FluxSmooth()
aSharp(1,3)
BicubicResize(512,384,0,0.5)
Chainmax
3rd January 2005, 02:21
You might want to check out TIVTC (http://forum.doom9.org/showthread.php?postid=585717#post585717) for IVTCing. TFM(mode=2) does wonders at eliminating residual combing and if you feel TDecimate is too slow you can always replace it with Decomb's Decimate.
P.S: TFM and TDecimate are the fieldmatching and decimating functions of TIVTC.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.