Media (Intel® oneAPI Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools from Intel. This includes Intel® oneAPI Video Processing Library and Intel® Media SDK.
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.

Is "NumRefFrame" must be even number?


hi,I am using MSDK to encode my yuv data.

If I set "NumRefFrame" in mfxVideoParam struct to 3,I will get "MFX_WRN_INCOMPATIBLE_VIDEO_PARAM" when exectue "m_pmfxENC->Init()".After "m_pmfxENC->Init()",I called MFXVideoENCODE_GetVideoParam() with a mfxVideoParam struct,to check the parameters that I have set,I found the "NumRefFrame" changed to 4 automatically.Then I check the output stream,"num_ref_frames" in the SPS is 4.This result is under MFX_IMPL_HARDWARE mode.

if I set "NumRefFrame" in mfxVideoParam struct to 5,"num_ref_frames" of the SPS in the ouput stream is 6.This result is also under MFX_IMPL_HARDWARE mode.

And when I use MFX_IMPL_SOFTWARE mode,when I set "NumRefFrame" to 3,then "num_ref_frames" in the SPS of the output stream is 3,and there is no "MFX_WRN_INCOMPATIBLE_VIDEO_PARAM".

That is to say,under MFX_IMPL_SOFTWARE mode,I could got the output stream that i want,and under MFX_IMPL_HARDWARE mode,the reference frame number changed to even number automatically.
Now,I want to use MFX_IMPL_HARDWARE mode,and get a output stream of reference frame number is 3.
Could anyone tell me how to set the encoding parameters so that the reference number of the output stream could be 3(odd number) under hardware mode?

Thanks in advance.

0 Kudos
2 Replies
Hi, Yes, you have encountered a known HW encoder limitation. The current HW encoder cannot produce streams with odd number of reference frames. We are sorry for this inconvenience and we are working on addressing this in future platform releases. Regards, Petter
Hi,Petter Thanks for your kindly reply,and hope Intel could fix this limitation in the near future. Regards. Wei Liang