From 1572b921587434e2363cc94502cde97ad6279536 Mon Sep 17 00:00:00 2001 From: Rodeo Date: Sat, 27 Jun 2015 22:10:00 +0000 Subject: QSV: add new capability guards for some extended video parameter buffers. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7326 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- libhb/enc_qsv.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'libhb/enc_qsv.c') 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) { -- cgit v1.2.3