Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor I
8 Views

UIC precision Question

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
Highlighted
Employee
8 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
0 Kudos
Highlighted
New Contributor I
8 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
0 Kudos
Highlighted
Valued Contributor I
8 Views

It seems that Depth is 7 for 8-bit channels which is kind of weird.
0 Kudos