Commit c46538d4 authored by Marco Paniconi's avatar Marco Paniconi
Browse files

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

Change-Id: I5df6abceb0a2a69706feadeb820b593cae88f573
parent a84029ad
......@@ -2024,6 +2024,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_
......@@ -3313,7 +3313,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) {
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