I am trying to make lossless compression ofgrayscale 8 to 16 bitimages.
I set the restart interval to theimage width value so ippiDiffPredFirstRow_JPEG_16s_C1 done for all rows.
Problem is that for image with presicion > 8 compression result is distorted in a way that look like one line crash another.
In case I change logic so ippiDiffPredRow_JPEG_16s_C1 will done for all rows (except the first line) than distortion not occur but pixel valus overlapping occur.
What version of IPP and sample package do you use? Have you tried IPP UIC sample to see if the problem can be reproduced with UIC picnic application or uic_transcoder_con application?
Thanks for your update. I can't see the first image but there is no problem with the rest. Could you please also describe what steps did you take running picnic application. (I'm looking for the way for us to reproduce the problem quickly). So, we need to know exact parameters applyied for UIC JPEG compression
Thanks, could you please also describe in steps how do you compress your image with picnic application. I'm lookiing for something like this:
1. Open source image (is that available in your attachment in forum post?) through FileOpen dialog
2. Set compression options (which exactly?) through View\Options dialog. Note, this is most important section, so we can check issue following exactly your steps.
3. Store image with SaveAs dialog (what is corresponding file name in your attachment?)
1. See 985bd046-26fe-475d-aaf4-9c210ecdf03c.dcm attached file
2. Bit per pixel - 16
Image width - 1536, image height - 1536(same values set on IppiSize roi)
m_mcuWidth = 1;
m_mcuHeight = 1;
m_numxMCU = (1536 + (m_mcuWidth - 1)) / m_mcuWidth;
m_numyMCU = (1536 + (mcuHeight - 1)) / m_mcuHeight;
m_jpeg_restart_interval = 1536 (or0)
m_restarts_to_go = m_jpeg_restart_interval
predictor - 1
Step - 1536*sizeof(Ipp16s)
3. Gray, 444, LSL, restart interval checked and use optimal huffman table.
Anyhow duplicating problem occur for images withbit per pixel> 8
Yes, this file open correctlly using Osirisand Rubo viewer.
Try attached file 16bit_Comppressed_to_Jpeg_Lossless_using_Osiris.dcm
Comppressedjpeg DICOM image that done by osiris is displayed correctlly in the osiris and in Rubo viewer but the picnic fail.
i think i found the problem. In file jpeg.cpp in function ReadImageJPEG() change line #251 from
dataOrder.LineStep()  = ((geometry.RefGridRect().Width() * nOfComponents + 3) & ~3);
dataOrder.LineStep()  = ((geometry.RefGridRect().Width() * nOfComponents * du + 3) & ~3);
Please write here if this changes help to resolve you issue or not.
i also attach jpeg.cpp file itself with this changes.