We initialize the IMSDK decoder and start decoding the frames normally. In the middle of decode, we realize the need to reset the decoder. We reset the decoder by making MFXVideoDECODE_Reset API call. After decoder reset, if we provide the frame sequence PBBPBBIPBB... (Note that the PBBPBB frames in this sequence may have dependency on some frames which provided to decoder before decoder reset call) to the decoder. We want to understand the decoder behaviour for these initial frames in above sequence. Does decoder drop initial P and B frames until it receives the first key frame(I frame in the above sequence) ? If yes, does decoder return an error (as result of MFXVideoDECODE_DecodeFrameAsync call) when decoder drops the frame ? How will application know that the decoder has dropped frames ?
Thanks and Regards, Anita
In general, depending on the encoded elementary bitstream to decoder following is the decoder behavior: After Reset call, the decoder expect new sequence header and will skip any bitstream before encountering the new sequence header. Mean decoder will drop data untill SPS_and _PPS are found. If decoder gets valid headers and P,B frames are just following them in sequence, then decoder will try to decode these frames. But, with no valid references for P and B frames available, the output frames could be corrupted and the corruption flags will be set on the output surface. One way to track dropped frames via application, can be by timestamps which app can set on the input bitstream. Is this sufficient information.
We are using IMSDK H264 and MPEG2 decoders.
Regarding the corruption flags in the output surface, just wanted to confirm if you meant Corrupted enumerator in mfxFrameData structure ?
Are timestamps the only way to track dropped frames ? Will the decoder not return any error (as result of DecodeFrameAsync or SyncOperation call) when frames are dropped ?
Thanks and Regards, Anita
Yes, take a look at list of other corruption enumerator described in detail in Media SDK manual: https://software.intel.com/sites/default/files/managed/47/49/mediasdk-man.pdf, Page no 168, Section Corruption.
Another way, is by application tracking if complete frames are submitted to the decoder and decoder will return "not enough data" error if more data is required. " Will the decoder not return any error (as result of DecodeFrameAsync or SyncOperation call) when frames are dropped ?" -> In this case, no error will be returned and recommend timestamps is the good way to track in this scenario.