2d block transfer / generic bitblt

fifty7var

Newbie
Joined
Jul 12, 2003
Messages
128
Reaction score
0
Perhaps this is a simple question, but I have a 1D int array which contains a 2D matrix (why use 2d arrays when you can use macros to access the data).

This matrix is actually an image with in 32 bit RGBx format, that is returned from the firewire image grabber as part of a larger struct. I would like to extract 64x64 pixel blocks from the image, and run some processing on that data block by block (2d walsh-hadamard transform to gather sequency data).

I'd like to do what would essentialy be a 2d block transfer on the array, but I can't think of a good fast way to do this. I can do 64 memcpy's, which is of course better than nothing, but is there an equivelent to bitblt for any old data array? as far as the computer is concerned data is data, so i can't imagine it would really make that much of a difference.

Whats your opinion on this? should i be using 64 memsets? should I write my own 2D Blt? Should i use SIMD?

Performance is paramount, this is the first step before a large amount of image processing that must be done in real time, at 15-30hz.

Adam
 
If performance is critical i would suggest trying all 3 alternatives and measuring there performances. That way you know you've got the best speed possible at that stage in your program.
 
Yeah, I'll probably end up doing that in the end.

I have a few ideas for ways i can speed things up. Cache hits/misses may wind up being pretty important.

As a general question, what is the best way to go about a 2d block transfer anyways? Or in otherwords, what is the underlying operations behind a bitblt that makes it fast. Is is just memcpy by rows?

Adam
 
Back
Top