diff options
author | John Koleszar <jkoleszar@google.com> | 2011-05-06 00:05:10 -0400 |
---|---|---|
committer | John Koleszar <jkoleszar@google.com> | 2011-05-06 00:05:10 -0400 |
commit | 39e36f8604ca5acac27104055b6902645a947978 (patch) | |
tree | 4ffdaa3c17ec03a7227c7e24a34f269c0d0e7c4e /vp8/encoder/ethreading.c | |
parent | 56f8277d5462a7b9d197e38fa4866ea436658c58 (diff) | |
parent | eb16f00cf25e54f08c5a9ec25a8780ca708a2c3a (diff) | |
download | libvpx-39e36f8604ca5acac27104055b6902645a947978.tar libvpx-39e36f8604ca5acac27104055b6902645a947978.tar.gz libvpx-39e36f8604ca5acac27104055b6902645a947978.tar.bz2 libvpx-39e36f8604ca5acac27104055b6902645a947978.zip |
Merge remote branch 'internal/upstream' into HEAD
Diffstat (limited to 'vp8/encoder/ethreading.c')
-rw-r--r-- | vp8/encoder/ethreading.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/vp8/encoder/ethreading.c b/vp8/encoder/ethreading.c index 8aef915b8..4c79b1590 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 */ @@ -514,6 +514,7 @@ void vp8cx_create_encoder_threads(VP8_COMP *cpi) LPFTHREAD_DATA * lpfthd = &cpi->lpf_thread_data; sem_init(&cpi->h_event_start_lpf, 0, 0); + sem_init(&cpi->h_event_end_picklpf, 0, 0); sem_init(&cpi->h_event_end_lpf, 0, 0); lpfthd->ptr1 = (void *)cpi; @@ -547,6 +548,7 @@ void vp8cx_remove_encoder_threads(VP8_COMP *cpi) sem_destroy(&cpi->h_event_end_encoding); sem_destroy(&cpi->h_event_end_lpf); + sem_destroy(&cpi->h_event_end_picklpf); sem_destroy(&cpi->h_event_start_lpf); //free thread related resources |