summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_rdopt.c
diff options
context:
space:
mode:
authorYunqing Wang <yunqingwang@google.com>2017-04-24 12:06:49 -0700
committerYunqing Wang <yunqingwang@google.com>2017-04-24 16:28:27 -0700
commit10a497bd3823d88cf4c2f816a648ca0e79bd07be (patch)
tree2d0fc0df7b30d58fb1b216717efbdaf3a83ad75d /vp9/encoder/vp9_rdopt.c
parentc530208ae3cc0cb6835aeaa8e9ceb7edb37f40f0 (diff)
downloadlibvpx-10a497bd3823d88cf4c2f816a648ca0e79bd07be.tar
libvpx-10a497bd3823d88cf4c2f816a648ca0e79bd07be.tar.gz
libvpx-10a497bd3823d88cf4c2f816a648ca0e79bd07be.tar.bz2
libvpx-10a497bd3823d88cf4c2f816a648ca0e79bd07be.zip
Make the row based multi-threaded encoder deterministic
This patch followed allow_exhaustive_searches feature modification and continued to modify the encoder to achieve the determinism in the row based multi-threaded encoding. While row-mt = 1 and using multiple threads, the adaptive feature in encoder was disabled, which gave BDRate gain(at speed 1, -0.6% ~ -0.7%; at speed 2, -0.46% ~ -0.59%), but some encoder speed losses(7% ~ 10% at speed 1 and 3% ~ 6% at speed 2). These speed losses were acceptable considering the speed gains obtained from row-mt. Change-Id: I60d87a25346ebc487a864b57d559f560b7e398bb
Diffstat (limited to 'vp9/encoder/vp9_rdopt.c')
-rw-r--r--vp9/encoder/vp9_rdopt.c31
1 files changed, 3 insertions, 28 deletions
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c
index 2278ddc0f..cf46905c9 100644
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -3161,11 +3161,6 @@ void vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, TileDataEnc *tile_data,
for (i = 0; i <= LAST_NEW_MV_INDEX; ++i) mode_threshold[i] = 0;
-#if CONFIG_MULTITHREAD
- if (NULL != tile_data->enc_row_mt_mutex)
- pthread_mutex_lock(tile_data->enc_row_mt_mutex);
-#endif
-
for (i = LAST_NEW_MV_INDEX + 1; i < MAX_MODES; ++i)
mode_threshold[i] = ((int64_t)rd_threshes[i] * rd_thresh_freq_fact[i]) >> 5;
@@ -3187,11 +3182,6 @@ void vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, TileDataEnc *tile_data,
memcpy(mode_map, tile_mode_map, sizeof(mode_map));
-#if CONFIG_MULTITHREAD
- if (NULL != tile_data->enc_row_mt_mutex)
- pthread_mutex_unlock(tile_data->enc_row_mt_mutex);
-#endif
-
for (midx = 0; midx < MAX_MODES; ++midx) {
int mode_index = mode_map[midx];
int mode_excluded = 0;
@@ -3628,11 +3618,7 @@ void vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, TileDataEnc *tile_data,
if (!cpi->rc.is_src_frame_alt_ref)
vp9_update_rd_thresh_fact(tile_data->thresh_freq_fact,
- sf->adaptive_rd_thresh, bsize,
-#if CONFIG_MULTITHREAD
- tile_data->enc_row_mt_mutex,
-#endif
- best_mode_index);
+ sf->adaptive_rd_thresh, bsize, best_mode_index);
// macroblock modes
*mi = best_mbmode;
@@ -3772,11 +3758,7 @@ void vp9_rd_pick_inter_mode_sb_seg_skip(VP9_COMP *cpi, TileDataEnc *tile_data,
(cm->interp_filter == mi->interp_filter));
vp9_update_rd_thresh_fact(tile_data->thresh_freq_fact,
- cpi->sf.adaptive_rd_thresh, bsize,
-#if CONFIG_MULTITHREAD
- tile_data->enc_row_mt_mutex,
-#endif
- THR_ZEROMV);
+ cpi->sf.adaptive_rd_thresh, bsize, THR_ZEROMV);
vp9_zero(best_pred_diff);
vp9_zero(best_filter_diff);
@@ -3922,9 +3904,6 @@ void vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, TileDataEnc *tile_data,
if (!internal_active_edge &&
rd_less_than_thresh(best_rd,
rd_opt->threshes[segment_id][bsize][ref_index],
-#if CONFIG_MULTITHREAD
- tile_data->enc_row_mt_mutex,
-#endif
&rd_thresh_freq_fact[ref_index]))
continue;
@@ -4374,11 +4353,7 @@ void vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, TileDataEnc *tile_data,
!is_inter_block(&best_mbmode));
vp9_update_rd_thresh_fact(tile_data->thresh_freq_fact, sf->adaptive_rd_thresh,
- bsize,
-#if CONFIG_MULTITHREAD
- tile_data->enc_row_mt_mutex,
-#endif
- best_ref_index);
+ bsize, best_ref_index);
// macroblock modes
*mi = best_mbmode;