ref: 45d303632b696115a9d5a36611b594c0d63afed9
parent: 0aaf170c13e408a8c2be2e0275538744dde30249
parent: 545f096ef23d4f70062379d9c4184b15189c2143
author: Marco Paniconi <marpan@google.com>
date: Mon Nov 26 23:48:05 EST 2018
Merge "VP9 SVC: fix crash on scaling partition."
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -930,7 +930,9 @@
PARTITION_TYPE partition_high;
if (mi_row_high >= cm->mi_rows || mi_col_high >= cm->mi_cols) return 0;
- if (mi_row >= (cm->mi_rows >> 1) || mi_col >= (cm->mi_cols >> 1)) return 0;
+ if (mi_row >= svc->mi_rows[svc->spatial_layer_id - 1] ||
+ mi_col >= svc->mi_cols[svc->spatial_layer_id - 1])
+ return 0;
// Find corresponding (mi_col/mi_row) block down-scaled by 2x2.
start_pos = mi_row * (svc->mi_stride[svc->spatial_layer_id - 1]) + mi_col;
@@ -5658,7 +5660,6 @@
xd->mi = cm->mi_grid_visible;
xd->mi[0] = cm->mi;
-
vp9_zero(*td->counts);
vp9_zero(cpi->td.rd_counts);
--- a/vp9/encoder/vp9_speed_features.c
+++ b/vp9/encoder/vp9_speed_features.c
@@ -713,8 +713,7 @@
// TODO(jianj): Investigate webm:1578
if (cpi->use_svc && cpi->svc.use_partition_reuse &&
cpi->svc.number_spatial_layers == 3 && cpi->svc.temporal_layer_id > 0 &&
- cpi->oxcf.width * cpi->oxcf.height > 640 * 480 &&
- cpi->oxcf.width * cpi->oxcf.height < 1920 * 1080)
+ cpi->oxcf.width * cpi->oxcf.height > 640 * 480)
sf->svc_use_lowres_part = 1;
// For SVC when golden is used as second temporal reference: to avoid
// encode time increase only use this feature on base temporal layer.
--- a/vp9/encoder/vp9_svc_layercontext.c
+++ b/vp9/encoder/vp9_svc_layercontext.c
@@ -737,6 +737,8 @@
}
svc->force_zero_mode_spatial_ref = 1;
svc->mi_stride[svc->spatial_layer_id] = cpi->common.mi_stride;
+ svc->mi_rows[svc->spatial_layer_id] = cpi->common.mi_rows;
+ svc->mi_cols[svc->spatial_layer_id] = cpi->common.mi_cols;
if (svc->temporal_layering_mode == VP9E_TEMPORAL_LAYERING_MODE_0212) {
set_flags_and_fb_idx_for_temporal_mode3(cpi);
--- a/vp9/encoder/vp9_svc_layercontext.h
+++ b/vp9/encoder/vp9_svc_layercontext.h
@@ -125,6 +125,8 @@
BLOCK_SIZE *prev_partition_svc;
int mi_stride[VPX_MAX_LAYERS];
+ int mi_rows[VPX_MAX_LAYERS];
+ int mi_cols[VPX_MAX_LAYERS];
int first_layer_denoise;