diff options
author | Rodeo <[email protected]> | 2015-02-01 01:21:05 +0000 |
---|---|---|
committer | Rodeo <[email protected]> | 2015-02-01 01:21:05 +0000 |
commit | d75dadf6d4816c87753d5e4b0cf765109ff68cd5 (patch) | |
tree | 7849a1488f62a34450d78d14583a629813544595 | |
parent | d686e599cf02651d884d73c2691503fbee583c14 (diff) |
QSV: refactor logging of encoder capabilities
Only log H.265/HEVC information with verbosity 2, as encoding is not supported yet.
Log H.264 capabilities with verbosity 1, as this may be useful and doesn't take up that much space. Shorten the string as much as possible.
Also rename NMBSLICE capability to NMPSLICE (Num Mb Per Slice) for consistency.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6846 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | libhb/qsv_common.c | 91 | ||||
-rw-r--r-- | libhb/qsv_common.h | 2 |
2 files changed, 69 insertions, 24 deletions
diff --git a/libhb/qsv_common.c b/libhb/qsv_common.c index e70220a87..d9143c8fd 100644 --- a/libhb/qsv_common.c +++ b/libhb/qsv_common.c @@ -10,6 +10,7 @@ #ifdef USE_QSV #include <stdio.h> +#include <string.h> #include "hb.h" #include "ports.h" @@ -416,7 +417,7 @@ static int query_capabilities(mfxSession session, mfxVersion version, hb_qsv_inf } if (extCodingOption2.NumMbPerSlice) { - info->capabilities |= HB_QSV_CAP_OPTION2_NMBSLICE; + info->capabilities |= HB_QSV_CAP_OPTION2_NMPSLICE; } } } @@ -500,26 +501,70 @@ int hb_qsv_info_init() static void log_capabilities(int log_level, uint64_t caps, const char *prefix) { - if (!caps) + /* + * Note: keep the string short, as it may be logged by default. + */ + char buffer[128] = ""; + + /* B-Pyramid, with or without direct control (BRefType) */ + if (caps & HB_QSV_CAP_B_REF_PYRAMID) { - hb_deep_log(log_level, "%s none (standard feature set)", prefix); + if (caps & HB_QSV_CAP_OPTION2_BREFTYPE) + { + strcat(buffer, " breftype"); + } + else + { + strcat(buffer, " bpyramid"); + } } - else + /* Rate control: ICQ, lookahead (options: interlaced, downsampling) */ + if (caps & HB_QSV_CAP_RATECONTROL_LA) + { + if (caps & HB_QSV_CAP_RATECONTROL_ICQ) + { + strcat(buffer, " icq+la"); + } + else + { + strcat(buffer, " la"); + } + if (caps & HB_QSV_CAP_RATECONTROL_LAi) + { + strcat(buffer, "+i"); + } + if (caps & HB_QSV_CAP_OPTION2_LA_DOWNS) + { + strcat(buffer, "+downs"); + } + } + else if (caps & HB_QSV_CAP_RATECONTROL_ICQ) + { + strcat(buffer, " icq"); + } + if (caps & HB_QSV_CAP_OPTION2_MBBRC) + { + strcat(buffer, " mbbrc"); + } + if (caps & HB_QSV_CAP_OPTION2_EXTBRC) { - hb_deep_log(log_level, "%s%s%s%s%s%s%s%s%s%s%s%s%s", prefix, - !(caps & HB_QSV_CAP_MSDK_API_1_6) ? "" : " api1.6", - !(caps & HB_QSV_CAP_B_REF_PYRAMID) ? "" : " bpyramid", - !(caps & HB_QSV_CAP_OPTION2_BREFTYPE) ? "" : " breftype", - !(caps & HB_QSV_CAP_RATECONTROL_LA) ? "" : " lookahead", - !(caps & HB_QSV_CAP_RATECONTROL_LAi) ? "" : " lookaheadi", - !(caps & HB_QSV_CAP_OPTION2_LA_DOWNS) ? "" : " lookaheadds", - !(caps & HB_QSV_CAP_RATECONTROL_ICQ) ? "" : " icq", - !(caps & HB_QSV_CAP_OPTION2_MBBRC) ? "" : " mbbrc", - !(caps & HB_QSV_CAP_OPTION2_EXTBRC) ? "" : " extbrc", - !(caps & HB_QSV_CAP_OPTION2_TRELLIS) ? "" : " trellis", - !(caps & HB_QSV_CAP_OPTION2_IB_ADAPT) ? "" : " adaptivei adaptiveb", - !(caps & HB_QSV_CAP_OPTION2_NMBSLICE) ? "" : " nummbperslice"); + strcat(buffer, " extbrc"); } + if (caps & HB_QSV_CAP_OPTION2_TRELLIS) + { + strcat(buffer, " trellis"); + } + if (caps & HB_QSV_CAP_OPTION2_IB_ADAPT) + { + strcat(buffer, " ib_adapt"); + } + if (caps & HB_QSV_CAP_OPTION2_NMPSLICE) + { + strcat(buffer, " nmpslice"); + } + + hb_deep_log(log_level, "%s%s", prefix, + strnlen(buffer, 1) ? buffer : " standard feature set"); } void hb_qsv_info_print() @@ -550,12 +595,12 @@ void hb_qsv_info_print() hb_qsv_impl_get_name(hb_qsv_info_avc->implementation)); if (qsv_hardware_info_avc.available) { - log_capabilities(2, qsv_hardware_info_avc.capabilities, + log_capabilities(1, qsv_hardware_info_avc.capabilities, " - capabilities (hardware): "); } if (qsv_software_info_avc.available) { - log_capabilities(2, qsv_software_info_avc.capabilities, + log_capabilities(1, qsv_software_info_avc.capabilities, " - capabilities (software): "); } } @@ -565,9 +610,9 @@ void hb_qsv_info_print() } if (hb_qsv_info_hevc != NULL && hb_qsv_info_hevc->available) { - hb_log(" - H.265 encoder: yes (unsupported)"); - hb_log(" - preferred implementation: %s", - hb_qsv_impl_get_name(hb_qsv_info_hevc->implementation)); + hb_deep_log(2, " - H.265 encoder: yes (unsupported)"); + hb_deep_log(2, " - preferred implementation: %s", + hb_qsv_impl_get_name(hb_qsv_info_hevc->implementation)); if (qsv_hardware_info_hevc.available) { log_capabilities(2, qsv_hardware_info_hevc.capabilities, @@ -581,7 +626,7 @@ void hb_qsv_info_print() } else { - hb_log(" - H.265 encoder: no"); + hb_deep_log(2, " - H.265 encoder: no"); } } } diff --git a/libhb/qsv_common.h b/libhb/qsv_common.h index dad517f4d..4b2630f39 100644 --- a/libhb/qsv_common.h +++ b/libhb/qsv_common.h @@ -53,7 +53,7 @@ typedef struct hb_qsv_info_s #define HB_QSV_CAP_OPTION2_BREFTYPE (1LL << 23) #define HB_QSV_CAP_OPTION2_IB_ADAPT (1LL << 24) #define HB_QSV_CAP_OPTION2_LA_DOWNS (1LL << 25) -#define HB_QSV_CAP_OPTION2_NMBSLICE (1LL << 26) +#define HB_QSV_CAP_OPTION2_NMPSLICE (1LL << 26) // TODO: add maximum encode resolution, etc. } hb_qsv_info_t; |