diff options
author | John Stebbins <[email protected]> | 2016-01-22 15:46:13 -0700 |
---|---|---|
committer | John Stebbins <[email protected]> | 2016-03-11 14:13:33 -0700 |
commit | c3c076a86e8c3a9b97b1ed352c88365728e3879a (patch) | |
tree | 192ca09b9b67c5670d7d64fa42bdcb4107240919 /libhb/work.c | |
parent | 2615c363516a5b29d7d02b73e6b5cf2842584e13 (diff) |
decomb: split comb detection out into it's own filter
Diffstat (limited to 'libhb/work.c')
-rw-r--r-- | libhb/work.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/libhb/work.c b/libhb/work.c index 7a1460eec..eaa7facab 100644 --- a/libhb/work.c +++ b/libhb/work.c @@ -11,6 +11,7 @@ #include "libavformat/avformat.h" #include "openclwrapper.h" #include "opencl.h" +#include "decomb.h" #ifdef USE_QSV #include "qsv_common.h" @@ -1309,6 +1310,31 @@ static int sanitize_qsv( hb_job_t * job ) return 0; } +static void sanitize_filter_list(hb_list_t *list) +{ + // Add selective deinterlacing mode if comb detection is enabled + if (hb_filter_find(list, HB_FILTER_COMB_DETECT) != NULL) + { + int selective[] = {HB_FILTER_DECOMB, HB_FILTER_DEINTERLACE}; + int ii, count = sizeof(selective) / sizeof(int); + + for (ii = 0; ii < count; ii++) + { + hb_filter_object_t * filter = hb_filter_find(list, selective[ii]); + if (filter != NULL) + { + int mode = hb_dict_get_int(filter->settings, "mode"); + mode |= MODE_DECOMB_SELECTIVE; + hb_dict_set(filter->settings, "mode", hb_value_int(mode)); + break; + } + } + } + + // Combine HB_FILTER_AVFILTERs that are sequential + hb_avfilter_combine(list); +} + /** * Job initialization rountine. * @@ -1416,8 +1442,7 @@ static void do_job(hb_job_t *job) { hb_filter_init_t init; - // Combine HB_FILTER_AVFILTERs that are sequential - hb_avfilter_combine(job->list_filter); + sanitize_filter_list(job->list_filter); memset(&init, 0, sizeof(init)); init.job = job; |