Link Copied
Hello Dirk,
as you probably know, the modern processors can read/write data faster when accessing aligned memory address. The advantage of IPP memory allocation functions is that they provide you with properly aligned memory block to speedup your furter access to that memory.
There is no issues related to using IPP memory functions when you stricly and carefully watch for matching memory allocation and deallocation functions. For example, when you allocate memory with ippsMalloc function then you have to delete that block with ippsFree function. The same is true for ippiMalloc or ippMalloc.
And funally, IPP functions does not require that memory should be allocated only with IPP functions. You also may use CRT malloc or any other memory manager API. In that case you have to care about alignment by yourself if you want to maximise calculation speed.
Regards,
Vladimir
Hi Dirk,
If you have global static object which allocates memory with ippiMalloc that should be ok to deallocate that memory with ippiFree function in its destructor.
If you allocate memory with ippMalloc but deallocate with ippiFree - there is an issue.
If you want to work with Bitmap memory directly, you may allocate it with appropriate Win32 functions and than call IPP functions on that data to process.
I think, it is not necessary toput header and pixel data in one contiguous memory block. You may keep them separately.
Regards,
Vladimir
For more complete information about compiler optimizations, see our Optimization Notice.