Commit 21a0c1f3 authored by Marco Paniconi's avatar Marco Paniconi Committed by Gerrit Code Review

Merge "Don't use gf_update by default for 1-pass CBR."

parents b5af9d29 c46538d4
......@@ -2029,6 +2029,22 @@ void vp9_get_one_pass_params(VP9_COMP *cpi) {
}
}
void vp9_get_one_pass_cbr_params(VP9_COMP *cpi) {
VP9_COMMON *const cm = &cpi->common;
if ((cm->current_video_frame == 0 ||
cm->frame_flags & FRAMEFLAGS_KEY ||
cpi->rc.frames_to_key == 0 ||
(cpi->oxcf.auto_key && test_for_kf_one_pass(cpi)))) {
cm->frame_type = KEY_FRAME;
cpi->rc.frames_to_key = cpi->key_frame_frequency;
} else {
cm->frame_type = INTER_FRAME;
}
// Don't use gf_update by default in CBR mode.
cpi->rc.frames_till_gf_update_due = INT_MAX;
cpi->rc.baseline_gf_interval = INT_MAX;
}
void vp9_get_first_pass_params(VP9_COMP *cpi) {
VP9_COMMON *const cm = &cpi->common;
if (!cpi->refresh_alt_ref_frame &&
......
......@@ -22,6 +22,7 @@ void vp9_end_second_pass(VP9_COMP *cpi);
void vp9_get_first_pass_params(VP9_COMP *cpi);
void vp9_get_one_pass_params(VP9_COMP *cpi);
void vp9_get_one_pass_cbr_params(VP9_COMP *cpi);
void vp9_get_svc_params(VP9_COMP *cpi);
#endif // VP9_ENCODER_VP9_FIRSTPASS_H_
......@@ -3250,7 +3250,11 @@ static void SvcEncode(VP9_COMP *cpi, size_t *size, uint8_t *dest,
static void Pass0Encode(VP9_COMP *cpi, size_t *size, uint8_t *dest,
unsigned int *frame_flags) {
vp9_get_one_pass_params(cpi);
if (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) {
vp9_get_one_pass_cbr_params(cpi);
} else {
vp9_get_one_pass_params(cpi);
}
encode_frame_to_data_rate(cpi, size, dest, frame_flags);
}
......
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