Community
cancel
Showing results for 
Search instead for 
Did you mean: 
marco_o
Beginner
80 Views

Problem with ippiMalloc_16u_C1()

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
80 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

renegr
New Contributor I
80 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.

macaire
Beginner
80 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

Reply