Community
cancel
Showing results for 
Search instead for 
Did you mean: 
pascalc
Beginner
124 Views

ippiResizeSuper and initialization buffer

I am a bit confused by the initialization buffer for ippiResizeSuper. When calling ippiResizeGetSize, it provides me with a size for an initialization buffer. This initialization buffer is sometimes used by other ResizeXXXInit function. However, ippiResizeSuperInit does not take an initialization buffer as input. What confuses me is that ippiResizeGetSize returns me a non-zero size for the initialization buffer (64 in my case), despite the fact that this functions has the type of interpolation (ippSuper) as an argument. What am I supposed to do with this initialization buffer of size 64? If it is unused, shouldn't ippiResizeGetSize have a less ambiguous behavior and return an initialization buffer size of zero? I am using IPP 2017.0.0 on Windows 7 64bits. Pascal
0 Kudos
1 Reply
Zhen_Z_Intel
Employee
124 Views

Hi pascala,

For your question, the ippiResizeGetSize function is mainly to get input image structure & external buffer for resize transform initialization. Not all resize type would e required to get a returned buffer size from ippiResizeGetSize. For example, the ResizeLanczosInit funtion required a parameter of puffer for cubic filter initialization, the value of this parameter can be get from returned value "pInitBufSize" of ippiResizeGetSize. But ResizeLinearInit & ResizeSuperInit do not required this pointer of buffer. This buffer size is depends on what interpolation algorithms you decided to choose. You do not need to worrying without using this return value for supper sampling.

And another buffer value which is get from function "ippiResizeGetBufferSize" is used for resize calculation "ippiResizeSuper". They are actually two different buffer for different use. You could refer following code to understand:

//for antialiasing linear resize required init buffer
Ipp32s pInitBufSize=0;
ippiResizeGetSize_8u(srcSize, dstSize, ippLinear, 1, &specSize, &pInitBufSize);
IppiResizeSpec_32f* pSpec = (IppiResizeSpec_32f*)ippsMalloc_32f(specSize);
Ipp8u* pInitBuf = ippsMalloc_8u(pInitBufSize);
ippiResizeAntialiasingLinearInit(srcSize, dstSize, pSpec, pInitBuf);
Ipp32s bufSize=0;
ippiResizeGetBufferSize_8u(pSpec, dstSize, 3, &bufSize);
Ipp8u* pBuffer = ippsMalloc_8u(bufSize);
...
ippiResizeAntialiasing_8u_C3R(pSrc, srcStep, pDst, dstStep, dstOffset, dstSize, border, 0, pSpec, pBuffer);


//for super sampling resize not required init buffer
Ipp32s pInitBufSize=0;
ippiResizeGetSize_8u(srcSize, dstSize, ippLinear, 1, &specSize, &pInitBufSize);
IppiResizeSpec_32f* pSpec = (IppiResizeSpec_32f*)ippsMalloc_32f(specSize);
ippiResizeSuperInit_8u(srcSize, dstSize, pSpec);
Ipp32s bufSize=0;
ippiResizeGetBufferSize_8u(pSpec, dstSize, 3, &bufSize);
Ipp8u* pBuffer = ippsMalloc_8u(bufSize);
...
ippiResizeSuper_8u_C3R(pSrc, srcStep, pDst, dstStep, dstOffset, dstSize, pSpec, pBuffer);

 

Reply