diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2013-05-25 10:41:40 +0400 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2013-05-25 10:41:40 +0400 |
commit | 33f989c8024aba5700d88df5810d288da38fb315 (patch) | |
tree | 4cb8c19301a16d7583332b8b815110e474d00a46 /decoder | |
parent | 7fed5f28d8f17d86ba44a562edc094a8b127947e (diff) |
Enable slice threading for YADIF
Diffstat (limited to 'decoder')
-rw-r--r-- | decoder/LAVVideo/Filtering.cpp | 3 | ||||
-rw-r--r-- | decoder/LAVVideo/stdafx.h | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/decoder/LAVVideo/Filtering.cpp b/decoder/LAVVideo/Filtering.cpp index 007a2890..d84bd37e 100644 --- a/decoder/LAVVideo/Filtering.cpp +++ b/decoder/LAVVideo/Filtering.cpp @@ -76,6 +76,9 @@ HRESULT CLAVVideo::Filter(LAVFrame *pFrame) m_pFilterGraph = avfilter_graph_alloc(); + av_opt_set(m_pFilterGraph, "thread_type", "slice", AV_OPT_SEARCH_CHILDREN); + av_opt_set_int(m_pFilterGraph, "threads", FFMAX(1, av_cpu_count() / 2), AV_OPT_SEARCH_CHILDREN); + _snprintf_s(args, sizeof(args), "video_size=%dx%d:pix_fmt=%s:time_base=1/10000000:pixel_aspect=1/1", pFrame->width, pFrame->height, av_get_pix_fmt_name(ff_pixfmt)); ret = avfilter_graph_create_filter(&m_pFilterBufferSrc, buffersrc, "in", args, NULL, m_pFilterGraph); if (ret < 0) { diff --git a/decoder/LAVVideo/stdafx.h b/decoder/LAVVideo/stdafx.h index e4f4221a..80d051e5 100644 --- a/decoder/LAVVideo/stdafx.h +++ b/decoder/LAVVideo/stdafx.h @@ -53,6 +53,7 @@ extern "C" { #include "libavfilter/buffersrc.h" #include "libavutil/intreadwrite.h" #include "libavutil/pixdesc.h" +#include "libavutil/opt.h" } #pragma warning(pop) |