Quantcast
Channel: Intel® Software - Intel® Integrated Performance Primitives
Viewing all articles
Browse latest Browse all 1489

(ippiMalloc_XXX | malloc) & ippiFilterGauss*

$
0
0

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

 


Viewing all articles
Browse latest Browse all 1489

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>