On Sep 24, 2006, at 8:50 PM, Phil M wrote:

On Sep 24, 2006, at 5:24 PM, Theodore H. Smith wrote:

Firstly... I think you should give up.

Unless you want a slow solution.

Or do it in C, and be prepared to use some mind bending algorithms to optimise it ;)

It's not going to be fast in RB, that is all. You need low level access for it to be fast. You could petition for RB to have C-like pointers, perhaps... and to get pointer access to pictures also. And an optimising compiler that is good at optimising pointer code.

While doing this in a C Plugin would have the fastest results, I am sure that there are a lot of optimizations which can be done within REALbasic.

I was just thinking that if you sample down the two source pictures before evaluating the pixels, you would get done a lot faster (but with less accurate results). For example, the iSight camera gives output at 640x480... you could scale it down to a 256x192 picture and your code might run approximately 625% faster than the original. Scale it down to 128x96 and your code might run approximately 2500% faster than the original.


yeah, the number one trick is to work in the lowest res you can.

there are tons of other tricks, like processing every pixel in a frame at once via veclib, or converting picture objects directly to ptrs to remove RB's image access overhead. its all pretty declare heavy though. now that RB has ptrs, I've found my coding tricks have changed a lot - i'm doing more and more in tight loops byte by byte. but for blurs / distortions/ fft etc, the vImage and vDSP libraries on mac offer huge speed gains. And lately I've been moving more and more processing to the GPU via opengl.

mike
--
Mike Woodworth
[EMAIL PROTECTED]



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to