summaryrefslogtreecommitdiffstats
path: root/libhb/work.c
diff options
context:
space:
mode:
Diffstat (limited to 'libhb/work.c')
-rw-r--r--libhb/work.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/libhb/work.c b/libhb/work.c
index eaa7facab..4fca293fb 100644
--- a/libhb/work.c
+++ b/libhb/work.c
@@ -1167,12 +1167,13 @@ static int sanitize_qsv( hb_job_t * job )
// CPU-based deinterlace (validated)
case HB_FILTER_DEINTERLACE:
- if (filter->settings != NULL &&
- strcasecmp(filter->settings, "qsv") != 0)
+ {
+ int mode = hb_dict_get_int(filter->settings, "mode");
+ if (!(mode & MODE_DEINTERLACE_QSV))
{
encode_only = 1;
}
- break;
+ } break;
// other filters will be removed
default:
@@ -1217,19 +1218,19 @@ static int sanitize_qsv( hb_job_t * job )
{
// cropping and scaling always done via VPP filter
case HB_FILTER_CROP_SCALE:
- if (filter->settings == NULL || *filter->settings == 0)
- {
- // VPP defaults were set above, so not a problem
- // however, this should never happen, print an error
- hb_error("do_job: '%s': no settings!", filter->name);
- }
- else
- {
- sscanf(filter->settings, "%d:%d:%d:%d:%d:%d",
- &vpp_settings[0], &vpp_settings[1],
- &vpp_settings[2], &vpp_settings[3],
- &vpp_settings[4], &vpp_settings[5]);
- }
+ hb_dict_extract_int(&vpp_settings[0], filter->settings,
+ "width");
+ hb_dict_extract_int(&vpp_settings[1], filter->settings,
+ "height");
+ hb_dict_extract_int(&vpp_settings[2], filter->settings,
+ "crop-top");
+ hb_dict_extract_int(&vpp_settings[3], filter->settings,
+ "crop-bottom");
+ hb_dict_extract_int(&vpp_settings[4], filter->settings,
+ "crop-left");
+ hb_dict_extract_int(&vpp_settings[5], filter->settings,
+ "crop-right");
+
// VPP crop/scale takes precedence over OpenCL scale too
if (job->use_opencl)
{
@@ -1242,8 +1243,9 @@ static int sanitize_qsv( hb_job_t * job )
// pick VPP or CPU deinterlace depending on settings
case HB_FILTER_DEINTERLACE:
- if (filter->settings == NULL ||
- strcasecmp(filter->settings, "qsv") == 0)
+ {
+ int mode = hb_dict_get_int(filter->settings, "mode");
+ if (mode & MODE_DEINTERLACE_QSV)
{
// deinterlacing via VPP filter
vpp_settings[6] = 1;
@@ -1255,7 +1257,7 @@ static int sanitize_qsv( hb_job_t * job )
// validated
num_cpu_filters++;
}
- break;
+ } break;
// then, validated filters
case HB_FILTER_ROTATE: // TODO: use Media SDK for this