Commit 591e383d authored by Dmitry Kovalev's avatar Dmitry Kovalev
Browse files

Adding temp variable q to vp9_cyclic_refresh_setup().

Change-Id: If0e9c811c8ae78c0914d615bad0067a5b57e4a71
parent dc89e9b0
...@@ -200,6 +200,7 @@ void vp9_cyclic_refresh_setup(VP9_COMP *const cpi) { ...@@ -200,6 +200,7 @@ void vp9_cyclic_refresh_setup(VP9_COMP *const cpi) {
// Rate target ratio to set q delta. // Rate target ratio to set q delta.
const float rate_ratio_qdelta = 2.0; const float rate_ratio_qdelta = 2.0;
const double q = vp9_convert_qindex_to_q(cm->base_qindex);
vp9_clear_system_state(); vp9_clear_system_state();
// Some of these parameters may be set via codec-control function later. // Some of these parameters may be set via codec-control function later.
cr->max_sbs_perframe = 10; cr->max_sbs_perframe = 10;
...@@ -209,14 +210,12 @@ void vp9_cyclic_refresh_setup(VP9_COMP *const cpi) { ...@@ -209,14 +210,12 @@ void vp9_cyclic_refresh_setup(VP9_COMP *const cpi) {
// Set rate threshold to some fraction of target (and scaled by 256). // Set rate threshold to some fraction of target (and scaled by 256).
cr->thresh_rate_sb = (rc->sb64_target_rate * 256) >> 2; cr->thresh_rate_sb = (rc->sb64_target_rate * 256) >> 2;
// Distortion threshold, quadratic in Q, scale factor to be adjusted. // Distortion threshold, quadratic in Q, scale factor to be adjusted.
cr->thresh_dist_sb = 8 * (int)(vp9_convert_qindex_to_q(cm->base_qindex) * cr->thresh_dist_sb = 8 * (int)(q * q);
vp9_convert_qindex_to_q(cm->base_qindex));
if (cpi->sf.use_nonrd_pick_mode) { if (cpi->sf.use_nonrd_pick_mode) {
// May want to be more conservative with thresholds in non-rd mode for now // 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. // as rate/distortion are derived from model based on prediction residual.
cr->thresh_rate_sb = (rc->sb64_target_rate * 256) >> 3; cr->thresh_rate_sb = (rc->sb64_target_rate * 256) >> 3;
cr->thresh_dist_sb = 4 * (int)(vp9_convert_qindex_to_q(cm->base_qindex) * cr->thresh_dist_sb = 4 * (int)(q * q);
vp9_convert_qindex_to_q(cm->base_qindex));
} }
cr->num_seg_blocks = 0; cr->num_seg_blocks = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment