Merge "[spatial svc] No need to code full width and height for non key frame"

This commit is contained in:
Minghai Shang 2014-05-05 23:21:53 -07:00 committed by Gerrit Code Review
commit e9f46ebd38
2 changed files with 19 additions and 3 deletions

View File

@ -1006,9 +1006,10 @@ static void write_frame_size_with_refs(VP9_COMP *cpi,
found = cm->width == cfg->y_crop_width &&
cm->height == cfg->y_crop_height;
// TODO(ivan): This prevents a bug while more than 3 buffers are used. Do it
// in a better way.
if (cpi->use_svc) {
// Set "found" to 0 for temporal svc and for spatial svc key frame
if (cpi->use_svc &&
(cpi->svc.number_spatial_layers == 1 ||
cpi->svc.layer_context[cpi->svc.spatial_layer_id].is_key_frame)) {
found = 0;
}
vp9_wb_write_bit(wb, found);

View File

@ -1308,11 +1308,26 @@ void vp9_rc_get_svc_params(VP9_COMP *cpi) {
cpi->oxcf.key_freq == 0))) {
cm->frame_type = KEY_FRAME;
rc->source_alt_ref_active = 0;
if (cpi->use_svc && cpi->svc.number_temporal_layers == 1) {
cpi->svc.layer_context[cpi->svc.spatial_layer_id].is_key_frame = 1;
}
if (cpi->pass == 0 && cpi->oxcf.rc_mode == RC_MODE_CBR) {
target = calc_iframe_target_size_one_pass_cbr(cpi);
}
} else {
cm->frame_type = INTER_FRAME;
if (cpi->use_svc && cpi->svc.number_temporal_layers == 1) {
LAYER_CONTEXT *lc = &cpi->svc.layer_context[cpi->svc.spatial_layer_id];
if (cpi->svc.spatial_layer_id == 0) {
lc->is_key_frame = 0;
} else {
lc->is_key_frame = cpi->svc.layer_context[0].is_key_frame;
}
}
if (cpi->pass == 0 && cpi->oxcf.rc_mode == RC_MODE_CBR) {
target = calc_pframe_target_size_one_pass_cbr(cpi);
}