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

uic_image.cpp ImageDataRange::SetAsRangeInt bug

Aris_Basic
New Contributor I
183 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