Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Problem with ippiMalloc_16u_C1()

marco_o
Beginner
525 Views
Hi all, I've a problem with ippiMalloc_16u_C1. When I try to allocate memory for an image (16bit depth, 1 channel PNG format) it return a stride = width * 16 / 8 + 10 and not = width *16/8 Why??
0 Kudos
3 Replies
matthieu_darbois
New Contributor III
525 Views

Hi,

ippiMalloc_* allocate a block of memory with each line aligned on a 32 bytes boundary.

So I guess that width*16/8 + 10 is a multiple of 32 in your case. That is width = 11 + x * 32 if I'm not mistaken.

Regards

Matthieu

0 Kudos
renegr
New Contributor I
525 Views

ippiMalloc not only aligns the x but also the y axis. If this is a problem for you, of course you can use ippsMalloc or _aligned_malloc from CRT. Then your stride is width*16/8 and you can use this stride also as a parameter to some ippi* functions. Many ippi* functions like color conversion, add, subtract ... will work without 32byte aligned lines.

0 Kudos
macaire
Beginner
525 Views
Quoting marco.o
Hi all, I've a problem with ippiMalloc_16u_C1. When I try to allocate memory for an image (16bit depth, 1 channel PNG format) it return a stride = width * 16 / 8 + 10 and not = width *16/8 Why??

HI, Marco.o

Did find a solution, Ithink you must try and go on the advice renegr's given you. With this way, you'll be ok.Sure.

Feel free and try to submit again if no solution.

Nice to have you as new member

0 Kudos
Reply