summaryrefslogtreecommitdiffstats
path: root/libhb/enc_qsv.c
diff options
context:
space:
mode:
authorRodeo <[email protected]>2013-10-22 18:13:45 +0000
committerRodeo <[email protected]>2013-10-22 18:13:45 +0000
commit7efe6f18ae2df34a2d2f2df32a6e3fa0aa798b4c (patch)
tree49aa172a39a6d41b09b0e7a83d9227f2ed24817e /libhb/enc_qsv.c
parent5c2f3ad805987c7404cc676532f025f0d2516930 (diff)
QSV: temporarily work around a bug in the Intel 33.x driver series.
Based on a patch by Maxym Dmytrychenko. Thanks! git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5851 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/enc_qsv.c')
-rw-r--r--libhb/enc_qsv.c22
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)
{