About the FrameType Description.

About the FrameType Description.

Hi :

I have used media sdk as (raw)H264 encoder. As reference munual;s guide, I call the function

mfxStatus MFXVideoENCODE_EncodeFrameAsync(mfxSession session, mfxEncodeCtrl *ctrl, mfxFrameSurface1 *surface, mfxBitstream *bs, mfxSyncPoint *syncp);

to encode.

the output , bs->FrameType would tell me if the frame be I, P or B frame.
But the meaning of output I do not know.

printf("%x \\n",bs->FrameType);

:
FrameType = 42
FrameType = 4
FrameType = 4
FrameType = 42
FrameType = 4
FrameType = 4
FrameType = 42
FrameType = 4
FrameType = 4
FrameType = 42
FrameType = 4
:

In the mfxstructure.h, there are:

MFX_FRAMETYPE_I =0x0001,
MFX_FRAMETYPE_P =0x0002,
MFX_FRAMETYPE_B =0x0004,
MFX_FRAMETYPE_S =0x0008,

MFX_FRAMETYPE_REF =0x0040,
MFX_FRAMETYPE_IDR =0x0080,

Does that hint the encode is ..P B B P B B. .. ??

How should I do, to let the encode be ..I P I P.. or ..I P P P I P P P...

if I set the GOP parameters as

m_mfxEncParams.mfx.GopOptFlag = MFX_GOP_STRICT; // MFX_GOP_CLOSED;
m_mfxEncParams.mfx.GopRefDist = 1;
m_mfxEncParams.mfx.GopPicSize = 2;

that would be

:
FrameType = 42
FrameType = c1
FrameType = 42
FrameType = c1
FrameType = 42
FrameType = c1
FrameType = 42
:
That is I P I P I P...

I do not that is the means of 42( MFX_FRAMETYPE_REF | MFX_FRAMETYPE_P
), why the P frame would be referenced?

and why the I frame is c1, what is the meaning of c?

Is anyone know this mechanism ?

thank you lots.

6 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi

Oh, I have known the defination of noun.

"4" means the frame is dependent on front frame, c = 8 + 3, it is means MFX_FRAMETYPE_IDR.

Is it right ?

Hello Gaiger

In your example you get the following frame types:

42 - REF | P which means that this is P frame which is marked that it can be used for reference
4 - B frame which cannot be used as a reference
c1 - REF | IDR | I means it is an IDR I frame which can be used for reference

P frames are marked as reference frames even in case there are no frames that reference them. This flag just means that it is possible to use a frame as a reference frame, not that it is actually referenced.

Hi Shimansky:

thank you, I just make mistake let the c = 3 | 8, In fact that is 4 | 8

By the way, do you have any strategy comment on GOP for scenarios which is like intel widi ?

Like :

I P I P I P....

I P B P I P B P ...

I P P I ....

I am very insteresting in that.

thank you.

Hello Geiger

No I can't give any recomendations about WiDi scenarios because I don't know any details about this scenario. I can just give you two general observations about it.

In case of transmitting data over connection with errors you would probably want to insert IDR quite often so in case of a transmission error a new IDR starts a new GOP.

B frames generally take less bits so using them allows to encode in less bitrate. But B frames are not available in Baseline profile, your decoder should be able to support at least Main profile.

Hi Shimansky:

thank you.

Login to leave a comment.