summaryrefslogtreecommitdiff
path: root/vp8/encoder
diff options
context:
space:
mode:
authorJohn Koleszar <jkoleszar@google.com>2011-05-06 00:05:10 -0400
committerJohn Koleszar <jkoleszar@google.com>2011-05-06 00:05:11 -0400
commite965d8f6f3d7079bbccac975e057d2b2daa0e20c (patch)
tree16a582e87849ead43bbedc46f8eea9691dc7b3df /vp8/encoder
parent7f1c9c6a130573fc9293b4d5c1ec4ddb4b4ff4d6 (diff)
parenteb16f00cf25e54f08c5a9ec25a8780ca708a2c3a (diff)
downloadlibvpx-e965d8f6f3d7079bbccac975e057d2b2daa0e20c.tar
libvpx-e965d8f6f3d7079bbccac975e057d2b2daa0e20c.tar.gz
libvpx-e965d8f6f3d7079bbccac975e057d2b2daa0e20c.tar.bz2
libvpx-e965d8f6f3d7079bbccac975e057d2b2daa0e20c.zip
Merge remote branch 'origin/master' into experimental
Change-Id: Ib6c8596030140ed2b5e1dea76de024d27ad8ed86
Diffstat (limited to 'vp8/encoder')
-rw-r--r--vp8/encoder/ethreading.c10
-rw-r--r--vp8/encoder/onyx_if.c4
-rw-r--r--vp8/encoder/onyx_int.h2
3 files changed, 9 insertions, 7 deletions
diff --git a/vp8/encoder/ethreading.c b/vp8/encoder/ethreading.c
index f5006ddab..c92a366e8 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
diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c
index 6a8b70e9f..e07b994bf 100644
--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -3215,7 +3215,7 @@ void loopfilter_frame(VP8_COMP *cpi, VP8_COMMON *cm)
#if CONFIG_MULTITHREAD
if (cpi->b_multi_threaded)
- sem_post(&cpi->h_event_end_lpf); /* signal that we have set filter_level */
+ sem_post(&cpi->h_event_end_picklpf); /* signal that we have set filter_level */
#endif
if (cm->filter_level > 0)
@@ -4221,7 +4221,7 @@ static void encode_frame_to_data_rate
#if CONFIG_MULTITHREAD
/* wait that filter_level is picked so that we can continue with stream packing */
if (cpi->b_multi_threaded)
- sem_wait(&cpi->h_event_end_lpf);
+ sem_wait(&cpi->h_event_end_picklpf);
#endif
// build the bitstream
diff --git a/vp8/encoder/onyx_int.h b/vp8/encoder/onyx_int.h
index a66056dff..c2fcff88c 100644
--- a/vp8/encoder/onyx_int.h
+++ b/vp8/encoder/onyx_int.h
@@ -576,7 +576,6 @@ typedef struct
// multithread data
int * mt_current_mb_col;
int mt_sync_range;
- int processor_core_count;
int b_multi_threaded;
int encoding_thread_count;
@@ -591,6 +590,7 @@ typedef struct
sem_t *h_event_start_encoding;
sem_t h_event_end_encoding;
sem_t h_event_start_lpf;
+ sem_t h_event_end_picklpf;
sem_t h_event_end_lpf;
#endif