Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

A Description problem of matrix

puenpuen
Beginner
308 Views
Hi:
I use ipp lib to do matrix operation in Visual C++ 6.0, but there is a parameter making me confused, for example, I use "ippmInvert_m_64f_5x5" then I need to enter the parameter "srcStride". Is "srcStride" eaqual 5 ? or other intger? can you give me an guide? please adviser thank you so much~
0 Kudos
2 Replies
Vladimir_Dudnik
Employee
308 Views
Hi, did you looked through IPP manual? I believe the concept of matrix in IPP is described here.
Regards,
Vladimir
0 Kudos
Vladimir_Dudnik
Employee
308 Views
BTW, developer provided simple sample for you, which should demonstrate the way of using this function
Code:
#include 
#include 

IppStatus ippmInvert_m_64f_5x5 (const Ipp64f* pSrc, Ipp32s srcStride1, Ipp64f*
                                pDst, Ipp32s dstStride1)
{
    Ipp64f pBuffer[5*5+5]; /* Buffer location */

    return ippmInvert_m_64f(pSrc, srcStride1, sizeof(Ipp64f), pBuffer, 
        pDst, dstStride1, sizeof(Ipp64f), 5); 
}

void printf_m_Ipp64f(const char* msg, Ipp64f* buf, 
                     int width, int height, IppStatus st ); 

/* 
// Example demonstrates how to use the function iinvert_m_64f_5x5
//
// Standard description for source and destination matrices      
*/
int main(){
    int widthHeight = 5;
   /* Source matrix with widthHeight=5 */
    Ipp64f pSrc[5*5] = { 1,  1, -1,  1, -1,
                        -1,  0,  2, -1,  1,
                        -1, -1,  2,  0, -1,
                         1, -1,  0,  1, -1,
                        -1, -1,  2,  1, -1};
    int srcStride1  = 5*sizeof(Ipp64f);

   /* Destination matrix with widthHeight=5 */
    Ipp64f pDst[5*5];
    int dstStride1 = 5*sizeof(Ipp64f);

     IppStatus status = ippmInvert_m_64f_5x5 (pSrc, srcStride1, pDst, dstStride1);

     printf_m_Ipp64f("Destination matrix:", pDst, 5, 5, status);
     return status;
}

void printf_m_Ipp64f(const char* msg, Ipp64f* buf, 
                     int width, int height, IppStatus st ) 
{   int i, j;
    if( st < ippStsNoErr ) { 
        printf( "-- error %d, %s
", st, ippGetStatusString( st )); 
    } else { 
        printf("%s 
", msg ); 
        for( j=0; j <  height; j++) { 
		    for( i=0; i < width; i++) { 
	            printf("%f  ", buf[j*width+i]); } 
		    printf("
"); } } 
}



Regards,
Vladimir
0 Kudos
Reply