Intel® Integrated Performance Primitives
Community support and discussions relating to developing high-performance vision, signal, security, and storage applications.
6633 Discussions

Ipp Jpeg conversion gets a lot of dirty gray fields i picture



Running Ipp version and Mpeg4 and H264 works well, but Jpeg gets a lot of dirty fields in picture.

Here are two sample picture, original jpg and resulting dib as 24bit result. The gray fields vary all the time on each frame. You can see that the picture is intact behind these fields.

These are 2 megapixel picture and it looks a little different with smaller pictures. Then sometimes there is a full frame ok and these gray areas in between all the time.

Using Ipp dll:s and C++/CLI as platform.

Strange since Mpeg4 and H264 is handles the same way in our code, and that implies nothing too wrong there.

UMC::MJPEGVideoDecoder() class i used.

MediaData initialized like this:

UMC::MediaData frame;

frame.SetBufferPointer((Ipp8u*)pcPacket, dwPacketLen);


//Tried setting frametyp NONE_PICTURE or VIDEO_FRAME, neither works

// frame.SetFrameType(UMC::FrameType::::NONE_PICTURE);// UMC::FrameType::NONE_PICTURE

// frame.SetFrameType(UMC::VIDEO_FRAME);// UMC::FrameType::NONE_PICTURE

frame.SetTime(-1, -1);

UMC::VideoDecoderParams VDecParams;

VDecParams.m_pData = &frame;

GetResolution(pcPacket, dwPacketLen, &, &; = UMC::RGB24; = 0; = 1; = 1; = 0.0; = 1; = UMC::PROGRESSIVE; = UMC::MJPEG_VIDEO; = UMC::UNDEF_VIDEO_SUBTYPE; = 0;

VDecParams.lFlags = 0; //

VDecParams.numThreads = 1;

VDecParams.pPostProcessing = NULL;

if(UMC::UMC_OK == umcRes)


umcRes = m_pVideoDecoder->Init(&VDecParams);


if(UMC::UMC_OK == umcRes) {

umcRes = m_outData.Init(,, UMC::RGB24, DEFAULT_BITDEPTH);

umcRes = m_outData.SetPlanePointer(m_pBits, 0);


//Then decoded

m_inData.SetBufferPointer((Ipp8u*)pcPacket, dwPacketLen);


m_inData.SetTime(-1, -1);

umcRes = m_pVideoDecoder->GetFrame(&m_inDat a, &m_outData);

I don't know what else might be needed?

Would be much obliged for any advice!!!

Best regards


0 Kudos
4 Replies

We've used the ijl15 for ever and thought since doing Mpeg4 and H264 decoding in ipp we could throw ijl15 out, and use ipp 5.3 for everything.

Is it possible to get some help on this?

If any info is missing I'll be glad to supply it.

Really in need here.



Hello Lars,

seems your Motion JPEG input is not an AVI file?

In that case I would recommend you to integrate IPP JPEG decoder from JPEGView sample. The codec in UMC is oriented on UMC infrastructure so when you do not use that (AVI splitter, FileReader and so on) it is better to use simple code.



Many thanks for your suggestion, Vladimir.

Yes, we only use source from memory buffer and produce result as a dib i mem too. All drawing on screen fromown code.

Will have a closer look on the sample you mentioned.

Would the Mpeg4, H264 also gain from looking at other than UMC-based samples, maybe?

Thinking of performance aso.

Much obliged, thanks.



OK, there are a little details onIPP JPEG decoder in IPP 5.3 provide simple API, so usage is simple. Basically youneed to doseveral steps:

1. Instantiate CJPEGDecoder object
2. Instantiate CMemBuffInput object and attach your input memory buffer with Open method
3. Attach CMemBuffInput object to CJPEGDecoder with SetSource method
4. Get compressed JPEG image parameters with ReadHeader method
5. Decide desired output image parameters (like sampling, color space, DCT downsampling), allocate output memory buffer depending on image size and specify all these parameters with SetDestination method
6. call ReadData method to do actual decoding JPEG data from input memory buffer to output memory buffer

Note, if your input JPEGcompressed with4:2:2 subsampling you may skip color convertion and upsampling steps and get output in YUY2 format directly, which is faster. To do that you need to specify output color JC_YCBCR and output sampling JS_422

Also note that IPP JPEG decoder is threaded with OpenMP API. The sample's build script does enable threading by default. If you port this into MSVC project you may swant to et 'enable OpenMP' option in project settings to utilize codec threading capabilities.

And finally, in IPP 6.0 beta we introduced newC++ API for image codecs, called as UIC (unified image codec), which simplify and unify access to different image formats. Currently BMP, PNM, JPEG, JPEG2000 and DICOM are supported. You can add support for your own format by developing derived classes.