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

Jpeg baseLINE

Boaz_Jelinek
Beginner
1,028 Views

Hi,

I use UIC code sample to compress 8 bit image in jpeg baseline quality=100.
I am usingipp 6.1.
Operation success but when I come to view jpeg result in picnic, decoding result is corrupted image (error decoding message appear).

(see 1.jpg attached file)

Is there any option to debug or watch picnic logs.

10x

0 Kudos
6 Replies
Vladimir_Dudnik
Employee
1,028 Views

Hello,

I can't accessfile, please check if you attached it correctly

Regards,
Vladimir

0 Kudos
Vladimir_Dudnik
Employee
1,028 Views

Well, I see corrupted image. Could you please explain in little bit more details how do you get this image, what UIC application did you use, howhave you built this application, what other parameters you use in addition to quality 100%? What is your source image?

Vladimir

0 Kudos
Boaz_Jelinek
Beginner
1,028 Views
Hi,

I am using "w_ipp-samples_p_7.0.1.041\ipp-samples\image-codecs\uic\src\codec\image\jpeg\enc\src\jpegenc.cpp" code.

I am trying to compress a buffer of 1024x1120 8 bit gray level (buffer is ok, I success toencode to jpeg lossless or jpeg2000 andview it using the picnic).

IPP 6.1and picnic is 7.0 version.

Is there any option to receive decoding error reason?
0 Kudos
Vladimir_Dudnik
Employee
1,028 Views

It seems you use some derivative development on top ofinternal JPEG classes. I would recommend you to useJPEG through UIC interface, the same way as it is in picnic or uic_transcoder_con applications. Take a look at jpeg.cpp file from either picnic or uic_transcoder_con applications, it contain function

IM_ERROR SaveImageJPEG(
CIppImage& image,
PARAMS_JPEG& param,
BaseStreamOutput& out);

which can be used in application like piece of code below:

...
CIppImage image;
CStdFileOutput out; // this can be substituted by CMemBuffOutput if you need encode to memory buffer
...
some code to initialize image and output file stream
...
PARAMS_JPEG params_jpeg;
...

params_jpeg.huffman_opt = <1 - generate optimal huffman tables, 0 - use default huffman tables>;
params_jpeg.nthreads = ;
params_jpeg.point_transform = ;
params_jpeg.predictor = ;
params_jpeg.quality = ;
params_jpeg.restart_interval = <0 - disable restart intervals, 1 - enable restart intervals>;
params_jpeg.sampling = ;
params_jpeg.tmode = ;

imStatus = SaveImageJPEG(image, params_jpeg, out);

This is based in IPP 7.0 samples and might slightly differ with IPP 6.x samples.

Vladimir

0 Kudos
Boaz_Jelinek
Beginner
1,028 Views
Please look at jpegenc.cpp file "CJPEGEncoder::EncodeScanBaseline" method.

It seems that in the while loop, everyiteration that call to

"TransformMCURowBL(pMCUBuf, thread_id);" and"EncodeHuffmanMCURowBL(pMCUBuf);"

work on the same first buffer line area of

"pMCUBuf = m_block_buffer + thread_id * m_numxMCU * m_nblock * DCTSIZE2;"

Am I missing something?
0 Kudos
Vladimir_Dudnik
Employee
1,028 Views
You are right, in JPEG base line encoding mode, pMCUBuf points to internal memory buffer which hold row of MCUs (or several rows in case of enabled threading). At every iteration, the next portion of image data will be read from image buffer, color-converted, subsampled, will be applied forward DCT transform and quantization and finally entropy encoding step will applied.

Vladimir
0 Kudos
Reply