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

UIC PNG Question

Aris_Basic
New Contributor I
335 Views
Does PNG encoder support signed 16bit data ?
im looking at the code and i see this section
else if(iPrecision <= 16)
{
if(iFormat == IF_UNSIGNED)
imageCn.ColorSpec().DataRange().SetAsRange16u(IPP_MAX_16U);
else if(iFormat == IF_FIXED)
imageCn.ColorSpec().DataRange().SetAsRange16s(IPP_MIN_16S, IPP_MAX_16S);
else
imageCn.ColorSpec().DataRange().SetAsRange16f(IPP_MAX_16U);
}
what si IF_FIXED used for (dont see anything in documentation) ??
why isnt there iFormat == IF_FIXED || iFormat == IF_SIGNED ??
with current code DataType gets set to T16f and AttacheImage function that format produces error.
seems like only T8u and T16u are supported. Why not throw error earlier in that case ?
i tryed adding T16s and IF_SIGNED however in case of T16s BitDepth is being returned as 14 (+1)
and passing 15 to png_set_IHDR throws an error in PNG codec (unsupported bithdepth [only 8 and 16 bit are support] )
is this a bug in UIC implementation or is this how it supposed to work ??
Thx
0 Kudos
4 Replies
PaulF_IntelCorp
Employee
335 Views
Hello Aris,

Will have to get back to you on this one.

Paul
0 Kudos
Pavel_V_Intel
Employee
335 Views
Good day.
Generally PNG doesn't support 16s. In fact you can encode 16s image but your decoder must know what image pixels actually in signed format, because PNG stream doesn't contain such information.
0 Kudos
Aris_Basic
New Contributor I
335 Views
i think UIC codec should then return error earlier in the process so it can be handled and recognized properly.
what do you think ? (maybe at the time of deciding the pixdata range to return some IE_UNSUPPORTED_FORMAT or something like that ? )
0 Kudos
Mikhail_Kulikov__Int
New Contributor I
335 Views

Hi Aris,

regarding the "transcoder" sample, currently it's only some kind of example rather than complete transcoding solution and it relies that particular component returns status of error.

But you are right, there is no complete check of correspondence of data formats and particular codecs, it might be obtained only from deep diving into docs and sources. From my point of view the best thing for complete transcoder would be some kind of table that contains correspondence of data formats and particular codecs, but sorry, it's still not implemented in transcoder.

Regarding remarkable data range representation. BitDepth() is intended to represent amount of required mantissa bits minus 1 and IsSigned() returns sign capability. That's why for full-range 16s BitDepth() returns 14.Such a representation covers well mostly all of data format that are currently used for i/o raster data in codecs. Generally it reffers to JPEG 2000 coding system as example of such a representation, even now it's probably the most wide format in the codecs.
Absolutely agree, it might be not the most intuitive for some cases, but that's a matter of existed compromise among many different data formats.

Thank You,

Mikhail

0 Kudos
Reply