From 07507c830b3bea3b71cb30aeef569e6528a44cab Mon Sep 17 00:00:00 2001 From: Jingning Han Date: Fri, 13 Jul 2018 16:24:12 -0700 Subject: [PATCH] Use the estimate qp to set motion search control Set the multiplier for motion estimation using the estimate frame quantization paramter in the temporal dependency model. Change-Id: Ia9a843111c1504d7ae8b12113374831ee79c85b8 --- vp9/encoder/vp9_encoder.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index b74fda8bb..61a399a31 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -5504,6 +5504,7 @@ void init_gop_frames(VP9_COMP *cpi, GF_PICTURE *gf_picture, int alt_index = -1; int lst_index = -1; int extend_frame_count = 0; + int pframe_qindex = cpi->tpl_stats[2].base_qindex; *tpl_group_frames = 0; @@ -5550,6 +5551,8 @@ void init_gop_frames(VP9_COMP *cpi, GF_PICTURE *gf_picture, if (buf == NULL) break; + cpi->tpl_stats[frame_idx].base_qindex = pframe_qindex; + gf_picture[frame_idx].frame = &buf->img; gf_picture[frame_idx].ref_frame[0] = gld_index; gf_picture[frame_idx].ref_frame[1] = lst_index; @@ -5767,12 +5770,14 @@ void mc_flow_dispenser(VP9_COMP *cpi, GF_PICTURE *gf_picture, int frame_idx) { xd->mi[0] = cm->mi; // Get rd multiplier set up. - rdmult = (int)vp9_compute_rd_mult_based_on_qindex(cpi, ARNR_FILT_QINDEX); + rdmult = + (int)vp9_compute_rd_mult_based_on_qindex(cpi, tpl_frame->base_qindex); if (rdmult < 1) rdmult = 1; set_error_per_bit(&cpi->td.mb, rdmult); - vp9_initialize_me_consts(cpi, &cpi->td.mb, ARNR_FILT_QINDEX); + vp9_initialize_me_consts(cpi, &cpi->td.mb, tpl_frame->base_qindex); tpl_frame->is_valid = 1; + for (mi_row = 0; mi_row < cm->mi_rows; mi_row += mi_height) { // Motion estimation row boundary x->mv_limits.row_min = -((mi_row * MI_SIZE) + (17 - 2 * VP9_INTERP_EXTEND)); -- 2.40.0