# comp.graphics.algorithms

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

Previously, I had written several image processing MMX routines.

for example)

They are so far so good. However, recently it discover some problem in
my image data structure and I hope to get some advice from you all.

Consider the following images 16 width and 4 height.

---------------------------------
|X X X X X X X X X X X X X X X X|
|X X X X X X X X X X X X X X X X|
|X X X X X X X X X X X X X X X X|
|X X X X X X X X X X X X X X X X|
---------------------------------

My routines can process this 2D data, by taking in parameter
size=4x16=64, and process the image just like a 1D data. All can be
done in a single loop.

This is because the first data of the next line is just beside the last
data of the current line. Says, Next pixel of
(x=15 y=0) is (x=0 y=1)

However, if I need to process just the ROI of the images, says at
location
x=1 y=1, with width = 8, height = 4

---------------------------------
|X O O O O O O O O X X X X X X X|
|X O O O O O O O O X X X X X X X|
|X O O O O O O O O X X X X X X X|
|X O O O O O O O O X X X X X X X|
---------------------------------

That is a headache. I can no longer process the data in a single loop.
This is because The last data of the current line, is NO longer besides
the first data of the next line.

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

I was once thought to copy the ROI to another new data buffer, so that
I can process it in a single loop fashion. However, the copy operation
takes too much time. The ROI itself is sometimes quite large. :(

---------------------------------
|X O O O O O O O O X X X X X X X|
|X O O O O O O O O X X X X X X X|
|X O O O O O O O O X X X X X X X|
|X O O O O O O O O X X X X X X X|
---------------------------------
|
|/
.
-----------------
|O O O O O O O O|
|O O O O O O O O|
|O O O O O O O O|
|O O O O O O O O|
-----------------

Thank you very much! Hope to get advice from you all.

yccheok

View All Messages in comp.graphics.algorithms

path:

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