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/common.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/common.c')
-rw-r--r-- | libhb/common.c | 55 |
1 files changed, 42 insertions, 13 deletions
diff --git a/libhb/common.c b/libhb/common.c index 6dbdde75c..3ca5c58b5 100644 --- a/libhb/common.c +++ b/libhb/common.c @@ -215,13 +215,14 @@ hb_encoder_internal_t hb_video_encoders[] = int hb_video_encoders_count = sizeof(hb_video_encoders) / sizeof(hb_video_encoders[0]); static int hb_video_encoder_is_enabled(int encoder) { - switch (encoder) - { #ifdef USE_QSV - case HB_VCODEC_QSV_H264: - return hb_qsv_available(); + if (encoder & HB_VCODEC_QSV_MASK) + { + return hb_qsv_video_encoder_is_enabled(encoder); + } #endif - + switch (encoder) + { // the following encoders are always enabled case HB_VCODEC_X264: case HB_VCODEC_THEORA: @@ -1119,6 +1120,14 @@ const hb_rate_t* hb_audio_bitrate_get_next(const hb_rate_t *last) void hb_video_quality_get_limits(uint32_t codec, float *low, float *high, float *granularity, int *direction) { +#ifdef USE_QSV + if (codec & HB_VCODEC_QSV_MASK) + { + return hb_qsv_video_quality_get_limits(codec, low, high, granularity, + direction); + } +#endif + switch (codec) { case HB_VCODEC_X264: @@ -1151,6 +1160,13 @@ void hb_video_quality_get_limits(uint32_t codec, float *low, float *high, const char* hb_video_quality_get_name(uint32_t codec) { +#ifdef USE_QSV + if (codec & HB_VCODEC_QSV_MASK) + { + return hb_qsv_video_quality_get_name(codec); + } +#endif + switch (codec) { case HB_VCODEC_X264: @@ -1166,16 +1182,18 @@ const char* hb_video_quality_get_name(uint32_t codec) const char* const* hb_video_encoder_get_presets(int encoder) { +#ifdef USE_QSV + if (encoder & HB_VCODEC_QSV_MASK) + { + return hb_qsv_preset_get_names(); + } +#endif + switch (encoder) { case HB_VCODEC_X264: return x264_preset_names; -#ifdef USE_QSV - case HB_VCODEC_QSV_H264: - return hb_qsv_preset_get_names(); -#endif - #ifdef USE_X265 case HB_VCODEC_X265: return x265_preset_names; @@ -1203,10 +1221,16 @@ const char* const* hb_video_encoder_get_tunes(int encoder) const char* const* hb_video_encoder_get_profiles(int encoder) { +#ifdef USE_QSV + if (encoder & HB_VCODEC_QSV_MASK) + { + return hb_qsv_profile_get_names(encoder); + } +#endif + switch (encoder) { case HB_VCODEC_X264: - case HB_VCODEC_QSV_H264: return hb_h264_profile_names; #ifdef USE_X265 @@ -1220,10 +1244,16 @@ const char* const* hb_video_encoder_get_profiles(int encoder) const char* const* hb_video_encoder_get_levels(int encoder) { +#ifdef USE_QSV + if (encoder & HB_VCODEC_QSV_MASK) + { + return hb_qsv_level_get_names(encoder); + } +#endif + switch (encoder) { case HB_VCODEC_X264: - case HB_VCODEC_QSV_H264: return hb_h264_level_names; default: @@ -3050,7 +3080,6 @@ static void job_setup( hb_job_t * job, hb_title_t * title ) #ifdef USE_QSV job->qsv.enc_info.is_init_done = 0; - job->qsv.preset = NULL; job->qsv.async_depth = AV_QSV_ASYNC_DEPTH_DEFAULT; job->qsv.decode = !!(title->video_decode_support & HB_DECODE_SUPPORT_QSV); |