diff options
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/enc_qsv.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libhb/enc_qsv.c b/libhb/enc_qsv.c index 82ea553c6..b45fe162e 100644 --- a/libhb/enc_qsv.c +++ b/libhb/enc_qsv.c @@ -810,6 +810,18 @@ int encqsvInit(hb_work_object_t *w, hb_job_t *job) return -1; } err = MFXVideoENCODE_Init(session, pv->param.videoParam); +// workaround for the early 15.33.x driver, should be removed later +#define HB_DRIVER_FIX_33 +#ifdef HB_DRIVER_FIX_33 + int la_workaround = 0; + if (err < MFX_ERR_NONE && + pv->param.videoParam->mfx.RateControlMethod == MFX_RATECONTROL_LA) + { + pv->param.videoParam->mfx.RateControlMethod = MFX_RATECONTROL_CBR; + err = MFXVideoENCODE_Init(session, pv->param.videoParam); + la_workaround = 1; + } +#endif if (err < MFX_ERR_NONE) // ignore warnings { hb_error("encqsvInit: MFXVideoENCODE_Init failed (%d)", err); @@ -863,6 +875,16 @@ int encqsvInit(hb_work_object_t *w, hb_job_t *job) return -1; } +#ifdef HB_DRIVER_FIX_33 + if (la_workaround) + { + videoParam.mfx.RateControlMethod = + pv->param.videoParam->mfx.RateControlMethod = MFX_RATECONTROL_LA; + option2->LookAheadDepth = pv->param.codingOption2.LookAheadDepth; + hb_log("encqsvInit: using LookAhead workaround (\"early 33 fix\")"); + } +#endif + // when using system memory, we re-use this same session if (pv->is_sys_mem) { |