- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found in the example of Floodfill_Grad page: http://software.intel.com/
ippiFloodFillGetSize_Grad ( roiSize, &pBufSize ); Ipp8u* pBuffer = ippiMalloc_8u_C1 ( 8, 8, &pBufSize ); ippiFloodFill_Grad4Con_8u_C1IR ( pImage, 8, roiSize, seed, newVal, minDelta, maxDelta, &pRegion, pBuffer );
The pBufSize is calculated by GetSize() function, however it is updated in ippiMalloc function without any use.
From the manual description, the temporary buffer size should be calculated by GetSize and we only need to create a char buff with that size and pass the buff to flood fill function. However, as the example shows, the size returned by GetSize is not used at all. Or I guess the pBufSize is both \param[in, out] for ippiMalloc?
I have tried both ways: 1. the same way as the example shows. 2. I get size with GetSize() and new a char array with this size, and use this char array in Floodfill. It turns out that the 2nd way is about 3 times slower than the 1st way.
Is there any explanation? Or should the manual be updated to reflect about this difference?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
of course it's a bug in the manual.
the correct code should look the next way:
ippiFloodFillGetSize_Grad ( roiSize, &pBufferSize );
Ipp8u* pBuffer = ippMalloc_8u (pBufferSize );
ippiFloodFill_Grad4Con_8u_C1IR ( pImage, 8, roiSize, seed, newVal, minDelta, maxDelta, &pRegion, pBuffer );
Regarding your question on performance - does function work correctly in both cases and return OK status?
regards, Igor
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
of course it's a bug in the manual.
the correct code should look the next way:
ippiFloodFillGetSize_Grad ( roiSize, &pBufferSize );
Ipp8u* pBuffer = ippMalloc_8u (pBufferSize );
ippiFloodFill_Grad4Con_8u_C1IR ( pImage, 8, roiSize, seed, newVal, minDelta, maxDelta, &pRegion, pBuffer );
Regarding your question on performance - does function work correctly in both cases and return OK status?
regards, Igor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Igor,
Thanks for the info. I found that I used std::vector to hold the buffer and the initialization leads to extra time costs. I changed to use ippsMalloc and the time cost is reduced to the same as using ippiMalloc.
BTW, I can't find ippMalloc and ippFree in my IPPv7.0. I am using Windows 7 sp1.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK, I just found that it's in ipp.h which I never included before. I thought it ought to be automatically included by including ippi.h.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Chaofeng W. wrote:
OK, I just found that it's in ipp.h which I never included before. I thought it ought to be automatically included by including ippi.h.
Hi,
ippMalloc/ippFree come from ippcore library. It's a different functional domain. These functions are described in signal-processing manual (Support Functions) and require "ippcore.h" to be included.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page