member "FrameType" in mfxEncodeCtrl Structure

member "FrameType" in mfxEncodeCtrl Structure

Joyah's picture

Hi there,
I have some questions about the mfxEncodeCtrl Structrue.

The reference manual says that the member "FrameType" is just short for "Encoding frame type".
Is that a field for write or read? If for write,that means I can (or must) specify the type of every frame by myself? or just to enforce the frame type change when I need?

Other way, if for read,couldI know what frame type the current frame is? where should I got current frame type if not?

Questions seem unsystematic, butappreciate for any device.
Thanks,
Joyah

- "What hurts more, the pain of hard work, or the pain of regret?"
4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Tony Pabon (Intel)'s picture

Hi Joyah,

Your application is expected to fillthis field with the desired frametype. Providing the structure to the MFXVideoENCODE_EncodeFrameAsync() call is optional, and you only need to provide the structure if you want to overwrite the general encoding parameters that have been setup for the session.

In the MSDK 2012 R2 Reference manual, please look at the description for MFXVideoENCODE_EncodeFrameAsync call, as wellasthe structure definition.

"In the case of encoded ordering the mfxEncodeCtrl structure must specify the explicit frame type. In the case of display ordering, this function handles frame order shuffling according to the GOP structure parameters specified during initialization."

and

"If the encoder works in the encoded order, the application must specify the frame type. If the encoder works in the display order, only key frames are enforceable."

In other words, if you do not have a reason to overwrite the encoding parameters, provide a NULL instead of the mfxEncodeCtrl sturcture to the MFXVideoENCODE_EncodeFrameAsync call.

-Tony

-Tony
Joyah's picture

Hi Tony,
Thanks for your answer. There's still one question, that how to get the current frame type (I, P or B)?
Regards,
Joyah

- "What hurts more, the pain of hard work, or the pain of regret?"
Tony Pabon (Intel)'s picture

Hi Joyah,

When encoding is configured and a GOP pattern is specified, the frames will be encoded with the pattern unless 'pre-frame' mfxEncodeCtrl is used to overwrite the pattern. Your application could keep track of frames being encoded and known the frametype for each encode request.

If you know the frame number, and the GOP pattern paramters, you can use an algorithm like the one shown in the MSDK Reference Manual in the section desribing the mfxInfoMFX sturcture (Example 11).

-Tony

-Tony

Login to leave a comment.