| Index: source/libvpx/vp9/encoder/vp9_encodeframe.c
|
| diff --git a/source/libvpx/vp9/encoder/vp9_encodeframe.c b/source/libvpx/vp9/encoder/vp9_encodeframe.c
|
| index a8adca9ecf166ca65a2f88b702c8928223c6423d..49e8887687de34b4ab66403b2ebad58195ba45fb 100644
|
| --- a/source/libvpx/vp9/encoder/vp9_encodeframe.c
|
| +++ b/source/libvpx/vp9/encoder/vp9_encodeframe.c
|
| @@ -687,17 +687,28 @@ static int choose_partitioning(VP9_COMP *cpi,
|
| s = x->plane[0].src.buf;
|
| sp = x->plane[0].src.stride;
|
|
|
| - if (!is_key_frame) {
|
| + if (!is_key_frame && !(is_one_pass_cbr_svc(cpi) &&
|
| + cpi->svc.layer_context[cpi->svc.temporal_layer_id].is_key_frame)) {
|
| + // In the case of spatial/temporal scalable coding, the assumption here is
|
| + // that the temporal reference frame will always be of type LAST_FRAME.
|
| + // TODO(marpan): If that assumption is broken, we need to revisit this code.
|
| MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
|
| unsigned int uv_sad;
|
| const YV12_BUFFER_CONFIG *yv12 = get_ref_frame_buffer(cpi, LAST_FRAME);
|
|
|
| - const YV12_BUFFER_CONFIG *yv12_g = get_ref_frame_buffer(cpi, GOLDEN_FRAME);
|
| + const YV12_BUFFER_CONFIG *yv12_g = NULL;
|
| unsigned int y_sad, y_sad_g;
|
| const BLOCK_SIZE bsize = BLOCK_32X32
|
| + (mi_col + 4 < cm->mi_cols) * 2 + (mi_row + 4 < cm->mi_rows);
|
|
|
| assert(yv12 != NULL);
|
| +
|
| + if (!(is_one_pass_cbr_svc(cpi) && cpi->svc.spatial_layer_id)) {
|
| + // For now, GOLDEN will not be used for non-zero spatial layers, since
|
| + // it may not be a temporal reference.
|
| + yv12_g = get_ref_frame_buffer(cpi, GOLDEN_FRAME);
|
| + }
|
| +
|
| if (yv12_g && yv12_g != yv12) {
|
| vp9_setup_pre_planes(xd, 0, yv12_g, mi_row, mi_col,
|
| &cm->frame_refs[GOLDEN_FRAME - 1].sf);
|
| @@ -832,7 +843,9 @@ static int choose_partitioning(VP9_COMP *cpi,
|
| }
|
| }
|
| }
|
| - if (is_key_frame || (low_res &&
|
| + // TODO(marpan): There is an issue with variance based on 4x4 average in
|
| + // svc mode, don't allow it for now.
|
| + if (is_key_frame || (low_res && !cpi->use_svc &&
|
| vt.split[i].split[j].part_variances.none.variance >
|
| (thresholds[1] << 1))) {
|
| force_split[split_index] = 0;
|
|
|