diff options
author | maxd <[email protected]> | 2017-02-28 18:15:00 +0100 |
---|---|---|
committer | Bradley Sepos <[email protected]> | 2017-03-05 12:06:11 -0500 |
commit | 5bc08b968edd71c54e1b2d42293cd58679998c7d (patch) | |
tree | 7115952c0426d6b94a61732e931ea07d4ffeb881 | |
parent | deab9883d583442003cfcbc1d7cec900c280c8c6 (diff) |
qsv: added HEVC 10-bit as encoder, should help for GUI integration
-rw-r--r-- | libhb/common.c | 4 | ||||
-rw-r--r-- | libhb/common.h | 7 | ||||
-rw-r--r-- | libhb/muxavformat.c | 1 | ||||
-rw-r--r-- | libhb/qsv_common.c | 18 | ||||
-rw-r--r-- | libhb/work.c | 3 |
5 files changed, 27 insertions, 6 deletions
diff --git a/libhb/common.c b/libhb/common.c index 043205d0a..8d7cc7fd9 100644 --- a/libhb/common.c +++ b/libhb/common.c @@ -241,6 +241,7 @@ hb_encoder_internal_t hb_video_encoders[] = { { "H.265 12-bit (x265)", "x265_12bit", "H.265 12-bit (libx265)", HB_VCODEC_X265_12BIT, HB_MUX_AV_MP4|HB_MUX_AV_MKV, }, NULL, 1, HB_GID_VCODEC_H265, }, { { "H.265 16-bit (x265)", "x265_16bit", "H.265 16-bit (libx265)", HB_VCODEC_X265_16BIT, HB_MUX_AV_MP4|HB_MUX_AV_MKV, }, NULL, 1, HB_GID_VCODEC_H265, }, { { "H.265 (Intel QSV)", "qsv_h265", "H.265 (Intel Media SDK)", HB_VCODEC_QSV_H265, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 1, HB_GID_VCODEC_H265, }, + { { "H.265 10-bit (Intel QSV)", "qsv_h265_10bit", "H.265 10-bit (Intel Media SDK)", HB_VCODEC_QSV_H265_10BIT, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 1, HB_GID_VCODEC_H265, }, { { "MPEG-4", "mpeg4", "MPEG-4 (libavcodec)", HB_VCODEC_FFMPEG_MPEG4, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 1, HB_GID_VCODEC_MPEG4, }, { { "MPEG-2", "mpeg2", "MPEG-2 (libavcodec)", HB_VCODEC_FFMPEG_MPEG2, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 1, HB_GID_VCODEC_MPEG2, }, { { "VP8", "VP8", "VP8 (libvpx)", HB_VCODEC_FFMPEG_VP8, HB_MUX_MASK_MKV, }, NULL, 1, HB_GID_VCODEC_VP8, }, @@ -1370,6 +1371,9 @@ int hb_video_encoder_get_depth(int encoder) { switch (encoder) { +#ifdef USE_QSV + case HB_VCODEC_QSV_H265_10BIT: +#endif case HB_VCODEC_X264_10BIT: case HB_VCODEC_X265_10BIT: return 10; diff --git a/libhb/common.h b/libhb/common.h index 4d7c548b3..dc7ebb3ea 100644 --- a/libhb/common.h +++ b/libhb/common.h @@ -504,7 +504,10 @@ struct hb_job_s #define HB_VCODEC_FFMPEG_VP9 0x0000080 #define HB_VCODEC_FFMPEG_MASK 0x00000F0 #define HB_VCODEC_QSV_H264 0x0000100 -#define HB_VCODEC_QSV_H265 0x0000200 +#define HB_VCODEC_QSV_H265_8BIT 0x0000200 +#define HB_VCODEC_QSV_H265_10BIT 0x0000400 +#define HB_VCODEC_QSV_H265_MASK 0x0000600 +#define HB_VCODEC_QSV_H265 HB_VCODEC_QSV_H265_8BIT #define HB_VCODEC_QSV_MASK 0x0000F00 #define HB_VCODEC_X264_8BIT 0x0010000 #define HB_VCODEC_X264 HB_VCODEC_X264_8BIT @@ -517,7 +520,7 @@ struct hb_job_s #define HB_VCODEC_X265_12BIT 0x0004000 #define HB_VCODEC_X265_16BIT 0x0008000 #define HB_VCODEC_X265_MASK 0x000F000 -#define HB_VCODEC_H265_MASK (HB_VCODEC_X265_MASK|HB_VCODEC_QSV_H265) +#define HB_VCODEC_H265_MASK (HB_VCODEC_X265_MASK|HB_VCODEC_QSV_H265_MASK) /* define an invalid CQ value compatible with all CQ-capable codecs */ #define HB_INVALID_VIDEO_QUALITY (-1000.) diff --git a/libhb/muxavformat.c b/libhb/muxavformat.c index 6c56f8a5f..2982ab7d3 100644 --- a/libhb/muxavformat.c +++ b/libhb/muxavformat.c @@ -330,6 +330,7 @@ static int avformatInit( hb_mux_object_t * m ) case HB_VCODEC_X265_12BIT: case HB_VCODEC_X265_16BIT: case HB_VCODEC_QSV_H265: + case HB_VCODEC_QSV_H265_10BIT: track->st->codecpar->codec_id = AV_CODEC_ID_HEVC; if (job->config.h265.headers_length > 0) diff --git a/libhb/qsv_common.c b/libhb/qsv_common.c index cef199092..6ce6be983 100644 --- a/libhb/qsv_common.c +++ b/libhb/qsv_common.c @@ -148,7 +148,8 @@ static int qsv_implementation_is_hardware(mfxIMPL implementation) int hb_qsv_available() { return ((hb_qsv_video_encoder_is_enabled(HB_VCODEC_QSV_H264) ? HB_VCODEC_QSV_H264 : 0) | - (hb_qsv_video_encoder_is_enabled(HB_VCODEC_QSV_H265) ? HB_VCODEC_QSV_H265 : 0)); + (hb_qsv_video_encoder_is_enabled(HB_VCODEC_QSV_H265) ? HB_VCODEC_QSV_H265 : 0) | + (hb_qsv_video_encoder_is_enabled(HB_VCODEC_QSV_H265_10BIT) ? HB_VCODEC_QSV_H265_10BIT : 0)); } int hb_qsv_video_encoder_is_enabled(int encoder) @@ -157,6 +158,9 @@ int hb_qsv_video_encoder_is_enabled(int encoder) { case HB_VCODEC_QSV_H264: return hb_qsv_info_avc != NULL && hb_qsv_info_avc->available; + case HB_VCODEC_QSV_H265_10BIT: + if (qsv_hardware_generation(hb_get_cpu_platform()) < QSV_G6) + return 0; case HB_VCODEC_QSV_H265: return hb_qsv_info_hevc != NULL && hb_qsv_info_hevc->available; default: @@ -811,7 +815,7 @@ void hb_qsv_info_print() } if (hb_qsv_info_hevc != NULL && hb_qsv_info_hevc->available) { - hb_log(" - H.265 encoder: yes"); + hb_log(" - H.265 encoder: yes (8bit: yes, 10bit: %s)", (qsv_hardware_generation(hb_get_cpu_platform()) < QSV_G6) ? "no" : "yes" ); hb_log(" - preferred implementation: %s", hb_qsv_impl_get_name(hb_qsv_info_hevc->implementation)); if (qsv_hardware_info_hevc.available) @@ -838,6 +842,7 @@ hb_qsv_info_t* hb_qsv_info_get(int encoder) { case HB_VCODEC_QSV_H264: return hb_qsv_info_avc; + case HB_VCODEC_QSV_H265_10BIT: case HB_VCODEC_QSV_H265: return hb_qsv_info_hevc; default: @@ -1547,7 +1552,7 @@ int hb_qsv_profile_parse(hb_qsv_param_t *param, hb_qsv_info_t *info, const char if (profile->value == MFX_PROFILE_HEVC_MAIN10 && qsv_hardware_generation(hb_get_cpu_platform()) < QSV_G6) { - hb_log("HEVC Main10 is not supported on this platform"); + hb_log("qsv: HEVC Main10 is not supported on this platform"); profile = NULL; } @@ -1625,8 +1630,10 @@ const char* const* hb_qsv_profile_get_names(int encoder) { case HB_VCODEC_QSV_H264: return hb_h264_profile_names_8bit; - case HB_VCODEC_QSV_H265: + case HB_VCODEC_QSV_H265_8BIT: return hb_h265_profile_names_8bit; + case HB_VCODEC_QSV_H265_10BIT: + return hb_h265_profile_names_10bit; default: return NULL; } @@ -1638,6 +1645,7 @@ const char* const* hb_qsv_level_get_names(int encoder) { case HB_VCODEC_QSV_H264: return hb_h264_level_names; + case HB_VCODEC_QSV_H265_10BIT: case HB_VCODEC_QSV_H265: return hb_h265_level_names; default: @@ -1654,6 +1662,7 @@ const char* hb_qsv_video_quality_get_name(uint32_t codec) if (hb_qsv_info_avc != NULL) caps = hb_qsv_info_avc->capabilities; break; + case HB_VCODEC_QSV_H265_10BIT: case HB_VCODEC_QSV_H265: if (hb_qsv_info_hevc != NULL) caps = hb_qsv_info_hevc->capabilities; break; @@ -1670,6 +1679,7 @@ void hb_qsv_video_quality_get_limits(uint32_t codec, float *low, float *high, uint64_t caps = 0; switch (codec) { + case HB_VCODEC_QSV_H265_10BIT: case HB_VCODEC_QSV_H265: if (hb_qsv_info_hevc != NULL) caps = hb_qsv_info_hevc->capabilities; *direction = 1; diff --git a/libhb/work.c b/libhb/work.c index 831f83a8b..5af53cb5d 100644 --- a/libhb/work.c +++ b/libhb/work.c @@ -231,6 +231,7 @@ hb_work_object_t* hb_video_encoder(hb_handle_t *h, int vcodec) break; case HB_VCODEC_QSV_H264: case HB_VCODEC_QSV_H265: + case HB_VCODEC_QSV_H265_10BIT: w = hb_get_work(h, WORK_ENCQSV); break; case HB_VCODEC_THEORA: @@ -466,6 +467,7 @@ void hb_display_job_info(hb_job_t *job) case HB_VCODEC_X265_16BIT: case HB_VCODEC_QSV_H264: case HB_VCODEC_QSV_H265: + case HB_VCODEC_QSV_H265_10BIT: hb_log(" + profile: %s", job->encoder_profile); default: break; @@ -479,6 +481,7 @@ void hb_display_job_info(hb_job_t *job) case HB_VCODEC_X264_10BIT: case HB_VCODEC_QSV_H264: case HB_VCODEC_QSV_H265: + case HB_VCODEC_QSV_H265_10BIT: hb_log(" + level: %s", job->encoder_level); default: break; |