]> granicus.if.org Git - handbrake/commitdiff
QSV: Main10 should be default profile
authormaxd <maxim.d33@gmail.com>
Mon, 9 Oct 2017 09:04:01 +0000 (11:04 +0200)
committerScott <628593+sr55@users.noreply.github.com>
Fri, 13 Oct 2017 18:40:09 +0000 (19:40 +0100)
libhb/enc_qsv.c
libhb/qsv_common.c
libhb/qsv_common.h

index 6e44bf740e1b2c07539df1b97245531d66738999..765777f7e8bd25b66156c6d5cb290a3fa4560292 100644 (file)
@@ -864,7 +864,7 @@ int encqsvInit(hb_work_object_t *w, hb_job_t *job)
     pv->param.videoParam->mfx.FrameInfo.Height        = job->qsv.enc_info.align_height;
 
     // parse user-specified codec profile and level
-    if (hb_qsv_profile_parse(&pv->param, pv->qsv_info, job->encoder_profile))
+    if (hb_qsv_profile_parse(&pv->param, pv->qsv_info, job->encoder_profile, job->vcodec))
     {
         hb_error("encqsvInit: bad profile %s", job->encoder_profile);
         return -1;
index cc95e6a2d4fb7115021abfb41c89f9c98543acee..97348dd434635a74e4ab0b59433b030e64c48221 100644 (file)
@@ -1557,7 +1557,7 @@ int hb_qsv_param_parse(hb_qsv_param_t *param, hb_qsv_info_t *info,
     return error ? HB_QSV_PARAM_BAD_VALUE : HB_QSV_PARAM_OK;
 }
 
-int hb_qsv_profile_parse(hb_qsv_param_t *param, hb_qsv_info_t *info, const char *profile_key)
+int hb_qsv_profile_parse(hb_qsv_param_t *param, hb_qsv_info_t *info, const char *profile_key, const int codec)
 {
     hb_triplet_t *profile = NULL;
     if (profile_key != NULL && *profile_key && strcasecmp(profile_key, "auto"))
@@ -1590,6 +1590,15 @@ int hb_qsv_profile_parse(hb_qsv_param_t *param, hb_qsv_info_t *info, const char
         }
         param->videoParam->mfx.CodecProfile = profile->value;
     }
+    /* HEVC 10 bits defautls to Main 10 */
+    else if (((profile_key != NULL && !strcasecmp(profile_key, "auto")) || profile_key == NULL) && 
+              codec == HB_VCODEC_QSV_H265_10BIT &&
+              param->videoParam->mfx.CodecId == MFX_CODEC_HEVC &&
+              qsv_hardware_generation(hb_get_cpu_platform()) >= QSV_G6)
+    {
+         profile = &hb_qsv_h265_profiles[1];
+         param->videoParam->mfx.CodecProfile = profile->value;
+    }
     return 0;
 }
 
index e5964ca9d5ccf4b81a40d684278d58839123c3a9..620cb1aef40479f4b11d273cfeb4cd6798fe7c7e 100644 (file)
@@ -165,7 +165,7 @@ float hb_qsv_atof    (const char *str, int *err);
 int hb_qsv_param_default_preset(hb_qsv_param_t *param, mfxVideoParam *videoParam, hb_qsv_info_t *info, const char *preset);
 int hb_qsv_param_default       (hb_qsv_param_t *param, mfxVideoParam *videoParam, hb_qsv_info_t *info);
 int hb_qsv_param_parse         (hb_qsv_param_t *param,                            hb_qsv_info_t *info, const char *key, const char *value);
-int hb_qsv_profile_parse       (hb_qsv_param_t *param,                            hb_qsv_info_t *info, const char *profile_key);
+int hb_qsv_profile_parse       (hb_qsv_param_t *param,                            hb_qsv_info_t *info, const char *profile_key, const int codec);
 int hb_qsv_level_parse         (hb_qsv_param_t *param,                            hb_qsv_info_t *info, const char *level_key);
 
 typedef struct