diff options
Diffstat (limited to 'vp9/encoder/vp9_aq_cyclicrefresh.c')
-rw-r--r-- | vp9/encoder/vp9_aq_cyclicrefresh.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/vp9/encoder/vp9_aq_cyclicrefresh.c b/vp9/encoder/vp9_aq_cyclicrefresh.c index 514ff7a52..1fc4ecdee 100644 --- a/vp9/encoder/vp9_aq_cyclicrefresh.c +++ b/vp9/encoder/vp9_aq_cyclicrefresh.c @@ -94,19 +94,17 @@ static int candidate_refresh_aq(const CYCLIC_REFRESH *cr, const MB_MODE_INFO *mbmi, BLOCK_SIZE bsize, int use_rd) { if (use_rd) { + MV mv = mbmi->mv[0].as_mv; // If projected rate is below the thresh_rate (well below target, // so undershoot expected), accept it for lower-qp coding. if (cr->projected_rate_sb < cr->thresh_rate_sb) return 1; // Otherwise, reject the block for lower-qp coding if any of the following: - // 1) prediction block size is below min_block_size - // 2) mode is non-zero mv and projected distortion is above thresh_dist - // 3) mode is an intra-mode (we may want to allow some of this under + // 1) mode uses large mv + // 2) mode is an intra-mode (we may want to allow some of this under // another thresh_dist) - else if (bsize < cr->min_block_size || - (mbmi->mv[0].as_int != 0 && - cr->projected_dist_sb > cr->thresh_dist_sb) || - !is_inter_block(mbmi)) + else if (mv.row > 32 || mv.row < -32 || + mv.col > 32 || mv.col < -32 || !is_inter_block(mbmi)) return 0; else return 1; @@ -135,8 +133,7 @@ void vp9_cyclic_refresh_update_segment(VP9_COMP *const cpi, const int xmis = MIN(cm->mi_cols - mi_col, bw); const int ymis = MIN(cm->mi_rows - mi_row, bh); const int block_index = mi_row * cm->mi_cols + mi_col; - const int refresh_this_block = cpi->mb.in_static_area || - candidate_refresh_aq(cr, mbmi, bsize, use_rd); + const int refresh_this_block = candidate_refresh_aq(cr, mbmi, bsize, use_rd); // Default is to not update the refresh map. int new_map_value = cr->map[block_index]; int x = 0; int y = 0; @@ -161,6 +158,7 @@ void vp9_cyclic_refresh_update_segment(VP9_COMP *const cpi, // Leave it marked as block that is not candidate for refresh. new_map_value = 1; } + // Update entries in the cyclic refresh map with new_map_value, and // copy mbmi->segment_id into global segmentation map. for (y = 0; y < ymis; y++) @@ -214,8 +212,8 @@ void vp9_cyclic_refresh_setup(VP9_COMP *const cpi) { if (cpi->sf.use_nonrd_pick_mode) { // May want to be more conservative with thresholds in non-rd mode for now // as rate/distortion are derived from model based on prediction residual. - cr->thresh_rate_sb = (rc->sb64_target_rate * 256) >> 3; - cr->thresh_dist_sb = 4 * (int)(q * q); + cr->thresh_rate_sb = (rc->sb64_target_rate * 256); + cr->thresh_dist_sb = 16 * (int)(q * q); } cr->num_seg_blocks = 0; |