How to use h.264 High Profile but disable CABAC and B slices
You can write something like this
mfxExtCodingOption meco, *pmeco = &meco;
memset(0, &mvp, sizeof(mvp));
memset(0, &meco, sizeof(meco));
// Specify AVC high profile
mvp.mfx.CodecId = MFX_CODEC_AVC;
mvp.mfx.CodecProfile = MFX_PROFILE_AVC_HIGH;
// Disable B slices
mvp.mfx.GopRefDist = 1;
// To disable CABAC it is necessary to attach one extended buffer mfxExtCodingOption to video params
meco.CAVLC = 1;
meco.Header.BufferId = MFX_EXTBUFF_CODING_OPTION;
meco.Header.BufferSz = sizeof(meco);
mvp.NumExtParam = 1;
mvp.ExtParam = (mfxExtBuffer **)&pmeco;
// Other parameters have to specified in video params for correct encoder initialization
Hi Gregory,I got it.But should I use meco.CAVLC = MFX_CODINGOPTION_ON instead of meco.CAVLC = 1 ?
Yes, you should use preferably useMFX_CODINGOPTION_ON enum instead.
I'm pretty sure the issue you are facing is due to "EncRequest" structure not having the extended buffer pointer set. Can you please check?
"QueryIOSurf" function will validate the input parameters and write the selected output parameters to the"EncRequest" structure. If the extended buffer pointer has not been set you will get the error you have seen. You can initialize the"EncRequest" structure to point to the same extended buffer as "m_mfxEncParams".
I read your message too fast. I realize now that you get an error when calling"QueryIOSurf", and not"Query". :(
Looking at this again it seems the issue may have to do with the way you initialize "m_mfxEncParams.ExtParam". It needs to be a pointer to pointer as Gregory explained in his code snippet. Also, to make sure you do not loose local data on the stack when you go out of the function scope, please move "mfxExtCodingOptionmeco" storage to the class intead.