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

How does ippiMalloc work?

Vinay_Y_1
Beginner
627 Views
Hi,
How does ippiMalloc work? Has it got anything to do with ippsMalloc?
If I want to iterate thru the buffer in a linear fashion most of the times, can I allocate buffer using ippsMalloc instead of ippiMalloc?

Also where can I find code examples for different filter functions.
Most of the times my code crashes where I call a filter function,
and then call ippiFree on the source buffer.

TIA,
Vinay
0 Kudos
4 Replies
Vladimir_Dudnik
Employee
627 Views
Hi Vinay,
Did you look at IPPI Manual, chapter 9 "Filtering Functions"? It contains description and small, simple samples how to call IPP filtering functions.
Regards,
Vladimir
0 Kudos
Vinay_Y_1
Beginner
627 Views
Hi Vladimir,
Thanks for the reply. I solved my issue of crashes with ippiFilter function.(wasn't offsetting the pointer correctly)

But my main question is about ippiMalloc and ippsMalloc.
Also, currently we use IPP 4.0. Is there any performance advantage to upgrade to IPP 4.1?

TIA,
Vinay
0 Kudos
Vladimir_Dudnik
Employee
627 Views
Hi Vinay,
I glad to hear that you solved your problem. Regarding IPP memory allocation functions:
the only difference between ippsMalloc and ippiMalloc is that the first one is allocata 1D array and the second one is allocate 2D array. Of course you should use appropriate free functions, ippsFree for ippsMalloc but ippiFree for ippiMalloc.
Is it info you asked about?
Regarding your question about IPP v4.1, of course, IPP v4.1 contains more preferable to use because of more optimization, new platform support (EM64T), more functionality and so on.
Regards,
Vladimir
0 Kudos
seiji-torigoe
Beginner
627 Views
Frequent, I allocate the memory aligned to 4-byte boundary for WindowsDIB.
I use notippiMalloc but ippsMalloc.
samlple
int main(int argc, char* argv[])
{
Ipp8u * pBuf;
Ipp8u * pTmp;
int ImgW, ImgH, Step;
IppStatus Status;
Ipp8u Value;
IppiSize RoiSize;
int i;
ImgW = 10; ImgH = 10;
Step = (ImgW + 3) & (~3);
pBuf = ippsMalloc_8u(Step * ImgH);
// pBuf = ippiMalloc_8u_C1(ImgW, ImgH, &Step);
Value = 5;
RoiSize.width = ImgW; RoiSize.height = ImgH;
Status = ippiSet_8u_C1R(Value, pBuf, Step, RoiSize);
pTmp = pBuf;
for ( i = 0; i < Step * ImgH; i++ )
{
printf("%d ", *pTmp); pTmp++;
}
ippsFree(pBuf);
// ippiFree(pBuf);
return 0;
}
0 Kudos
Reply