- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello there,
Is it worth to align scan lines in a image so each row begins on 16-aligned memory? That is, round up the stride to the next multiple of 16 bytes?
I assume this might help a bit when processing the entire image, but the real question is: does IPP cares?
If yes, along the same line, is it worth to 32-align scan lines on CPUs that have a 256 bit vector unit, or 64-align for AVX 512 chips?
Thanks,
Axel
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Alex,
When IPP allocates memory buffers for image processing, it ensures that data is aligned appropriately. So the source image itself doesn't need to be on aligned memory for the best performance.
Please see the below.
Malloc/Free
Intel IPP functions provide better performance if they process data with aligned pointers. Intel IPP provides the following functions to ensure that data is aligned appropriately - 16-byte for CPU that does not support Intel® Advanced Vector Extensions (Intel® AVX) instruction set, 32-byte for Intel AVX and Intel® Advanced Vector Extensions 2 (Intel® AVX2), and 64-byte for Intel® Many Integrated Core instructions.
void* ippMalloc(int length) void ippFree(void* ptr)
The ippMalloc function provides appropriately aligned buffer, and the ippFree function frees it.
The signal and image processing libraries provide ippsMalloc and ippiMalloc functions, respectively, to allocate appropriately aligned buffer that can be freed by the ippsFree and ippiFree functions.
As one of the example of image processing applications, please refer : https://software.intel.com/en-us/node/504353
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Jon: thanks for your reply, however my question was slightly different. Your answer only guarantee that the first scanline in the buffer is properly aligned, I was asking about the other ones. I probably should tweak the stride in order to align *each* scanline.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page