[x264-devel] Threaded lookahead

Jason Garrett-Glaser git at videolan.org
Tue May 22 23:56:14 CEST 2012


x264 | branch: master | Jason Garrett-Glaser <jason at x264.com> | Tue May  8 15:42:56 2012 -0700| [999b753ff0f4dc872077f4fa90d465e948cbe656] | committer: Jason Garrett-Glaser

Threaded lookahead

Split each lookahead frame analysis call into multiple threads.  Has a small
impact on quality, but does not seem to be consistently any worse.

This helps alleviate bottlenecks with many cores and frame threads. In many
case, this massively increases performance on many-core systems.  For example,
over 100% faster 1080p encoding with --preset veryfast on a 12-core i7 system.
Realtime 1080p30 at --preset slow should now be feasible on real systems.

For sliced-threads, this patch should be faster regardless of settings (~10%).

By default, lookahead threads are 1/6 of regular threads.  This isn't exacting,
but it seems to work well for all presets on real systems.  With sliced-threads,
it's the same as the number of encoding threads.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=999b753ff0f4dc872077f4fa90d465e948cbe656
---

 common/common.c     |    9 +++
 common/common.h     |    4 ++
 common/macroblock.c |    4 ++
 common/threadpool.c |    4 +-
 encoder/encoder.c   |   36 ++++++++--
 encoder/slicetype.c |  199 ++++++++++++++++++++++++++++++++++++++-------------
 x264.c              |    2 +
 x264.h              |    5 +-
 8 files changed, 207 insertions(+), 56 deletions(-)

Diff:   http://git.videolan.org/gitweb.cgi/x264.git/?a=commitdiff;h=999b753ff0f4dc872077f4fa90d465e948cbe656


More information about the x264-devel mailing list