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

Remove the unneeded output_framerate from svc.

And change a parameter setting in vpx_temporal_scalable_patterns.

Change-Id: I7c208296ebcecbc8f73de032f6cdb26a1fc1442b
parent 35c18baa
...@@ -526,7 +526,7 @@ int main(int argc, char **argv) { ...@@ -526,7 +526,7 @@ int main(int argc, char **argv) {
// Enable error resilient mode. // Enable error resilient mode.
cfg.g_error_resilient = 1; cfg.g_error_resilient = 1;
cfg.g_lag_in_frames = 0; cfg.g_lag_in_frames = 0;
cfg.kf_mode = VPX_KF_DISABLED; cfg.kf_mode = VPX_KF_AUTO;
// Disable automatic keyframe placement. // Disable automatic keyframe placement.
cfg.kf_min_dist = cfg.kf_max_dist = 3000; cfg.kf_min_dist = cfg.kf_max_dist = 3000;
......
...@@ -1258,17 +1258,25 @@ static int calc_pframe_target_size_one_pass_cbr(const VP9_COMP *cpi) { ...@@ -1258,17 +1258,25 @@ static int calc_pframe_target_size_one_pass_cbr(const VP9_COMP *cpi) {
static int calc_iframe_target_size_one_pass_cbr(const VP9_COMP *cpi) { static int calc_iframe_target_size_one_pass_cbr(const VP9_COMP *cpi) {
const RATE_CONTROL *rc = &cpi->rc; const RATE_CONTROL *rc = &cpi->rc;
const VP9_CONFIG *oxcf = &cpi->oxcf;
const SVC *const svc = &cpi->svc;
int target; int target;
if (cpi->common.current_video_frame == 0) { if (cpi->common.current_video_frame == 0) {
target = ((cpi->oxcf.starting_buffer_level / 2) > INT_MAX) target = ((cpi->oxcf.starting_buffer_level / 2) > INT_MAX)
? INT_MAX : (int)(cpi->oxcf.starting_buffer_level / 2); ? INT_MAX : (int)(cpi->oxcf.starting_buffer_level / 2);
} else { } else {
const int initial_boost = 32; int kf_boost = 32;
int kf_boost = MAX(initial_boost, (int)(2 * cpi->output_framerate - 16)); double framerate = oxcf->framerate;
if (rc->frames_since_key < cpi->output_framerate / 2) { if (svc->number_temporal_layers > 1 &&
oxcf->end_usage == USAGE_STREAM_FROM_SERVER) {
// Use the layer framerate for temporal layers CBR mode.
const LAYER_CONTEXT *lc = &svc->layer_context[svc->temporal_layer_id];
framerate = lc->framerate;
}
kf_boost = MAX(kf_boost, (int)(2 * framerate - 16));
if (rc->frames_since_key < framerate / 2) {
kf_boost = (int)(kf_boost * rc->frames_since_key / kf_boost = (int)(kf_boost * rc->frames_since_key /
(cpi->output_framerate / 2)); (framerate / 2));
} }
target = ((16 + kf_boost) * rc->av_per_frame_bandwidth) >> 4; target = ((16 + kf_boost) * rc->av_per_frame_bandwidth) >> 4;
} }
......
...@@ -178,7 +178,6 @@ void vp9_restore_layer_context(VP9_COMP *const cpi) { ...@@ -178,7 +178,6 @@ void vp9_restore_layer_context(VP9_COMP *const cpi) {
cpi->oxcf.starting_buffer_level = lc->starting_buffer_level; cpi->oxcf.starting_buffer_level = lc->starting_buffer_level;
cpi->oxcf.optimal_buffer_level = lc->optimal_buffer_level; cpi->oxcf.optimal_buffer_level = lc->optimal_buffer_level;
cpi->oxcf.maximum_buffer_size = lc->maximum_buffer_size; cpi->oxcf.maximum_buffer_size = lc->maximum_buffer_size;
cpi->output_framerate = lc->framerate;
// Reset the frames_since_key and frames_to_key counters to their values // Reset the frames_since_key and frames_to_key counters to their values
// before the layer restore. Keep these defined for the stream (not layer). // before the layer restore. Keep these defined for the stream (not layer).
if (cpi->svc.number_temporal_layers > 1) { if (cpi->svc.number_temporal_layers > 1) {
...@@ -197,7 +196,6 @@ void vp9_save_layer_context(VP9_COMP *const cpi) { ...@@ -197,7 +196,6 @@ void vp9_save_layer_context(VP9_COMP *const cpi) {
lc->starting_buffer_level = oxcf->starting_buffer_level; lc->starting_buffer_level = oxcf->starting_buffer_level;
lc->optimal_buffer_level = oxcf->optimal_buffer_level; lc->optimal_buffer_level = oxcf->optimal_buffer_level;
lc->maximum_buffer_size = oxcf->maximum_buffer_size; lc->maximum_buffer_size = oxcf->maximum_buffer_size;
lc->framerate = cpi->output_framerate;
} }
void vp9_init_second_pass_spatial_svc(VP9_COMP *cpi) { void vp9_init_second_pass_spatial_svc(VP9_COMP *cpi) {
......
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