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

uic_image.cpp ImageDataRange::SetAsRangeInt bug

Aris_Basic
New Contributor I
106 Views
shouldnt that funciton look like this

voidImageDataRange::SetAsRangeInt(Ipp64smin,Ipp64smax)
{
m_min.v64s=min;
m_max.v64s=max;
 
if(min<0)
{
m_isSigned=true;
m_bitDepth=::BitDepth64(::Max(-min+1,max)); // was ::Max(-(min+1),max)
}
else
{
m_isSigned=false;
m_bitDepth=::BitDepth64(::Max(min,max));
}
}

checking with 8 bit signed range
-128, 127
with previous code it would do ::BitDepth64(127) = 7 (and it needs to be 8)
Max(127,127)

with modified code Max(129,127) -> BitDepth64(129) = 8


Edit:
there is similar "Bug" in SetAsRange32f  and SetAsRange64f when caclulating absMax
0 Kudos
0 Replies
Reply