Merge "Increase delta-qp for aq=3 mode, after key frame."
This commit is contained in:
		@@ -319,6 +319,20 @@ void vp9_cyclic_refresh_update_map(VP9_COMP *const cpi) {
 | 
				
			|||||||
  cr->sb_index = i;
 | 
					  cr->sb_index = i;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Set/update global/frame level cyclic refresh parameters.
 | 
				
			||||||
 | 
					void vp9_cyclic_refresh_update_parameters(VP9_COMP *const cpi) {
 | 
				
			||||||
 | 
					  const RATE_CONTROL *const rc = &cpi->rc;
 | 
				
			||||||
 | 
					  CYCLIC_REFRESH *const cr = cpi->cyclic_refresh;
 | 
				
			||||||
 | 
					  cr->percent_refresh = 10;
 | 
				
			||||||
 | 
					  // Use larger delta-qp (increase rate_ratio_qdelta) for first few (~4)
 | 
				
			||||||
 | 
					  // periods of the refresh cycle, after a key frame. This corresponds to ~40
 | 
				
			||||||
 | 
					  // frames with cr->percent_refresh = 10.
 | 
				
			||||||
 | 
					  if (rc->frames_since_key <  40)
 | 
				
			||||||
 | 
					    cr->rate_ratio_qdelta = 3.0;
 | 
				
			||||||
 | 
					  else
 | 
				
			||||||
 | 
					    cr->rate_ratio_qdelta = 2.0;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Setup cyclic background refresh: set delta q and segmentation map.
 | 
					// Setup cyclic background refresh: set delta q and segmentation map.
 | 
				
			||||||
void vp9_cyclic_refresh_setup(VP9_COMP *const cpi) {
 | 
					void vp9_cyclic_refresh_setup(VP9_COMP *const cpi) {
 | 
				
			||||||
  VP9_COMMON *const cm = &cpi->common;
 | 
					  VP9_COMMON *const cm = &cpi->common;
 | 
				
			||||||
@@ -343,9 +357,6 @@ void vp9_cyclic_refresh_setup(VP9_COMP *const cpi) {
 | 
				
			|||||||
    int qindex2;
 | 
					    int qindex2;
 | 
				
			||||||
    const double q = vp9_convert_qindex_to_q(cm->base_qindex, cm->bit_depth);
 | 
					    const double q = vp9_convert_qindex_to_q(cm->base_qindex, cm->bit_depth);
 | 
				
			||||||
    vp9_clear_system_state();
 | 
					    vp9_clear_system_state();
 | 
				
			||||||
    // Some of these parameters may be set via codec-control function later.
 | 
					 | 
				
			||||||
    cr->percent_refresh = 10;
 | 
					 | 
				
			||||||
    cr->rate_ratio_qdelta = 2.0;
 | 
					 | 
				
			||||||
    cr->max_qdelta_perc = 50;
 | 
					    cr->max_qdelta_perc = 50;
 | 
				
			||||||
    cr->min_block_size = BLOCK_8X8;
 | 
					    cr->min_block_size = BLOCK_8X8;
 | 
				
			||||||
    cr->time_for_refresh = 0;
 | 
					    cr->time_for_refresh = 0;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -53,6 +53,9 @@ void vp9_cyclic_refresh_update__map(struct VP9_COMP *const cpi);
 | 
				
			|||||||
// Update the actual number of blocks that were applied the segment delta q.
 | 
					// Update the actual number of blocks that were applied the segment delta q.
 | 
				
			||||||
void vp9_cyclic_refresh_update_actual_count(struct VP9_COMP *const cpi);
 | 
					void vp9_cyclic_refresh_update_actual_count(struct VP9_COMP *const cpi);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Set/update global/frame level refresh parameters.
 | 
				
			||||||
 | 
					void vp9_cyclic_refresh_update_parameters(struct VP9_COMP *const cpi);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Setup cyclic background refresh: set delta q and segmentation map.
 | 
					// Setup cyclic background refresh: set delta q and segmentation map.
 | 
				
			||||||
void vp9_cyclic_refresh_setup(struct VP9_COMP *const cpi);
 | 
					void vp9_cyclic_refresh_setup(struct VP9_COMP *const cpi);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1483,6 +1483,12 @@ void vp9_rc_get_svc_params(VP9_COMP *cpi) {
 | 
				
			|||||||
      target = calc_pframe_target_size_one_pass_cbr(cpi);
 | 
					      target = calc_pframe_target_size_one_pass_cbr(cpi);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Any update/change of global cyclic refresh parameters (amount/delta-qp)
 | 
				
			||||||
 | 
					  // should be done here, before the frame qp is selected.
 | 
				
			||||||
 | 
					  if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ)
 | 
				
			||||||
 | 
					    vp9_cyclic_refresh_update_parameters(cpi);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  vp9_rc_set_frame_target(cpi, target);
 | 
					  vp9_rc_set_frame_target(cpi, target);
 | 
				
			||||||
  rc->frames_till_gf_update_due = INT_MAX;
 | 
					  rc->frames_till_gf_update_due = INT_MAX;
 | 
				
			||||||
  rc->baseline_gf_interval = INT_MAX;
 | 
					  rc->baseline_gf_interval = INT_MAX;
 | 
				
			||||||
@@ -1516,6 +1522,11 @@ void vp9_rc_get_one_pass_cbr_params(VP9_COMP *cpi) {
 | 
				
			|||||||
    rc->gfu_boost = DEFAULT_GF_BOOST;
 | 
					    rc->gfu_boost = DEFAULT_GF_BOOST;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Any update/change of global cyclic refresh parameters (amount/delta-qp)
 | 
				
			||||||
 | 
					  // should be done here, before the frame qp is selected.
 | 
				
			||||||
 | 
					  if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ)
 | 
				
			||||||
 | 
					    vp9_cyclic_refresh_update_parameters(cpi);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (cm->frame_type == KEY_FRAME)
 | 
					  if (cm->frame_type == KEY_FRAME)
 | 
				
			||||||
    target = calc_iframe_target_size_one_pass_cbr(cpi);
 | 
					    target = calc_iframe_target_size_one_pass_cbr(cpi);
 | 
				
			||||||
  else
 | 
					  else
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user