複数CPUでパラレル・エンコードをするためにスレッドを分散。
圧縮品質に僅かな悪影響がある。
0 または ’auto’でx264はCPU数を検出し、適切なthread数を自動選択する。
スライスを使った併行エンコード。マルチ/マルチコアCPUがあれば速度向上。分散処理の手法と符号化の動作原理からスレッド分散には僅かな画質劣化があるが、少しリッチな設定をしてやれば抑えられる。しかも速度向上分は余る。各CPU/コアあたり1スレッドが適正なので、2コアなら --threads 2、2コア2CPUなら --threads 4。
*スレッド分散方式はこの記述の後(rev.607)で最大4から16に拡張され、分散処理の手法も変わり、画質劣化はより少なくなり、CPU数以上のスレッドを指定してもよくなった。反面、シーンカット検出がやや精度低下。詳細は下記参照。
ageha:07/01/05 threads=<1-16>:http://agehatype0.blog50.fc2.com/blog-entry-170.html
まるも製作所さん:07/07/21(土) x264 [19] スレッド実装:http://www.marumo.ne.jp/db2007_7.htm#21
マルチCPUで平行処理をするもの。マニュアルでスレッド数を指定する事もできますが、threads=auto でCPU数に応じて分散数を自動的に決めさせる方が良いでしょう。マルチプロセッサではリニアに速度が向上する(コア一個に付き約94%)ので絶対使った方が良いです。画質劣化は僅かなものです(デュアルコアで約 0.005dB 、クアッドコアなら約 0.01dB )。
This option allows to spawn threads to encode in parallel on multiple CPUs. You can manually select the number of threads to be created or, better, set threads=auto and let x264 detect how many CPUs are available and pick an appropriate number of threads. If you have a multi-processor machine, you should really consider using it as it can to increase encoding speed linearly with the number of CPU cores (about 94% per CPU core), with very little quality reduction (about 0.005dB for dual processor, about 0.01dB for a quad processor machine).