Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
Thread Tools | Search this Thread | Display Modes |
9th August 2012, 22:46 | #2 | Link |
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,391
|
It's not the separate/select/weave that is slow. Those are just copying bits from here to there.
The slow part is the bob, and the slow part is the resize. Those are the ones actually doing calculations. a) Code:
dgsource("1080i.dgi") bob(0,0.5) lanczos4resize(720,576) separatefields().selectevery(4,0,3).weave() Bob() is doing a [y] resize. Lanczos is 4-tap (more taps = more slow) in both dimensions. b) Code:
dgsource("1080i.dgi") bob(0,0.5) bicubicresize(720,576,0,0.5) separatefields().selectevery(4,0,3).weave() Bicubic is 3-tap, hence faster than 4-tap. c) Code:
dgsource("1080i.dgi") bicubicresize(720,height(),0,0.5) bob(0,0.5,height=576) separatefields().selectevery(4,0,3).weave() 101 fps. Example a) with a 5-tap resizer (lanczos, blackman) comes out at 28.5 fps.
__________________
- We´re at the beginning of the end of mankind´s childhood - My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!) |
10th August 2012, 01:49 | #3 | Link |
Avisynth Developer
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
|
@hanfrunz,
To answer your original question, yes you can use DoubleWeave() which tries to optimise the frame memory copying if it can. Weave() always creates a new frame and copies the top field then the bottom field. DoubleWeave() in frame mode checks to see if either input frame IsWriteable() and will then only copy the alternate field from the other frame, saving 1 field memory copy. If neither are writeable then it does the same as Weave(). As you can see it does not make much difference to the whole script, which Didée points out is because most processing is taking place in other filters. Here we can save 0.5ms per frame, which as expected, is about the cost of a SD field bit on a modest machine. The semantics of using DoubleWeave() are a little tricky so most people tend to overlook using it. Code:
ColorBars(1920, 1080, "yv12") bicubicresize(720,height(),0,0.5) bob(0,0.5,height=576) # separatefields().selectevery(4,0,3).weave() # 104 fps, 9.6ms ComplementParity().DoubleWeave().selectevery(4,1) # 110 fps, 9.1 ms |
|
|