[FFmpeg-devel] [RFC] Removing non-pthreads support

Ramiro Polla ramiro.polla
Thu Apr 22 01:24:27 CEST 2010

On Tue, Apr 20, 2010 at 5:05 PM, Ramiro Polla <ramiro.polla at gmail.com> wrote:
> On Tue, Apr 20, 2010 at 4:29 PM, M?ns Rullg?rd <mans at mansr.com> wrote:
>> Pthreads on win32 works well enough for us. ?In the benchmarks someone
>> posted, there was no significant difference in the best times, and
>> pthreads performed better with more threads than cores.
> I mixed up the results for more threads than cores. I don't remember
> which one was better. I'll run more tests tonight.

Ok, here are the results:

VTS_01_1.m2v is 720x480 mpeg2video at 8M
VTS_01_1.80.ac3 is 5.1 ac3 audio

ffmpeg -threads x -i VTS_01_1.m2v -benchmark 2 -f null -y NUL
w32threads       1           2           3
mean   63.8178     36.5872     41.3338
stddev 54.98818e-3 52.68491e-3 76.80299e-3
pthreads         1           2           3
mean   63.6868     36.6214     42.7246
stddev 22.27555e-3 38.99744e-3 53.69637e-3

ffmpeg -threads x -i VTS_01_1.80.ac3 -i VTS_01_1.m2v -benchmark 2
-vcodec libx264 -fpre libx264-normal.ffpreset -f h264 -vframes 10000
-y NUL
w32threads       1           2           3
mean   218.3857    129.198     130.573
stddev 9.237604e-3   4.52      612.7699e-3
pthreads         1           2           3
mean   218.6823    128.6873    130.7187
stddev 275.2096e-3   4.413902  762.6089e-3

ffmpeg -threads x -i VTS_01_1.80.ac3 -i VTS_01_1.m2v -benchmark 2
-target dv -vframes 10000 -y NUL
w32threads       1           2           3
mean   78.625      53.693      55.45333
stddev 16e-3        8.66025e-3  1.03255e-3
pthreads         1           2           3
mean   78.72933    49.28633    51.44267
stddev 397.21e-3    9.2376e-3  824.0111e-3

- I had mixed up the "more threads than cores" result from the last
benchmarks. w32threads are faster, and not the other way around, in
the mpeg2 decoding only test.
- there doesn't seem to be any problem mixing w32threads for decoding
mpeg2 and pthreads for encoding with libx264. the huge stddev for 2
threads is weird though, I re-ran the batch of tests to make sure and
got similar results.
- in the 2 threads for mpeg2 decoding + 2 threads for dv encoding
test, pthreads is better.

I don't have a machine with more than 2 cores and windows to test
more... If anyone wants the win32 builds just ask me.

Another thing, starting with Windows Vista, windows now has condition
variables, maybe w32 threading could be re-implemented using those
(I'm just suggesting, I don't know if there would be any benefit).

More information about the ffmpeg-devel mailing list