summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_rd.c
diff options
context:
space:
mode:
Diffstat (limited to 'vp9/encoder/vp9_rd.c')
-rw-r--r--vp9/encoder/vp9_rd.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/vp9/encoder/vp9_rd.c b/vp9/encoder/vp9_rd.c
index 3bbfa1aac..21e3b1f63 100644
--- a/vp9/encoder/vp9_rd.c
+++ b/vp9/encoder/vp9_rd.c
@@ -610,7 +610,15 @@ void vp9_set_rd_speed_thresholds_sub8x8(VP9_COMP *cpi) {
}
void vp9_update_rd_thresh_fact(int (*factor_buf)[MAX_MODES], int rd_thresh,
- int bsize, int best_mode_index) {
+ int bsize,
+#if CONFIG_MULTITHREAD
+ pthread_mutex_t *enc_row_mt_mutex,
+#endif
+ int best_mode_index) {
+#if CONFIG_MULTITHREAD
+ if (NULL != enc_row_mt_mutex) pthread_mutex_lock(enc_row_mt_mutex);
+#endif
+
if (rd_thresh > 0) {
const int top_mode = bsize < BLOCK_8X8 ? MAX_REFS : MAX_MODES;
int mode;
@@ -628,6 +636,10 @@ void vp9_update_rd_thresh_fact(int (*factor_buf)[MAX_MODES], int rd_thresh,
}
}
}
+
+#if CONFIG_MULTITHREAD
+ if (NULL != enc_row_mt_mutex) pthread_mutex_unlock(enc_row_mt_mutex);
+#endif
}
int vp9_get_intra_cost_penalty(int qindex, int qdelta,