uic_image.cpp ImageDataRange::SetAsRangeInt bug

uic_image.cpp ImageDataRange::SetAsRangeInt bug

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
1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.