summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libhb/encx265.c27
-rw-r--r--libhb/work.c3
2 files changed, 30 insertions, 0 deletions
diff --git a/libhb/encx265.c b/libhb/encx265.c
index 30bde6565..6e196eafd 100644
--- a/libhb/encx265.c
+++ b/libhb/encx265.c
@@ -81,6 +81,29 @@ static int param_parse(hb_work_private_t *pv, x265_param *param,
return ret;
}
+int apply_h265_level(hb_work_private_t *pv, x265_param *param,
+ const char *h265_level)
+{
+ if (h265_level == NULL ||
+ !strcasecmp(h265_level, hb_h265_level_names[0]))
+ {
+ return 0;
+ }
+ // Verify that level is valid
+ int i;
+ for (i = 1; hb_h265_level_values[i]; i++)
+ {
+ if (!strcmp(hb_h265_level_names[i], h265_level))
+ {
+ return param_parse(pv, param, "level-idc", h265_level);
+ }
+ }
+
+ // error (invalid or unsupported level), abort
+ hb_error("apply_h265_level: invalid level %s", h265_level);
+ return X265_PARAM_BAD_VALUE;
+}
+
/***********************************************************************
* hb_work_encx265_init
***********************************************************************
@@ -273,6 +296,10 @@ int encx265Init(hb_work_object_t *w, hb_job_t *job)
{
goto fail;
}
+ if (apply_h265_level(pv, param, job->encoder_level) < 0)
+ {
+ goto fail;
+ }
/* we should now know whether B-frames are enabled */
job->areBframes = (param->bframes > 0) + (param->bframes > 0 &&
diff --git a/libhb/work.c b/libhb/work.c
index acd275053..3565290dc 100644
--- a/libhb/work.c
+++ b/libhb/work.c
@@ -546,6 +546,9 @@ void hb_display_job_info(hb_job_t *job)
{
case HB_VCODEC_X264_8BIT:
case HB_VCODEC_X264_10BIT:
+ case HB_VCODEC_X265_8BIT:
+ case HB_VCODEC_X265_10BIT:
+ case HB_VCODEC_X265_12BIT:
case HB_VCODEC_QSV_H264:
case HB_VCODEC_QSV_H265:
case HB_VCODEC_QSV_H265_10BIT: