View Single Post
Old 11th March 2003, 19:50   #2  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
@Bach: Looks very good - I don't have any sources to test on myself - but they'll probably turn up.

Potential problems:
- Don't assume pitches are the same for all frames. Your findanchor loop assumes that pitch is the same for all the frames it recieves. This may however not be the case. So store the pitch along with the pointers to avoid any potential problems here.

Optimizations for your FindAnchor loop:
- Instead of /2 and /8, use bitshifting (>>1 and >>3 respectively). You cannot trust the compiler to do this as you work on signed ints. It is much faster - especially in inner loops. This can however only be used when the divisor is a power of 2. A clever compiler might however see that the entire line is a constant within the loop, and therefore calculate it before it enters the loop. However you should probably do this manually just to be sure.

- Instead of %8, use &7. Again much faster. Again only valid for divisors that are multiple of 2.
__________________
Regards, sh0dan // VoxPod
sh0dan is offline   Reply With Quote