Hello.
Do I need to allocate memory for arrays only with ippiMalloc (it allocates 32-bytes aligned memory) or not?
Does using other memory allocating functions (malloc, ...) affects to performance?
Code:
IppStatus GaussFilter (Ipp32f* pSrc, const int nWidth, const int nHeight, const Ipp32f fSigma, Ipp32f* pDst)
{
int nKernelSize = 7;
IppiSize tWholePic = {nWidth, nHeight};
int nStepBytes = 0;
pDst = ippiMalloc_32f_C1 (nWidth, nHeight, &nStepBytes);
int nBorderBufferSize = 0;
Ippi8u* pBorderBuffer = ippiFilterGaussGetBufferSetSize_32f_C1R (tWholePic, nKernelSize, &nBorderBufferSize);
ippiFilterGaussBorder_32f_C1R (pSrc, nWidth * sizeof (Ipp32f)
, pDst, nWidth * sizeof (Ipp32f) // Have I use this one or nStepBytes receipt from ippiMalloc?
, tWholePic
, nKernelSize, fSigma, ippBorderRepl, 0.
, pBorderBuffer);
}
void tmain(...)
{
int nWidth = 12, nHeight = 15;
Ipp32f fSigma = 1.;
Ipp32f pSrc[nWidth * nHeight] ;
Ipp32f* pDst = NULL;
// Initialize pSrc
GaussFilter (pSrc, nWidth, nHeight, pDst);
// Do something with pDst.
if (pDst != NULL)
ippFree (pDst);
}
Regards,
Mark