diff options
Diffstat (limited to 'libhb/enc_qsv.c')
-rw-r--r-- | libhb/enc_qsv.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/libhb/enc_qsv.c b/libhb/enc_qsv.c index 6e52edb73..27cd378e7 100644 --- a/libhb/enc_qsv.c +++ b/libhb/enc_qsv.c @@ -911,14 +911,16 @@ int encqsvInit(hb_work_object_t *w, hb_job_t *job) memset(option1, 0, sizeof(mfxExtCodingOption)); option1->Header.BufferId = MFX_EXTBUFF_CODING_OPTION; option1->Header.BufferSz = sizeof(mfxExtCodingOption); - videoParam.ExtParam[videoParam.NumExtParam++] = (mfxExtBuffer*)option1; + if (pv->qsv_info->capabilities & HB_QSV_CAP_OPTION1) + { + videoParam.ExtParam[videoParam.NumExtParam++] = (mfxExtBuffer*)option1; + } // introduced in API 1.6 memset(option2, 0, sizeof(mfxExtCodingOption2)); option2->Header.BufferId = MFX_EXTBUFF_CODING_OPTION2; option2->Header.BufferSz = sizeof(mfxExtCodingOption2); - if (pv->qsv_info->capabilities & HB_QSV_CAP_MSDK_API_1_6) + if (pv->qsv_info->capabilities & HB_QSV_CAP_OPTION2) { - // attach to get the final output mfxExtCodingOption2 settings videoParam.ExtParam[videoParam.NumExtParam++] = (mfxExtBuffer*)option2; } err = MFXVideoENCODE_GetVideoParam(session, &videoParam); @@ -1099,10 +1101,16 @@ int encqsvInit(hb_work_object_t *w, hb_job_t *job) videoParam.mfx.FrameInfo.PicStruct); return -1; } - if (option1->CAVLC != MFX_CODINGOPTION_OFF) + if (pv->qsv_info->capabilities & HB_QSV_CAP_OPTION1) { - hb_log("encqsvInit: CAVLC %s", - hb_qsv_codingoption_get_name(option1->CAVLC)); + if (videoParam.mfx.CodecId == MFX_CODEC_AVC) + { + if (option1->CAVLC != MFX_CODINGOPTION_OFF) + { + hb_log("encqsvInit: CAVLC %s", + hb_qsv_codingoption_get_name(option1->CAVLC)); + } + } } if (pv->qsv_info->capabilities & HB_QSV_CAP_OPTION2_EXTBRC) { |