- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What is difference with ippiMalloc_8u_AC4 and ippiMalloc_8u_C4 ?
Another question is : Are the memory malloced by ippiMalloc zero ?
Another question is : Are the memory malloced by ippiMalloc zero ?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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;
}
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;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page