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

Problem with ippiMalloc_16u_C1()

marco_o
Débutant
1 971 Visites
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 Compliments
3 Réponses
matthieu_darbois
Nouveau contributeur III
1 971 Visites

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 Compliments
renegr
Nouveau contributeur I
1 971 Visites

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 Compliments
macaire
Débutant
1 971 Visites
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 Compliments
Répondre