Intel® Integrated Performance Primitives
Community support and discussions relating to developing high-performance vision, signal, security, and storage applications.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!

UIC precision Question

Aris_Basic
New Contributor I
79 Views
In many places where range is being set ther eis code like this
SetRange16u((1 << (image.Precision() - 1)) - 1)
doesnt this look wrong ?
should it not be (1<< image.Precision())-1
0 Kudos
3 Replies
Chao_Y_Intel
Employee
79 Views
Hello,

could you help to provide the file on such code? I did a search. I see in most of them, they are like:
SetAsRange16u((1 << (image.Precision() ) - 1)

Thanks,
Chao
Aris_Basic
New Contributor I
79 Views
[bash]application/picnic/src/jpeg.cpp:318: imageCn.ColorSpec().DataRange().SetAsRange16u((1 << (image.Precision()-1)) - 1); application/picnic/src/jpeg2k.cpp:642: imagePn.ColorSpec().DataRange().SetAsRange16u(1 << (image.Precision()-1)); application/uic_transcoder_con/src/jpeg.cpp:336: imageCn.ColorSpec().DataRange().SetAsRange16u(1 << (image.Precision()-1)); application/uic_transcoder_con/src/jpeg2k.cpp:642: imagePn.ColorSpec().DataRange().SetAsRange16u(1 << (image.Precision()-1)); application/wic_uic_codec/src/jpeg.cpp:336: imageCn.ColorSpec().DataRange().SetAsRange16u(1 << (image.Precision()-1)); [/bash]
this my grep search
im using these files as base of my jpeg2000 and jpeg compression decompression)
also another thing i did not see response from you guys is setting min/max signed range in uic_image.cpp
void ImageDataRange::SetAsRangeInt(Ipp64s min, Ipp64s max)
{
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));
}
}
i think if using was code (original) it would return 1 bit to small bit depth.
(-32768,32767) -> 15 instead of 16bit with modified code
ILevi1
Valued Contributor I
79 Views
It seems that Depth is 7 for 8-bit channels which is kind of weird.
Reply