[x264-devel] Trouble keeping 8 cores busy

Phil Rutschman philr at modsystems.com
Tue Jan 6 23:25:29 CET 2009


I'm running x264 on a dual quad core Xeon 3 GHz (E5472) machine running
64-bit Ubuntu. I'm running the following version of x264, with no
patches, compiled for x86-64:

 

$ x264 --version

x264 0.65.1072 f586ba5

built on Jan  6 2009, gcc: 4.3.2

 

I've yet to find settings for x264 which keep all the cores busy on a
720x576 input stream. The best I've done is about 60-70% utilization.

 

Here are some representative command lines. For actual encoding I use
higher quality settings, but this is a simple example which shows the
effect. I have a "real" example below, 

x264 fifo.y4m -o output.264 --crf 10 --threads auto &

ffmpeg -i input.mpg -f yuv4mpegpipe - > fifo.y4m

 

I've confirmed that I'm not bottlenecked on decoding the mpeg to
yuv4mpeg; that runs about about 500 fps when I have cat dumping the
output of the fifo to /dev/null, and is only taking about 20% of one
core when feeding x264.

 

I've experimented with setting -threads manually higher than the 12 that
--threads auto selects, but regardless I'm only seeing 400-500%
utilization (in top's 100%-per-core lingo) from x264.

 

Is it expected that x264 be able to take full advantage of 8 cores, or
should I not expect it to scale so far? For this application it is
sometimes but not always possible to batch jobs, so I'm wondering if
there are settings which will make better use of processor resources
during a single run. I found a thread from last year on x264-devel
called "x264 and 8 cores", but it's not that I'm seeing drastic
slowdowns from a large number of cores, just that I'm not seeing as much
speedup as I'd hoped for.

 

Here's an example of my "real" settings. A fair bit of this is dictated
by requirements of a particular hardware decoder I'm targeting, and I'm
running this with patches, as you can see by the --nal-hrd, but I've
confirmed my observations with a vanilla build, as shown above.

-I 120 --aud --level 3 --vbv-bufsize 8000 --vbv-maxrate 10000 --ref 5
--nal-hrd --trellis 2 --psy-rd 1.0:1.0 --bframes 5 --b-adapt 2 --weightb
--direct auto --partitions all --mixed-refs --subme 9 --me umh -B 2400
--pass {1,2}

 

--

Phil Rutschman

Senior Software Engineer

MOD Systems

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.videolan.org/pipermail/x264-devel/attachments/20090106/9d2959a8/attachment.htm 


More information about the x264-devel mailing list