View Full Version : suggestions for more efficient avisynth scripts :)
poopity poop
27th May 2002, 05:27
I've always made my own scripts but jsut for kicks I wanted to see what gknot would make and I noticed it uses:
crop(0,0,718,478)
BicubicResize(480,360,0,0.5)
Instead of:
BicubicResize(480,360,0,0.5,0,0,718,478)
It specifally states in the documentation that this way produces faster frameserving.
Also -- Gknot doens't offer a=1/3,b=1/3 bicubic resize methods the defualts and from my experience the best overall bicubic settings producing:
BicubicResize(480,360,1/3,1/3,0,0,718,478) 16:9 AR
as a command line
Anothing thing that I always do is add 5 pixels to the left and right due to TV's natural cropping, this lends to seeing mroe overall picture. The command line goes something like this:
BicubicResize(470,352,1/3,1/3,0,0,718,478)
addborders(5,64,5,64)
This still preserves the proper aspect ratio but puts some black bars on the right and left side(like a real DVD does if you've noticed_ to give the viewer mroe picture to look at :)
Just a few thoughts for theWef for his next huge update maybe you're doing this I don't know. Didn't want to seem to jump on your case just seems like such a quick fix for such a big increase in speed and efficiency
TheWEF
27th May 2002, 05:33
Originally posted by poopity poop
It specifally states in the documentation that this way produces faster frameserving.
did you test it? how much faster?
also, people might want to do something between crop and resize, like deinterlace...
Originally posted by poopity poop
Also -- Gknot doens't offer a=1/3,b=1/3 bicubic
no, it does.
@poopity poop:
i don't encode dvd, so i have only one remarks about an issue i think (=hope) i understand well:
the 5 pixels borders are BAD BAD BAD. for 3 reasons:
1. they do change the aspect ratio (very slightly, prob un-noticable), since you add different percentage to width/height (5/480 is different from 5/360).
2. you don't need them to make more area of the movie appear on tv, since the tv-out card doesn't support such resolution anyway (480x360), and the player have to resize the image anyway. so just let it resize (shrink) a bit more, till you have a perfect fit to youre tv view-area. (i use zoom player/bsplayer/powerdivx and achieve this functionality with all of them).
3. it reduces the compressibility of the clip (you have to encode more data), especially when youre borders are NOT multiples of 8 (mpeg4 block size= 8x8), so u have a VERY sharp edge in each of the border blocks, which takes a LOT of bits that otherwise could be used for actual movie. if you wanna stick to that border method, at least choose it to width of 8.
cheers
avi.
poopity poop
27th May 2002, 17:00
1. they do change the aspect ratio (very slightly, prob un-noticable), since you add different percentage to width/height (5/480 is different from 5/360).
actually I kept the AR the same by doing this math:
width = 470/480 = 0.979
0.979 * 640 = 626
626*(9/16) = 352
Therefore 470x352 when borders are added to 480x480 then resized to a 4:3 AR the 16:9 AR maintains the same. Which leads into the next thing:
it reduces the compressibility of the clip (you have to encode more data), especially when youre borders are NOT multiples of 8 (mpeg4 block size= 8x8)
470/8 = 58.75
352/8 = 44
The 352 checks out but of course the 470 doesn't perhaps 472 would be better which would produce a resize like:
bicubicresize(472,352,1/3,1/3,...
addborders(4,64,4,64)
Good point :)
since the tv-out card doesn't support such resolution anyway (480x360),
I have a TV out card...but also a DVD player in which I play my movies in and I think the people that download SVCD's are more interested in playing them though a DVD player :) If you wanted to use a TV out card the resolution going though it would be 480x480, being resized to whatever screen resoultion you have it set to --most likelt 640x480. Perhaps I didn't understnad your question on that one.. ?
did you test it? how much faster?
Just did my test. I encoded 3000 frames and timed on a stopwatch how long it took here were my scripts:
LoadPlugin("D:\Encoding\avisynth\mpeg2dec_dll\mpeg2dec.dll")
mpeg2source("H:\WomanWant\www.d2v")
crop(0,0,718,478)
BicubicResize(480,352,1/3,1/3)
addborders(5,64,5,64)
and
LoadPlugin("D:\Encoding\avisynth\mpeg2dec_dll\mpeg2dec.dll")
mpeg2source("H:\WomanWant\www.d2v")
BicubicResize(480,352,1/3,1/3,0,0,718,478)
addborders(5,64,5,64)
The first one took 4min 15sec 87hs
the second took 4min 15sec 25hs
So basically...it doesn't affect speed, oh well
also, people might want to do something between crop and resize, like deinterlace...
Well I can see why people would want to do that to reduce area before deinterlacing...but why deinterlace when you can iVTC and you should do that before cropping and resizeing
-------------------------------------
ah.. I see the soft bicubic but... you use .333,.333, my bad didn't see it. Like I said I don't use gknot :). But...maybe you should use 1/3 1/3 because of course the fraction is more accurate...just a suggestion.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.