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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Display Modes
Old 27th September 2006, 10:46   #1  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,267
possible Overlay() optimisation?

hi all.

i'm using this script to make scrolling credits:
Code:
function credits (clip c, string image, int inframe, int outframe)
{
global cr_c = c
global cr_image40	= imagesource(image,end=0).converttorgb32()
global cr_image31	= cr_image40.generalconvolution(matrix="0 0 0 0 3 0 0 1 0")
global cr_image22	= cr_image40.generalconvolution(matrix="0 0 0 0 2 0 0 2 0")
global cr_image13	= cr_image40.generalconvolution(matrix="0 0 0 0 1 0 0 3 0")

global cr_flat = cr_image40.blankclip(color=$ffffff)

global cr_in = inframe
global cr_out = outframe

cr_evaluate1 = c.scriptclip(""" overlay(cr_c,cr_flat,mask=cr_image,y=int(off_y) ) """)
cr_evaluate2 = frameevaluate(cr_evaluate1,"""	global cr_image = 4-(4*(off_y-int(off_y)))+.5 < 1 ? cr_image40 :
\						4-(4*(off_y-int(off_y)))+.5 < 2 ? cr_image31 : 
\						4-(4*(off_y-int(off_y)))+.5 < 3 ? cr_image22 : cr_image13""")
frameevaluate(cr_evaluate2,""" off_y = (576 + cr_in*(cr_image40.height/float(cr_out - cr_in)))
\						- current_frame*(cr_image40.height/float(cr_out - cr_in)) """)
}
and it's kinda slow.

i'm loading a very large .png file, and this script is scrolling it up according to the in and out points.

the only problem is it's very slow. i'm guessing that overlay is rendering all 13858 lines of my png every frame.

is it possible for overlay to be modified so it only works with what's inside the frame size of the input clip?
__________________
interlace... right or wrong, just deal with it.

Last edited by Mug Funky; 27th September 2006 at 10:48. Reason: forgot to finish typing
Mug Funky is offline   Reply With Quote
Old 27th September 2006, 11:15   #2  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 3,515
Why aren't you using Animate() + Resize(crop-only) ?
__________________
We´re at the beginning of the end of mankind´s childhood
Didée is offline   Reply With Quote
Old 27th September 2006, 12:13   #3  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,267
aah. i could probably do that. that'll give more subpel accuracy as well (provided i use latest avisynth).

looks like it's back to the old drawing board

however, is it possible for the cropresize stuff to go entirely off the screen (ie. not just repeat the edge pixels)? that can be desirable sometimes.
__________________
interlace... right or wrong, just deal with it.
Mug Funky is offline   Reply With Quote
Old 27th September 2006, 19:03   #4  |  Link
sh0dan
AviSynth Developer
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,468
Well - overlay converts the image to yv24 before it applies clipping, but it will only convert the mask, if any part of the image is visible.

Convert your images to YV12. The YV12 -> YV24 is much faster - especially for the mask.

If you need to maintain chroma, use v2.6, as you can use YV24 natively.
__________________
Regards, sh0dan // VoxPod
[AviSynth 2.5 project page] | [blog].
sh0dan is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:43.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.