msdk: encoder: h265: generalize the behavior of "i-frames" property

We have the property "i-frames" to set the IDR interval in a
gop. Unfortunately MSDK HEVC encoder behaves bit differently
for IdrInterval field, IdrInteval == 1 indicate every
I-frame should be an IDR (which is IdrInterval == 0 for other codecs),
IdrInteval == 2 means every other I-frame is an IDR
(which is IdrInterval == 1 for other codecs) etc.
So we generalize the behaviour of property "i-frames" by
incrementing the value by one in each case (only for HEVC).

https://bugzilla.gnome.org/show_bug.cgi?id=791637
This commit is contained in:
Sreerenj Balachandran 2018-02-14 14:29:57 +00:00
parent fa0911c3f6
commit a165a1a1a9

View file

@ -91,6 +91,13 @@ gst_msdkh265enc_configure (GstMsdkEnc * encoder)
encoder->param.mfx.CodecId = MFX_CODEC_HEVC; encoder->param.mfx.CodecId = MFX_CODEC_HEVC;
encoder->param.mfx.CodecProfile = MFX_PROFILE_HEVC_MAIN; encoder->param.mfx.CodecProfile = MFX_PROFILE_HEVC_MAIN;
/* IdrInterval field of MediaSDK HEVC encoder behaves differently
* than other encoders. IdrInteval == 1 indicate every
* I-frame should be an IDR, IdrInteval == 2 means every other
* I-frame is an IDR etc. So we generalize the behaviour of property
* "i-frames" by incrementing the value by one in each case*/
encoder->param.mfx.IdrInterval += 1;
return TRUE; return TRUE;
} }