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

What is difference with ippiMalloc_8u_AC4 and ippiMalloc_8u_C4 ?

foreststone
Beginner
760 Views
What is difference with ippiMalloc_8u_AC4 and ippiMalloc_8u_C4 ?

Another question is : Are the memory malloced by ippiMalloc zero ?
0 Kudos
2 Replies
seiji-torigoe
Beginner
760 Views
1. I think that IppiMalloc_8u_AC4 is not different from ippiMalloc_8u_C4.
2. It did not become 0.

#include "ipp.h"
int main(int argc, char* argv[])
{
Ipp8u * pImg;
Ipp8u * pTmp;
int ImgW, ImgH, Step, i;
IppiSize roiSize;

ImgW = 3; ImgH = 3;
pImg = ippiMalloc_8u_AC4(ImgW, ImgH, &Step);

pTmp = pImg;
for ( i = 0; i < Step / 4 * ImgH; i++ )
{
printf("%d, ", *pTmp); pTmp++;
printf("%d, ", *pTmp); pTmp++;
printf("%d, ", *pTmp); pTmp++;
printf("%d ", *pTmp); pTmp++;
} printf(" ");
Ipp8u value3[3] = {0, 0, 0};
roiSize.width = ImgW; roiSize.height = ImgH;
ippiSet_8u_AC4R(value3, pImg, Step, roiSize);
pTmp = pImg;
for ( i = 0; i < Step / 4 * ImgH; i++ )
{
printf("%d, ", *pTmp); pTmp++;
printf("%d, ", *pTmp); pTmp++;
printf("%d, ", *pTmp); pTmp++;
printf("%d ", *pTmp); pTmp++;
} printf(" ");

ippiFree(pImg);

pImg = ippiMalloc_8u_C4(ImgW, ImgH, &Step);

pTmp = pImg;
for ( i = 0; i < Step / 4 * ImgH; i++ )
{
printf("%d, ", *pTmp); pTmp++;
printf("%d, ", *pTmp); pTmp++;
printf("%d, ", *pTmp); pTmp++;
printf("%d ", *pTmp); pTmp++;
} printf(" ");
Ipp8u value4[4] = {0, 0, 0, 0};
roiSize.width = ImgW; roiSize.height = ImgH;
ippiSet_8u_C4R(value4, pImg, Step, roiSize);
pTmp = pImg;
for ( i = 0; i < Step / 4 * ImgH; i++ )
{
printf("%d, ", *pTmp); pTmp++;
printf("%d, ", *pTmp); pTmp++;
printf("%d, ", *pTmp); pTmp++;
printf("%d ", *pTmp); pTmp++;
} printf(" ");

ippiFree(pImg);

return 0;
}
0 Kudos
Vladimir_Dudnik
Employee
760 Views
Hi,
yes, it is correct. There is no difference in behaviour of ippiMalloc_8u_C4 and ippiMalloc_8u_AC4, we keep both functions just for convenience.
It is not guaranteed that allocated memory will be zeroed.
Regards,
Vladimir
0 Kudos
Reply