Log in

View Full Version : How many threads does x264 support?


Biggiesized
6th April 2008, 04:20
I've already tried searching the forums, but I didn't get the results I expected. I always encode with threads set to 0 (auto), but I'm wondering if it's worth investing in a new quad core to replace my E6400.

Dark Shikari
6th April 2008, 04:53
x264 scales pretty well up to 8 cores and beyond. Highest I've seen tried is 16, and it did pretty well there too with 24-32 threads.

Biggiesized
6th April 2008, 04:57
What kind of scaling improvements did you see at 4 cores? 3.2x performance? What kind of rig do you have set up for encoding?

Dark Shikari
6th April 2008, 05:14
What kind of scaling improvements did you see at 4 cores? 3.2x performance? What kind of rig do you have set up for encoding?
4 cores = 4x speed, basically.

8 cores = 8x speed.

LoRd_MuldeR
6th April 2008, 14:55
Biggiesized,
note that you'll need (3/2) * (number of cores) threads for full performace.
So for example on a Quadcore you should use 6 threads...

poisondeathray
6th April 2008, 15:21
Biggiesized,
note that you'll need (3/2) * (number of cores) threads for full performace.
So for example on a Quadcore you should use 6 threads...

Wow LoRd_MuldeR, i never knew that

Can I ask how you determined this? Was it empirical testing? How much of an approximate performance gain on a quad (6 vs 4 threads)?

burfadel
6th April 2008, 15:47
The encoding speed can only be as good as its limiting factor... the avisynth chain! Which unfortunately at the moment is still single threaded, although there are multithreaded versions available that can be used by stating additional parameters.

The faster the avisynth chain is for the single threaded version, the better x264 will scale. It can't encode if the avisynth chain hasn't past on the next lot of data to encode!

TheRyuu
6th April 2008, 16:19
4 cores = 4x speed, basically.

8 cores = 8x speed.

Dark Shikari, what's your opinion on the thread pool patch?

LoRd_MuldeR
6th April 2008, 16:22
Can I ask how you determined this? Was it empirical testing?

I read it on the board and use it with success.
Also "--threads auto" will use (3/2) * (numer of cores) to calculate the number of threads...

Atak_Snajpera
6th April 2008, 20:46
Can I ask how you determined this? Was it empirical testing?

Aku made some tests and he had noticed that (3/2) * (numer of cores) works the best.

bob0r
7th April 2008, 07:20
Cores * 1.5 is how pengvado explained it.

Revision 607:

It is now useful to use more threads than you have cpus.
--threads=auto has been updated to use cpus*1.5.


The max is (x264/common/common.h):
#define X264_THREAD_MAX 128

Rodger
8th April 2008, 21:28
I use "--threads auto" and it works perfectly for me.
99-100% CPU-usuage.

This setting seems to do the hard maths for me :p

DeathTheSheep
15th April 2008, 18:55
Yup. :) After all, adding 50% to an even number can be pretty darn hard to do on your own at times. ;) ...nvm XD