#include <common/env.h>\r
#include <common/utility/assert.h>\r
\r
-#include <tbb/task.h>\r
+#include <ppl.h>\r
+\r
#include <tbb/atomic.h>\r
#include <tbb/parallel_for.h>\r
#include <tbb/tbb_thread.h>\r
\r
int thread_execute(AVCodecContext* s, int (*func)(AVCodecContext *c2, void *arg2), void* arg, int* ret, int count, int size)\r
{\r
- tbb::parallel_for(tbb::blocked_range<size_t>(0, count), [&](const tbb::blocked_range<size_t>& r)\r
+ Concurrency::parallel_for(0, count, [&](size_t n)\r
{\r
- for(size_t n = r.begin(); n != r.end(); ++n) \r
- {\r
- int r = func(s, reinterpret_cast<uint8_t*>(arg) + n*size);\r
- if(ret)\r
- ret[n] = r;\r
- }\r
+ int r = func(s, reinterpret_cast<uint8_t*>(arg) + n*size);\r
+ if(ret)\r
+ ret[n] = r;\r
});\r
\r
return 0;\r
\r
CASPAR_ASSERT(tbb::tbb_thread::hardware_concurrency() < 16);\r
// Note: this will probably only work when tbb::task_scheduler_init::num_threads() < 16.\r
- tbb::parallel_for(tbb::blocked_range<int>(0, count, 2), [&](const tbb::blocked_range<int> &r) \r
+ Concurrency::parallel_for(0, count, 2, [&](int jobnr) \r
{ \r
int threadnr = counter++; \r
- for(int jobnr = r.begin(); jobnr != r.end(); ++jobnr)\r
- { \r
- int r = func(s, arg, jobnr, threadnr); \r
- if (ret) \r
- ret[jobnr] = r; \r
- }\r
+ int r = func(s, arg, jobnr, threadnr); \r
+ if (ret) \r
+ ret[jobnr] = r; \r
--counter;\r
}); \r
\r