Reputation: 29915
I am writing a graphics library in C and I would like to utilize SSE instructions to speed up some of the functions. How would I go about doing this? I am using the GCC compiler so I can rely on compiler intrinsics. I would also like to know whether I should change the way I am storing the image data (currently I am just using an array of floats) - do I need to use an array of type float __attribute__ ((vector_size (16)))
?
EDIT: the type of image manipulation/processing I am interested in include affine transformations, geometry, and frequency domain filtering (Fourier analysis)
Any references or tips on how I should go about using SSE for image manipulation in C would be much appreciated.
thanks
Upvotes: 2
Views: 1279
Reputation: 16219
I've been working on some image processing with SSE on Microsoft Visual C++. I've found it's easiest to align all image data (in Visual C++ that's done with _aligned_malloc and _aligned_free) right from the start. Alignment is a real pain though, that's why I only used SSE for arithmetic operations (add, subtract, dot product, those kinds of things). If I had to do more complicated things I generally just used pointers.
Upvotes: 2