English 中文(简体)
Fast Image Manipulation using SSE instructions?
原标题:

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

最佳回答

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.

问题回答

暂无回答




相关问题
gcc -fPIC seems to muck with optimization flags

Following along from this question: how-do-i-check-if-gcc-is-performing-tail-recursion-optimization, I noticed that using gcc with -fPIC seems to destroy this optimization. I am creating a shared ...

Generate assembler code from C file in linux

I would like to know how to generate assembler code from a C program using Unix. I tried the gcc: gcc -c file.c I also used firstly cpp and then try as but I m getting errors. I m trying to build an ...

Getting rid of pre-compiled headers

OK, I have old Metrowerks code for Mac and Windows where the previous developer used pre-compiled headers for every project that this code base builds. How does one get rid of Pre-compiled headers, ...

Include a .txt file in a .h in C++?

I have a number of places where I need to re-use some template code. Many classes need these items In a .h could I do something like: #include <xxx.txt> and place all of this code in the ....

How to compile for Mac OS X 10.5

I d like to compile my application for version 10.5 and forward. Ever since I upgraded to Snow Leopard and installed the latest XCode, gcc defaults to 10.6. I ve tried -isysroot /Developer/SDKs/...

热门标签