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

Error in ippiSampleLine Documentation example

Derek_J_
Beginner
387 Views

The ippiSampleLine documentation has a significant error that left me very confused as to how this method works. I'm not sure of the appropriate place to report these errors, so I hope someone from Intel sees it here.

The sample code is:

void func_sampleline()
{
    Ipp8u pSrc[5*4] = { 0, 1, 2, 3, 4,
                        5, 6, 7, 8, 9,
                        0, 9, 8, 7, 6,
                        5, 4, 3, 2, 1 };
    IppiSize roiSize = {5, 4};
    IppiPoint pt1 = {1, 1};
    IppiPoint pt2 = {2, 3};
    Ipp8u pDst[3];
    int srcStep = 8*sizeof(Ipp8u);
		
    ippiSampleLine_8u_C1R( pSrc, srcStep, roiSize, pDst, pt1, pt2 );
}

And the sample output is given as: 9 3 18

It  shouldn't be possible to get 18 as the output, since the value 18 doesn't appear in the input pSrc data. This led me to think I didn't understand what this method was supposed to do. Eventually after running the sample myself, I discovered that this 18 is just whatever value happened to be in the pDst buffer. The reason this occurred is the srcStep of 8*sizeof(Ipp8u) is incorrect. The step of pSrc as created is clearly 5, not 8. Changing the srcStep value to the correct value yields the intended output of: 6 9 3

0 Kudos
3 Replies
Gennady_F_Intel
Moderator
387 Views

1)

This forum is the good place to report the issue too or  you can put your report to the IPS - http://software.intel.com/en-us/articles/new-intel-premier-support

2) the only error I see in the example from documentation -- printf("%Result: d, %d, %d\n", pDst[0], pDst[1], pDst[2] );

this misprint would be fix.

3) you set the incorrect src step and do you expect the correct results? in the case like you use -- 8*sizeof(Ipp8u), you will out of memory and the output results would be different ... 

when  the srcstep set the correct value - all results correct.

 

 

0 Kudos
Derek_J_
Beginner
387 Views

Gennady Fedorov (Intel) wrote:

2) the only error I see in the example from documentation -- printf("%Result: d, %d, %d\n", pDst[0], pDst[1], pDst[2] );

this misprint would be fix.

 

I was referring to the documentation at: http://software.intel.com/sites/products/documentation/hpc/ipp/ippi/ippi_ch4/functn_SampleLine.html

which has the incorrect srcStep of 8 and corresponding incorrect results.

0 Kudos
Gennady_F_Intel
Moderator
387 Views

the IPP v.8.1 manual has been changed and doesn't contain this error.  

We will update the version of manual you pointed. thanks for the issue.

0 Kudos
Reply