Search code examples
cimage-processingcomputer-visionintel-ipp

Looking for a working example of FFT convolution with Intel IPP


Just trying to wrap my head around IPP right now. Does anyone have any working C/C++ code for doing a FFT convolution on an image?


Solution

  • Example from here:

    /* Sample C-code snipet for Example 1 using Intel® Integrated Performance Primitives (Intel® IPP): */
    
    /* allocate and initialize specification structures */
    ippsFFTInitAlloc_C_32fc(&FFTspec1_p, order, IPP_FFT_DIV_FWD_BY_N, ippAlgHintFast);
    ippsFFTGetBufSize_C_32fc(FFTspec1, &BufSize);
    Buf1_p = (Ipp8u *) ippsMalloc_32sc(BufSize*sizeof(Ipp8u));
    
    // ...
    
    /* compute in-place FFTs of input sequences*/
    ippsFFTFwd_CToC_32fc_I(x_p, FFTspec1_p, Buf1_p);
    ippsFFTFwd_CToC_32fc_I(y_p, FFTspec1_p, Buf1_p);
    
    /* perform complex multiplication and inverse FFT*/
    ippsMul_32fc( x_p, y_p, o_p, veclength);
    ippsFFTInv_CToC_32fc_I(o_p,FFTspec1_p, Buf1_p);
    
    // ...
    
    /* free specification structures */
    ippsFFTFree_C_32fc( FFTSpec1_p);
    ippsFree(Buf1_p);