From 36f9e230ba352b4f7fc50e75ed8a2b0789af04e5 Mon Sep 17 00:00:00 2001 From: Rodeo Date: Tue, 24 Sep 2013 22:48:03 +0000 Subject: QSV: ExtBRC/MBBRC and lookahead are mutually exclusive, plus miscelleanous stuff found in testing. Thanks to gmb for pointing it out, and Nina Kurina for pointing out the ExtBRC/AsyncDepth issue. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5808 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- libhb/enc_qsv.c | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) (limited to 'libhb') diff --git a/libhb/enc_qsv.c b/libhb/enc_qsv.c index 337befeca..ae3e9bf90 100644 --- a/libhb/enc_qsv.c +++ b/libhb/enc_qsv.c @@ -619,6 +619,14 @@ int encqsvInit(hb_work_object_t *w, hb_job_t *job) { hb_log("encqsvInit: MFX_RATECONTROL_LA, ignoring VBV"); } + /* + * When LA is used, ExtBRC, MBBRC and RateDistortionOpt are ignored. + * But some drivers ignore them too late and change other settings + * (such as AsyncDepth) based on their values. So disable them here. + */ + pv->param.codingOption2.ExtBRC = MFX_CODINGOPTION_OFF; + pv->param.codingOption2.MBBRC = MFX_CODINGOPTION_OFF; + pv->param.codingOption.RateDistortionOpt = MFX_CODINGOPTION_OFF; } else { @@ -958,18 +966,23 @@ int encqsvInit(hb_work_object_t *w, hb_job_t *job) videoParam.mfx.FrameInfo.PicStruct); return -1; } - hb_log("encqsvInit: CAVLC %s RateDistortionOpt %s", - hb_qsv_codingoption_get_name(option1->CAVLC), - hb_qsv_codingoption_get_name(option1->RateDistortionOpt)); - if (hb_qsv_info->capabilities & HB_QSV_CAP_OPTION2_EXTBRC) - { - hb_log("encqsvInit: ExtBRC %s", - hb_qsv_codingoption_get_name(option2->ExtBRC)); - } - if (hb_qsv_info->capabilities & HB_QSV_CAP_OPTION2_MBBRC) + hb_log("encqsvInit: CAVLC %s", + hb_qsv_codingoption_get_name(option1->CAVLC)); + if (videoParam.mfx.RateControlMethod != MFX_RATECONTROL_LA) { - hb_log("encqsvInit: MBBRC %s", - hb_qsv_codingoption_get_name(option2->MBBRC)); + // LA and ExtBRC, MBBRC, RateDistortionOpt are mutually exclusive + if (hb_qsv_info->capabilities & HB_QSV_CAP_OPTION2_EXTBRC) + { + hb_log("encqsvInit: ExtBRC %s", + hb_qsv_codingoption_get_name(option2->ExtBRC)); + } + if (hb_qsv_info->capabilities & HB_QSV_CAP_OPTION2_MBBRC) + { + hb_log("encqsvInit: MBBRC %s", + hb_qsv_codingoption_get_name(option2->MBBRC)); + } + hb_log("encqsvInit: RateDistortionOpt %s", + hb_qsv_codingoption_get_name(option1->RateDistortionOpt)); } if (hb_qsv_info->capabilities & HB_QSV_CAP_OPTION2_TRELLIS) { -- cgit v1.2.3