Object Size Puzzle

As it was said in the Function Naming section (see Arguments), object size is not always required when describing an object. The majority of IPP MX functions specify several objects and only one object size. There exist certain rules that define the object size parameter in such cases:

Example 1:

IppStatus ippmTranspose_m_32f(const Ipp32f* pSrc, int srcStride1,
    int srcStride2, int width, int height, Ipp32f* pDst, int dstStride1, 
    int dstStride2);

Object size width, height follows the src matrix, therefore, it is the src size.

srcWidth = width, srcHeight = height

The function purpose is transposition, therefore

dstWidth = height, dstHeight = width

Example 2:

IppStatus ippmAdd_mm_32f(const Ipp32f* pSrc1, int src1Stride1,
    int src1Stride2, const Ipp32f* pSrc2, int src2Stride1, int src2Stride2,
    Ipp32f* pDst, int dstStride1, int dstStride2, int width, int height);

Object size width, height follows the dst matrix, therefore, it is the dst size.

dstWidth = width, dstHeight = height

The function purpose is addition of matrices, therefore the sizes of the elements should be equal to the size of dst:

src1Width = width, src1Height = height

src2Width = width, src2Height = height

Example 3:

IppStatus ippmAdd_tm_32f(const Ipp32f* pSrc1, int src1Stride1,
    int src1Stride2, const Ipp32f* pSrc2, int src2Stride1, int src2Stride2, Ipp32f* pDst,
    int dstStride1, int dstStride2, int width, int height);

Object size width, height follows the dst matrix, therefore, it is the dst size.

dstWidth = width, dstHeight = height

The function purpose is addition of matrices, therefore the sizes of the elements should be equal to the size of dst.

item1Width = width, item1Height = height

item2Width = width, item2Height = height

The first object type is a transposed matrix. Therefore, src1 stored in the memory has the following size

src1Width = item1Height = height,

src1Height = item1Width = width

and after the transposition, you will get the right first object size.

The second object type is a single matrix, therefore

src2Width = item2Width = width,

src2Height = item2Height = height

Example 4:

IppStatus ippmMul_mm_32f(const Ipp32f* pSrc1, int src1Stride1, int src1Stride2,
   int matr1Width, int matr1Height, const Ipp32f* pSrc2, int src2Stride1, 
   int src2Stride2, int matr2Width, int matr2Height, Ipp32f* pDst, int dstStride1,
   int dst2Stride2);

Object sizes follow each of the src matrices, therefore, these are the src sizes.

src1Width = matr1Width, src1Height = matr1Height

src2Width = matr2Width, src2Height = matr2Height

The function purpose is multiplication of matrices, therefore the width of the product is equal to the width of the second multiplier, and the height of the product is equal to the height of the first multiplier. The dst sizes must be

dstWidth = matr2Width, dstHeight = matr1Height

Example 5:

IppStatus ippmMul_tm_32f(const Ipp32f* pSrc1, int src1Stride1, int src1Stride2,
    int matr1Width, int matr1Height, const Ipp32f* pSrc2, int src2Stride1, int src2Stride2,
    int matr2Width, int matr2Height, Ipp32f* pDst, int dstStride1, int dst2Stride2);

Object sizes follow each of the src matrices, therefore, these are the src sizes.

src1Width = matr1Width, src1Height = matr1Height

src2Width = matr2Width, src2Height = matr2Height

The function purpose is multiplication of matrices, therefore the width of the product is equal to the width of the second multiplier, and the height of the product is equal to the height of the first multiplier.

The first object type is a transposed matrix, while the second object type is an ordinary matrix. Therefore, the sizes of the multipliers are equal.

efficient1Width = matr1Height, efficient1Height = matr1Width

efficient2Width = matr2Width, efficient2Height = matr2Height

The dst sizes must be

dstWidth = efficient2Width = matr2Width,

dstHeight = efficient1Height = matr1Width


Submit feedback on this help topic

Copyright © 2000 - 2011, Intel Corporation. All rights reserved.