diff options
author | agalin89 <[email protected]> | 2020-10-05 19:06:18 +0100 |
---|---|---|
committer | Scott <[email protected]> | 2020-10-10 21:46:52 +0100 |
commit | 1883642eb32a2808924c2ef5db06f105657413f6 (patch) | |
tree | 94e990c6d89fcb92d97da8daeba0c266999c5269 /libhb | |
parent | 68706ad72194801e0c94cd53f19f14fd1d740b05 (diff) |
qsv: multi adapters improvements
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/enc_qsv.c | 11 | ||||
-rw-r--r-- | libhb/qsv_common.c | 48 |
2 files changed, 41 insertions, 18 deletions
diff --git a/libhb/enc_qsv.c b/libhb/enc_qsv.c index 3f5471d3c..fed7bb394 100644 --- a/libhb/enc_qsv.c +++ b/libhb/enc_qsv.c @@ -1104,19 +1104,16 @@ int encqsvInit(hb_work_object_t *w, hb_job_t *job) } hb_dict_free(&options_list); } - +#if !defined(SYS_LINUX) && !defined(SYS_FREEBSD) if (pv->is_sys_mem) { - // select the right hardware implementation based on dx index + // select the right hardware implementation based on dx index if (!job->qsv.ctx->qsv_device) hb_qsv_param_parse_dx_index(pv->job, -1); -#if defined(SYS_LINUX) || defined(SYS_FREEBSD) - mfxIMPL hw_preference = MFX_IMPL_VIA_ANY; -#else - mfxIMPL hw_preference = MFX_IMPL_VIA_D3D11; -#endif + mfxIMPL hw_preference = MFX_IMPL_VIA_D3D11; pv->qsv_info->implementation = hb_qsv_dx_index_to_impl(job->qsv.ctx->dx_index) | hw_preference; } +#endif // reload colorimetry in case values were set in encoder_options if (pv->param.videoSignalInfo.ColourDescriptionPresent) { diff --git a/libhb/qsv_common.c b/libhb/qsv_common.c index 852a8d0a7..34b3fdcc0 100644 --- a/libhb/qsv_common.c +++ b/libhb/qsv_common.c @@ -374,19 +374,25 @@ static int query_capabilities(mfxSession session, mfxVersion version, hb_qsv_inf { info->capabilities |= HB_QSV_CAP_B_REF_PYRAMID; } - if (adapters_info->NumActual > 0) + if (info->codec_id == MFX_CODEC_HEVC && + (qsv_hardware_generation(hb_get_cpu_platform()) >= QSV_G7)) { - if (info->codec_id == MFX_CODEC_HEVC && - ((qsv_hardware_generation(hb_get_cpu_platform()) >= QSV_G7) || - (adapters_info->Adapters[0].Platform.MediaAdapterType == MFX_MEDIA_DISCRETE))) + info->capabilities |= HB_QSV_CAP_LOWPOWER_ENCODE; + } +#if !defined(SYS_LINUX) && !defined(SYS_FREEBSD) + if (info->codec_id == MFX_CODEC_HEVC && + (adapters_info->NumActual > 0)) + { + if (adapters_info->Adapters[0].Platform.MediaAdapterType == MFX_MEDIA_DISCRETE) { info->capabilities |= HB_QSV_CAP_LOWPOWER_ENCODE; } } else { - hb_error("query_capabilities: failed to query adapters"); + hb_error("query_capabilities: adapters_info->NumActual=%d", adapters_info->NumActual); } +#endif } else { @@ -856,11 +862,28 @@ static void log_capabilities(int log_level, uint64_t caps, const char *prefix) void hb_qsv_info_print() { // is QSV available and usable? - hb_log("Intel Quick Sync Video support: %s", - hb_qsv_available() ? "yes": "no"); - if (hb_qsv_available()) { +#if !defined(SYS_LINUX) && !defined(SYS_FREEBSD) + if (qsv_adapters_list && hb_list_count(qsv_adapters_list)) + { + char gpu_list_str[256] = ""; + for (int i = 0; i < hb_list_count(qsv_adapters_list); i++) + { + char value_str[256]; + int *value = hb_list_item(qsv_adapters_list, i); + sprintf(value_str, "%d", *value); + if (i > 0) + strcat(gpu_list_str, ", "); + strcat(gpu_list_str, value_str); + } + hb_log("Intel Quick Sync Video support: yes, gpu list: %s", gpu_list_str); + } + else +#endif + { + hb_log("Intel Quick Sync Video support: yes"); + } // also print the details if (qsv_hardware_version.Version) { @@ -919,6 +942,10 @@ void hb_qsv_info_print() hb_log(" - H.265 encoder: no"); } } + else + { + hb_log("Intel Quick Sync Video support: no"); + } } hb_qsv_info_t* hb_qsv_info_get(int encoder) @@ -1038,8 +1065,7 @@ int hb_qsv_full_path_is_enabled(hb_job_t *job) if(!device_check_completed) { - device_check_succeded = ((hb_d3d11va_device_check() >= 0) - || (hb_dxva2_device_check() == 0)) ? 1 : 0; + device_check_succeded = (hb_d3d11va_device_check() >= 0) ? 1 : 0; device_check_completed = 1; } @@ -1190,7 +1216,7 @@ int hb_qsv_param_parse_dx_index(hb_job_t *job, const int dx_index) return 0; } } - hb_error("hb_qsv_param_parse_dx_index: incorrect qsv device index"); + hb_error("qsv: incorrect qsv device index %d", dx_index); return -1; } |