Home Products Download Order Contacts

comp.graphics.algorithms

Subject: Re: MMX Optimized Image Processing - Advice needed for data structure



On 22 May 2006 09:09:20 -0700, spamtrap@crayne.org wrote:

>Any advice on the data structure design? To avoid having two
>loops......

Dunno if it's faster or not than having two loops, but if your images
are not HUGE you could have an array which specifies how much to
increment the src pointer and the new value of the array index,
something like:

addr = addr + offsets[idx]->delta;
idx = offsets[idx]->next;

Using your example, offsets[]->delta would contain say 4 (for a 32bit
image) for the first 7 elements, then 32 for the 8th element.
idx would contain {1, 2, 3, 4, 5, 6, 7, 0}. Alternatively you can do
the wrapping yourself.

You'll have to calculate the start address based on the upper-left
corner of the ROI of course.

Think this should work, though it is getting late here :)

- Asbjørn

Reply


View All Messages in comp.graphics.algorithms

path:
MMX Optimized Image Processing - Advice needed for data structure =>

Replies:

Copyright © 2006 WatermarkFactory.com. All Rights Reserved.