summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_encodeframe.c
diff options
context:
space:
mode:
authorMarco <marpan@google.com>2015-12-16 08:57:05 -0800
committerMarco <marpan@google.com>2015-12-16 13:38:41 -0800
commitf0961498a0e891b4a8929a90ca3b221027c7f524 (patch)
tree198d56c11f7b973aeda3e27a8ec5a1a3763d8517 /vp9/encoder/vp9_encodeframe.c
parentf73a511d37f75a3400e854e4b38bc2e2ba28687c (diff)
downloadlibvpx-f0961498a0e891b4a8929a90ca3b221027c7f524.tar
libvpx-f0961498a0e891b4a8929a90ca3b221027c7f524.tar.gz
libvpx-f0961498a0e891b4a8929a90ca3b221027c7f524.tar.bz2
libvpx-f0961498a0e891b4a8929a90ca3b221027c7f524.zip
vp9-svc: Fix to allow for 4x4 variance for low resolutions.
Change-Id: I3ec08e10d9ebf6d8b8a03004a320523f926e5cc4
Diffstat (limited to 'vp9/encoder/vp9_encodeframe.c')
-rw-r--r--vp9/encoder/vp9_encodeframe.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c
index 2a63b07a4..cc4d1f14e 100644
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -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;