diff options
author | Yunqing Wang <yunqingwang@google.com> | 2011-05-05 04:59:54 -0700 |
---|---|---|
committer | Code Review <code-review@webmproject.org> | 2011-05-05 04:59:54 -0700 |
commit | aeb86d615c87d80cfd4127c915812e1299f80a33 (patch) | |
tree | c37bb2e465b6a93568a5c3c7689fbdd586e3d13d /vp8/encoder/ethreading.c | |
parent | 3fbade23a2c6eb060f7c65df210bc84f1a801165 (diff) | |
parent | 297b27655eaf4a0cfd097b2ae94add4b19fed9eb (diff) | |
download | libvpx-aeb86d615c87d80cfd4127c915812e1299f80a33.tar libvpx-aeb86d615c87d80cfd4127c915812e1299f80a33.tar.gz libvpx-aeb86d615c87d80cfd4127c915812e1299f80a33.tar.bz2 libvpx-aeb86d615c87d80cfd4127c915812e1299f80a33.zip |
Merge "Runtime detection of available processor cores."
Diffstat (limited to 'vp8/encoder/ethreading.c')
-rw-r--r-- | vp8/encoder/ethreading.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/vp8/encoder/ethreading.c b/vp8/encoder/ethreading.c index f5006ddab..c00494dcf 100644 --- a/vp8/encoder/ethreading.c +++ b/vp8/encoder/ethreading.c @@ -459,15 +459,15 @@ void vp8cx_create_encoder_threads(VP8_COMP *cpi) cpi->b_multi_threaded = 0; cpi->encoding_thread_count = 0; - cpi->processor_core_count = 32; //vp8_get_proc_core_count(); - if (cpi->processor_core_count > 1 && cpi->oxcf.multi_threaded > 1) + if (cm->processor_core_count > 1 && cpi->oxcf.multi_threaded > 1) { int ithread; int th_count = cpi->oxcf.multi_threaded - 1; - if (cpi->oxcf.multi_threaded > cpi->processor_core_count) - th_count = cpi->processor_core_count - 1; + /* don't allocate more threads than cores available */ + if (cpi->oxcf.multi_threaded > cm->processor_core_count) + th_count = cm->processor_core_count - 1; /* we have th_count + 1 (main) threads processing one row each */ /* no point to have more threads than the sync range allows */ |