Merge "vp9-svc: Fix to allow for 4x4 variance for low resolutions."

This commit is contained in:
Marco Paniconi 2015-12-16 23:04:26 +00:00 committed by Gerrit Code Review
commit 685a6b602b

View File

@ -680,9 +680,13 @@ static int choose_partitioning(VP9_COMP *cpi,
int64_t thresholds[4] = {cpi->vbp_thresholds[0], cpi->vbp_thresholds[1],
cpi->vbp_thresholds[2], cpi->vbp_thresholds[3]};
// For the variance computation under SVC mode, we treat the frame as key if
// the reference (base layer frame) is key frame (i.e., is_key_frame == 1).
const int is_key_frame = (cm->frame_type == KEY_FRAME ||
(is_one_pass_cbr_svc(cpi) &&
cpi->svc.layer_context[cpi->svc.temporal_layer_id].is_key_frame));
// Always use 4x4 partition for key frame.
const int is_key_frame = (cm->frame_type == KEY_FRAME);
const int use_4x4_partition = is_key_frame;
const int use_4x4_partition = cm->frame_type == KEY_FRAME;
const int low_res = (cm->width <= 352 && cm->height <= 288);
int variance4x4downsample[16];
@ -708,8 +712,7 @@ static int choose_partitioning(VP9_COMP *cpi,
s = x->plane[0].src.buf;
sp = x->plane[0].src.stride;
if (!is_key_frame && !(is_one_pass_cbr_svc(cpi) &&
cpi->svc.layer_context[cpi->svc.temporal_layer_id].is_key_frame)) {
if (!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.
@ -868,9 +871,7 @@ static int choose_partitioning(VP9_COMP *cpi,
}
}
}
// 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 &&
if (is_key_frame || (low_res &&
vt.split[i].split[j].part_variances.none.variance >
(thresholds[1] << 1))) {
force_split[split_index] = 0;