diff options
Diffstat (limited to 'vp9')
-rw-r--r-- | vp9/encoder/vp9_onyx_if.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c index ad214c709..b664f1e99 100644 --- a/vp9/encoder/vp9_onyx_if.c +++ b/vp9/encoder/vp9_onyx_if.c @@ -2866,7 +2866,7 @@ static int pick_q_and_adjust_q_bounds(VP9_COMP *cpi, cpi->active_best_quality = inter_minq[q]; // 1-pass: for now, use the average Q for the active_best, if its lower // than active_worst. - if (cpi->pass == 0 && (cpi->avg_frame_qindex < cpi->active_worst_quality)) + if (cpi->pass == 0 && (cpi->avg_frame_qindex < q)) cpi->active_best_quality = inter_minq[cpi->avg_frame_qindex]; #endif @@ -2902,7 +2902,14 @@ static int pick_q_and_adjust_q_bounds(VP9_COMP *cpi, if (cm->frame_type == KEY_FRAME && !cpi->this_key_frame_forced) { *top_index = (cpi->active_worst_quality + cpi->active_best_quality * 3) / 4; + // If this is the first (key) frame in 1-pass, active best is the user + // best-allowed, and leave the top_index to active_worst. + if (cpi->pass == 0 && cpi->common.current_video_frame == 0) { + cpi->active_best_quality = cpi->oxcf.best_allowed_q; + *top_index = cpi->oxcf.worst_allowed_q; + } } else if (!cpi->is_src_frame_alt_ref && + (cpi->oxcf.end_usage != USAGE_STREAM_FROM_SERVER) && (cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame)) { *top_index = (cpi->active_worst_quality + cpi->active_best_quality) / 2; |