\r
#include "parallel_yadif.h"\r
\r
+#include <common/log/log.h>\r
+\r
+#if defined(_MSC_VER)\r
+#pragma warning (push)\r
+#pragma warning (disable : 4244)\r
+#endif\r
extern "C" \r
{\r
#include <libavfilter/avfilter.h>\r
}\r
+#if defined(_MSC_VER)\r
+#pragma warning (pop)\r
+#endif\r
\r
#include <tbb/parallel_for.h>\r
+#include <tbb/concurrent_queue.h>\r
\r
#include <boost/thread/once.hpp>\r
\r
parallel_line_func_pool.push(reinterpret_cast<decltype(fs[0])>(func));\r
}\r
\r
-std::shared_ptr<void> make_parallel_yadif(AVFilterContext* ctx)\r
+std::shared_ptr<void> make_parallel_yadif(AVFilterContext* ctx, size_t height)\r
{\r
+ if(height % 64 != 0)\r
+ return std::shared_ptr<void>(nullptr, return_parallel_yadif);\r
+\r
static boost::once_flag flag = BOOST_ONCE_INIT;\r
boost::call_once(&init_pool, flag);\r
\r
YADIFContext* yadif = (YADIFContext*)ctx->priv;\r
org_yadif_filter_line = yadif->filter_line; // Data race is not a problem.\r
-\r
+ \r
decltype(org_yadif_filter_line) func = nullptr;\r
if(!parallel_line_func_pool.try_pop(func)) \r
- CASPAR_LOG(warning) << "Not enough scalable-yadif instances. Running non-scalable";\r
+ CASPAR_LOG(warning) << "Not enough scalable-yadif context instances. Running non-scalable";\r
else\r
yadif->filter_line = func;\r
\r