Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Aris_Basic
New Contributor I
31 Views

UIC::J2k Questions

Couple more questions regarding jpeg2000 codec with UIC.
are there any limitations ?
I saw it assumes RGB in case of 3 channel image (i changed it so it properly uses YBR if image is such
but it doesnt look like that information was used (cretion of jpeg2000 stream not jp2) [maybe i havnt tracked it down] ) (compression finishes fine im just wondering is it maybe keeping wrong info within image)
noticed that compressed image created with UIC:J2K is 50% larger then same image compressed with another
j2k codec (in both case lossless with 5 layers), what would be a reason for that ?
Thx
0 Kudos
7 Replies
Vladimir_Dudnik
Employee
31 Views

Hi Aris,

yes, there some limitation in our implementation of JPEG2000 codec. I'll ask expert to provide more infromation on that.

Regards,
Vladimir
Aris_Basic
New Contributor I
31 Views

i also noticed that UIC:J2k codec doesnt directly support plannar images
(passing a planar image codec still assumes interleaved image was passed in)
(i think im seeing sme issues with jpeg codec aswell, i guess ther eis no way to get a YBR image from JPEG
output is always RGB)
Mikhail_Kulikov__Int
New Contributor I
31 Views

Hi Aris,

both JPEG 2000 encoder and decoder components supports ONLY planar raster data on output/input.

E.g. for decoder (\common\src\codestream\tile\dpostprocess.h)

void LevShiftRCTInv(const ImageCoreC *srcDst, const RectSize &size, const JP2BitsPerComp *bitsPerComp)
{
unsigned int width = size.Width();
unsigned int height = size.Height();
RowIterator rowCh0 = srcDst[0];
RowIterator rowCh1 = srcDst[1];
RowIterator rowCh2 = srcDst[2];

for(unsigned int y = 0; y < height; y++, ++rowCh0, ++rowCh1, ++rowCh2)
...

or encoder (\common\src\codestream\tile\epreprocess.h)

template
void LevShiftRCTFwd(const ImageCoreC *srcDst, const RectSize &size, const JP2BitsPerComp *bitsPerComp)
{
unsigned int width = size.Width();
unsigned int height = size.Height();
RowIterator rowCh0 = srcDst[0];
RowIterator rowCh1 = srcDst[1];
RowIterator rowCh2 = srcDst[2];

for(unsigned int y = 0; y < height; y++, ++rowCh0, ++rowCh1, ++rowCh2)

...

Could you specify a place of code which plunge you into doubts?

Aris_Basic
New Contributor I
31 Views

I do understand the fact that codec uses planar data internally
however if i pass to a SaveImageJPEG2000 function a already planar image there is no need for conversion
this is what i added to jpeg2k.cpp around line 1260
to avoid extraction of planes for interleaved image
case 3:
{
if (image.ComponentOrder())
{
if (image.Precision() <= 8)
{
ippiConvert_8u32s_C1R(image.DataPtr(),image.Step()/3,imagePn.Buffer().DataPtr()[0].p32s,dataOrder.LineStep()[0],roi);
ippiConvert_8u32s_C1R(image.DataPtr()+(image.Step()/3*roi.height),image.Step()/3,imagePn.Buffer().DataPtr()[1].p32s,dataOrder.LineStep()[1],roi);
ippiConvert_8u32s_C1R(image.DataPtr()+(image.Step()/3*2*roi.height),image.Step()/3,imagePn.Buffer().DataPtr()[2].p32s,dataOrder.LineStep()[2],roi);
}
else
{
ippiConvert_16u32s_C1R((Ipp16u*)image.DataPtr(),image.Step(),imagePn.Buffer().DataPtr()[0].p32s,dataOrder.LineStep()[0],roi);
ippiConvert_16u32s_C1R((Ipp16u*)image.DataPtr()+(image.Step()*roi.height),image.Step(),imagePn.Buffer().DataPtr()[1].p32s,dataOrder.LineStep()[1],roi);
ippiConvert_16u32s_C1R((Ipp16u*)image.DataPtr()+(image.Step()*2*roi.height),image.Step(),imagePn.Buffer().DataPtr()[2].p32s,dataOrder.LineStep()[2],roi);
}
break;
}
sz.height = 1;
sz.width = roi.width;
Ipp32s* p[3];
the code after does creation of planes (which is not neccessery in this case)
so i added just these conversions to Ipp32s*
(might not be the best way :( )
Mikhail_Kulikov__Int
New Contributor I
31 Views


Aris,

UIC JPEG2000 codec works with planar data both externally and internally.
Codeyou are quotedis actually from picnic (and so called "trancoder" sample). Initially it was developed mostly around displaying images in picnic (and previously in JPEGView sample), and just mostly copy/paste to transcoder, that's why its architecture everywhere turn around interleaved data format. It's not UIC component. You are trying to patch this code, butit's just a sample and it might be better to design a generic code for really universal trascoding (as I already mentioned somewhere here). Sorry, we still didn't do it...

Mikhail

Aris_Basic
New Contributor I
31 Views

yeah you right
any plans on creating more feature full generic implementation of J2K (and JPEG) compression ?
cuase yeah i interface with UIC through the picnic or transcode sample :(
Mikhail_Kulikov__Int
New Contributor I
31 Views

It'sreasonable approach: first priority isfixing bugs in UIC (in order: core/components/samples), than new features and new samples.
If you have distinct feature request it's alwaysthe best way tosubmit and trackit through your Intel product support account.