Hi, I'm trying to use IPP Mpeg2 decoder in my project, in which I have a demux already -- all I need from IPP is the decoded video data, so I can send it to other components of my project. I basically followed the example I found in the UMC documentation, except that I remove the FileReader and Mpeg2Splitter. I have my original demux feed the IPP decoder PES data (PES header removed already, so basically the incoming data is ES video) portion by portion, and in the IPP code, whenver there's a GetNextVideoData(&in), which is a function performed by the Splitter, I simply copy the incoming data to a temp buffer, and change the buffer and data pointers of "in" (type MediaData) to point to that data. Everything else follows exactly as the example in the UMC decumentaion.
Now unfortunately, the decoded result is not right... it looks corrupted and messy. So my question is, can I remove the FileReader and Splitter and simply feed my data to a MediaData object ("in") and use that to decode? ie.
umcRes = GetNextVideoData(&in); <-- insteadof this, simply copy the incoming data to"in"
umcRes = GetFrame(&in, &out);
}while (umcRes = UMC_NOT_ENOUGH_DATA);
I'm using IPP 5.1. Thanks!!
As you already have encoded bit stream, what you need to do is to call corresponding decoder directly.
This is basically what I did to decode H.264 bit stream (no spliter, no reader, etc, just the pure H.264 bit stream buffer from extracted RTSP streaming or MPEG2 TS multicasting):
1: initialize the H.264 decoder (UMC::H264VideoDecoder), setup VideoStreamInfo and then VideoDecoderParams.
2: set UMC::MediaDataEx for input stream and UMC::VideoData for output raw data.
3: do the decoding frame by frame (which is a loop):
ret = m_decoder.GetFrame(&m_inEncodedVideoBuffer, &m_outRawVideo);
check if the ret is UMC_ERR_NOT_ENOUGH_DATA or UMC_O
1: You don't need Lock or unLock input buffer, that is used forsychrionzation purpose when multiple threads accessing same data buffer in AVSync class.
2: This decoding process works for 5.1, 5.2, 5.3 and 6.0. But you have to make corresponding changes (such as namespace changes, FLAG name removed, class name changed, which will eventually take you a few days +....) when update to next version. So personally I think it is wise to stay in same version as long as you are satisfied with the result.