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

PostProcessor needed for H264/Mpeg2/Mpeg4 Decoders in IPP v7.1?

manca1
Beginner
821 Views

Hello,

I am in process of porting our application from IPP v7.0 to v7.1, but I have problems with our/your IPP decoders. We used to configure decoder with params.pPostProcessing = NULL, but now from what I can see, this param is necessary (it is now: params.m_pPostProcessor). When I set it as NULL, I get -995 error (NULL pointer) which from the source of decoder I can see that it checks for a valid m_pPostProcessor. Why's that?

How do we overcome this problem? I tried initializing VideoColorConversion and passing its reference to m_pPostProcessor, but now decoder seems to be not working correctly. I always get the same result, but no valid frames on the output.

Please show me correct workflow of video decoding in IPP v7.1. Documentation is still not updated and it has 7.0 references inside.

Thanks a lot!

0 Kudos
10 Replies
Serguei_S_1
Beginner
821 Views

Hi,

I am going though a similar porting exercise at the moment. Setting PostProcessor pointer to NULL seems to work if corresponding assertions in the Decoder code are removed. Below is the last few lines from TaskSupplier::GetFrameToDisplay.

Not sure if this is correct, but I do manage to get decoded picture in YUV format as a result. (In case of H264 decoder I had to write my own function to extract YUV image because using ippiCopy_8u_C1R no longer worked for whatever reason, causing crash. But that may be a different problem entirely).

Good luck!

    InitColorConverter(pFrame, &data, 0);

    *pVData = m_LastNonCropDecodedFrame;

    pVData->SetDataSize(pVData->GetMappingSize());
    pFrame->setWasOutputted();
    pFrame->setWasDisplayed();


    return true;
}

0 Kudos
Chuck_De_Sylva
Beginner
821 Views

manca1,

Please keep in mind that our encoder/decoders are samples. They are not meant to be production ready examples. Which workflow are you refering to that has not been updated? Siting sources helps on our end.

- Chuck

0 Kudos
Pavel_V_Intel
Employee
821 Views
manca1, Serguei S., umc_video_dec_con sample contains the example of proper usage of post processor. Basically you can just assign VideoProcessing object: VideoProcessing proc; params.m_pPostProcessor = &proc; And it should work as basic copier. Note what internal and external VideoData must have same width, height, bit-depth and color format for successful copy operation. To cope with different color formats (for example) you need to add specific filter to VideoProcessing object: VideoColorConversionParams vccParams; proc.AddFilter(FILTER_COLOR_CONVERTER, (BaseCodecParams*)&vccParams); If you need exactly one filter you can use it directly. Keep in mind what filter must be initialized: VideoColorConversion cc; VideoColorConversionParams vccParams; cc.Init(&vccParams); params.m_pPostProcessor = &cc; For this to work you need to be sure what internal and external VideoData objects are the same except different color format.
0 Kudos
manca1
Beginner
821 Views

Thanks for your answer, but it doesn't work with basic VideoProcessing assigned to postProcessor.

I get the same decoded timestamp (-1) all the time, plus the data size in decoder and DataOut are constant all the time (like they are not consumed by the decoder and decoded), even though the GetFrame() returns success. I am using YV12 to initialize my DataOut. The data that comes in DataIn is also YV12.

Ideas?

0 Kudos
Pavel_V_Intel
Employee
821 Views
Which decoder are you talking about? I don't remember any of them to return YV12 format, they return either YUV420 or YUV422. If your stream encoded with custom color format it should be handled separately. Try to use YUV420 for DataOut.
0 Kudos
manca1
Beginner
821 Views

It used to work with v7.0 decoders. I am talking about mpeg2 and h264. I get the same output from both. YV12 only has swapped chromas and there wasn't a problem with the old version of decoder. Do you suggest I convert swap the chromas back to YUV420 in DataIn and then try it? Well, at least I should've got some sort of picture, but what I am seeing is that Data is not being used by the decoder, it remains the same each time GetFrame() is executed, which is not right.

0 Kudos
Pavel_V_Intel
Employee
821 Views
Is your samples version 7.1.1.013? Can you compile umc_video_dec_con sample and check if it works with your stream?
0 Kudos
manca1
Beginner
821 Views

yes, those are the samples I used. I'll see if I get a chance to test umc_video_dec_con sample today. But anyway, the source code I had worked with IPP v7.0 decoders, with v7.1 it doesn't work.

0 Kudos
manca1
Beginner
821 Views

I still have problems with IPP 7.1.1 MPEG/h264 decoders. UMC sample works fine, but it's using splitter to split out the tracks. I already have raw tracks as buffers assigned to DataIn. This approach worked with IPP 7.0 samples. First time MPEG2 decoder returns -996, but next time it crashes in: umc_mpeg2_dec.cpp @ 1118 line, or here:   ret = m_pPostProcessor->GetFrame(&m_lastDecodedFrame, output);

Any help is greatly appreciated. I used basic VideoProcessing object assigned to VideoDecoderParams (like Pavel mentioned above).

Thanks!

 

0 Kudos
manca1
Beginner
821 Views

I solved it. The VideoProcessor object got deleted when gone out of scope, leaving a NULL pointer in mpeg2_dec.cpp. It tried calling the parent's pure virtual function and that's why it crashed. Once the object is persistent throughout the whole video decoding process it works.

Thanks Pavel for pointing out that I needed a VideoProcessor.

 

0 Kudos
Reply