How to process a 24-bit 3 channel color image with SSE2/SSE3/SSE4?

后端 未结 2 425
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-01 06:15

I just started to use SS2 optimization of image processing, but for the 3 channel 24 bit color images have no idea. My pix data arranged by BGR BGR BGR ... ,unsigned ch

相关标签:
2条回答
  • 2021-01-01 07:22

    I have slides on de-interleaving of 24-bit RGB pixels, which explain how to do it with SSE2 and SSSE3.

    0 讨论(0)
  • 2021-01-01 07:22

    Here is some answers to your question:

    • For How to use SSE2 instruction C/C++ functions. These references may be helpful.
      • Optimization of Image Processing Algorithms: A Case Study
      • Speeding up some SSE2 Intrinsics for color conversion
      • SSE intrinsic functions reference
    • For the alignment: Yes, 16-byte align is necessary. When there are memory accesses using SSE2 intrinsic functions( The SSE2/SSE3/SSE4 instruction C/C++ functions), you should make sure that the memory address is 16-byte alignment. If you're using MSVC, you'll have to use declspec(align(16)), or with GCC, this would be __attribute((aligned (16))).
      • The reason why align is necessary can be found here: Why does instruction/data alignment exist?
    • For 3-channel RGB conversion, I am not an image-processing experts, so can not give advice. There are also some open source image processing libraries that may already contain the code you want.
    0 讨论(0)
提交回复
热议问题