summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
Diffstat (limited to 'libhb')
-rw-r--r--libhb/enc_qsv.c35
1 files changed, 24 insertions, 11 deletions
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)
{