Intel® Integrated Performance Primitives
Community support and discussions relating to developing high-performance vision, signal, security, and storage applications.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
6628 Discussions

## The difference of IPP results and my native C code

Beginner
183 Views
Hi, I use the IPP 5.3, but the result of "FilterDeblocking8x8HorEdge_MPEG4" is different of mine, Who can help me?

I found the difference is how to round the "Integer division". How does Ipp implement this?

According the MPEG4 Video Verification Model, "//" means integer division and round to infinite, perhaps this isthe reason why my result is different from IPP. I think the a30 is different.

This is my code

int a30 = roundInfinite((((v[3] - v[6]) << 1) + 5 * (v[5] - v[4]))/8.0);

inline int roundInfinite(float v)
{
return ((v>=0) ? (int)(v + 0.5) : (int)(v - 0.5));
}

1 Solution
Employee
183 Views
IPP implement this as

if (a30 >= 0)
a30 = (a30 + (1 << (3 - 1))) >> 3;
else
a30 = (a30 + (1 << (3 - 1)) - 1) >> 3;

3 Replies
Employee
184 Views
IPP implement this as

if (a30 >= 0)
a30 = (a30 + (1 << (3 - 1))) >> 3;
else
a30 = (a30 + (1 << (3 - 1)) - 1) >> 3;

Beginner
183 Views
IPP implement this as

if (a30 >= 0)
a30 = (a30 + (1 << (3 - 1))) >> 3;
else
a30 = (a30 + (1 << (3 - 1)) - 1) >> 3;