diff options
author | Rodeo <[email protected]> | 2014-02-18 17:14:14 +0000 |
---|---|---|
committer | Rodeo <[email protected]> | 2014-02-18 17:14:14 +0000 |
commit | 681bdf52d5d2a9339c02c7a2b07358dc383681ec (patch) | |
tree | c9e8a5b5d5ed3547ec5b5b06e2ca3a807838df0a /libhb/decavcodec.c | |
parent | b3e905dde9dacd4129c05440cedbe5a1366d0243 (diff) |
QSV: API 1.8 support and related improvements
Optional feature detection now done via MFXVideoENCODE_Query. This should work better with future hardware and encoder implementations.
Optional API 1.8 features are not tested (not supported by the software implementation, and no drivers with API 1.8 support available yet).
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6041 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/decavcodec.c')
-rw-r--r-- | libhb/decavcodec.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/libhb/decavcodec.c b/libhb/decavcodec.c index c158bcf1b..410283e4f 100644 --- a/libhb/decavcodec.c +++ b/libhb/decavcodec.c @@ -1518,20 +1518,25 @@ static int decavcodecvInit( hb_work_object_t * w, hb_job_t * job ) #ifdef USE_QSV if (hb_qsv_decode_is_enabled(job)) { - // setup the QSV configuration - pv->qsv.config.io_pattern = MFX_IOPATTERN_OUT_OPAQUE_MEMORY; - pv->qsv.config.impl_requested = hb_qsv_impl_get_preferred(); - pv->qsv.config.async_depth = job->qsv.async_depth; - pv->qsv.config.sync_need = 0; - pv->qsv.config.usage_threaded = 1; - pv->qsv.config.additional_buffers = 64; // FIFO_LARGE - if (hb_qsv_info->capabilities & HB_QSV_CAP_OPTION2_LOOKAHEAD) - { - // more surfaces may be needed for the lookahead - pv->qsv.config.additional_buffers = 160; - } - pv->qsv.codec_name = hb_qsv_decode_get_codec_name(w->codec_param); - pv->qsv.decode = 1; + // determine which encoder we're using + hb_qsv_info_t *info = hb_qsv_info_get(job->vcodec); + pv->qsv.decode = info != NULL; + if (pv->qsv.decode) + { + // setup the QSV configuration + pv->qsv.config.io_pattern = MFX_IOPATTERN_OUT_OPAQUE_MEMORY; + pv->qsv.config.impl_requested = info->implementation; + pv->qsv.config.async_depth = job->qsv.async_depth; + pv->qsv.config.sync_need = 0; + pv->qsv.config.usage_threaded = 1; + pv->qsv.config.additional_buffers = 64; // FIFO_LARGE + if (info->capabilities & HB_QSV_CAP_RATECONTROL_LA) + { + // more surfaces may be needed for the lookahead + pv->qsv.config.additional_buffers = 160; + } + pv->qsv.codec_name = hb_qsv_decode_get_codec_name(w->codec_param); + } } else { |