]> git.sesse.net Git - x264/commit
Threaded lookahead
authorFiona Glaser <fiona@x264.com>
Tue, 8 May 2012 22:42:56 +0000 (15:42 -0700)
committerFiona Glaser <fiona@x264.com>
Fri, 18 May 2012 23:15:14 +0000 (16:15 -0700)
commitdf700eae5d5ce5732f80df9ce81e6d3fe99ef56a
tree0a4da18fa9726a745f4adf12d17796d1449d1b27
parent7cfe43cc7fb5474a87f02da96ebb850cdf83d73b
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.
common/common.c
common/common.h
common/macroblock.c
common/threadpool.c
encoder/encoder.c
encoder/slicetype.c
x264.c
x264.h