- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No problem, I'll log on with my premier account thank you.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page