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

MJPEG bug ?

jsgoupil
Beginner
291 Views
I'm currently realizing a MJPEG decoder and it looks it doesn't act at all as the other decoders.
I used MPEG4 and H264 and after calling Init, the information about the width and height were filled into VideoDecoderParams.info.clip_info.width|height but the MJPEG doesn't fill the information.
I need them to initialize the output buffer... so for now I use this workaround :

int nchannels;
int precision;
JSS sampling;
JCOLOR color;
CJPEGDecoder* m_dec;
m_dec = new CJPEGDecoder;
m_dec->SetSource((Ipp8u*)p_dataIn.GetDataPointer(),p_dataIn.GetDataSize());
m_dec->ReadHeader(&vdp.info.clip_info.width, &vdp.info.clip_info.height, &nchannels,&color,&sampling,&precision);



Furthermore, GetFrame is supposed to return the next decoded frame. So each time we use GetFrame it supposed to use the next frame.
With MJPEG, the datapointer doesn't seem to be moved to the next frame...
In file codec/jpeg/src/umc_mjpeg_video_decoder.cpp:397 you change the data size here :
in->SetDataSize(nBytesRemains);
But I think you would have to do a MoveDataPointer somewhere instead of modifying the DataSize like that.

So after a GetFrame I need to do something like :
p_dataIn.SetBufferPointer( (Ipp8u*)p_dataIn.GetBufferPointer() + p_dataIn.GetBufferSize() - p_dataIn.GetDataSize(), p_dataIn.GetDataSize());

Do I forget something to prevent the use of these tweaks?

Thank you
0 Kudos
4 Replies
Vladimir_Dudnik
Employee
291 Views

Hello,

did you take a look on simple MJPEG sample in UMC manual? It could help in understanding how to use this codec.

Regards,
Vladimir

0 Kudos
jsgoupil
Beginner
291 Views
Yes I did, I make my test looks like the example... but I dont have any splitter... I just have bitstream. So I removed the splitter...

After the GetFrame, only the m_nDataSize change... the pointer m_pDataPointer doesn't change its position in the file... So the next call of GetFrame it will get the same starting frame.
0 Kudos
Vladimir_Dudnik
Employee
291 Views
That can be the reason. This sample was designed to work with AVI splitter. Good point to consider changes, thank you. Could you also submit your report to Intel Premier Support?
0 Kudos
jsgoupil
Beginner
291 Views
No problem, I'll log on with my premier account thank you.
0 Kudos
Reply