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

Is it possible to eliminate Reader and Splitter in MPEG2 video decoding cycle?

sherrychai
Beginner
325 Views

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.

MediaData in;
VideoData out;
Status umcRes;


LockInputBuffer(...);


do{
umcRes = GetNextVideoData(&in); <-- insteadof this, simply copy the incoming data to"in"
umcRes = GetFrame(&in, &out);
}while (umcRes = UMC_NOT_ENOUGH_DATA);


UnlockInputBuffer(...);

I'm using IPP 5.1. Thanks!!

0 Kudos
2 Replies
Vladimir_Dudnik
Employee
325 Views
Hello, version 5.1 is about two years old. There were lot of changes since that time. Could you please check your code with IPP 6.0, which the latest available release?
Regards,
Vladimir

0 Kudos
hsunnet
Novice
325 Views
Quoting - sherrychai

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.

MediaData in;
VideoData out;
Status umcRes;


LockInputBuffer(...);


do{
umcRes = GetNextVideoData(&in); <-- insteadof this, simply copy the incoming data to"in"
umcRes = GetFrame(&in, &out);
}while (umcRes = UMC_NOT_ENOUGH_DATA);


UnlockInputBuffer(...);

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

So:

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.

0 Kudos
Reply