if (cpi->svc.spatial_layer_id == 0 && src_width == last_src_width &&
src_height == last_src_height) {
YV12_BUFFER_CONFIG *frames[MAX_LAG_BUFFERS] = { NULL };
+ int num_mi_cols = cm->mi_cols;
+ int num_mi_rows = cm->mi_rows;
int start_frame = 0;
int frames_to_buffer = 1;
int frame = 0;
min_thresh = 65000;
thresh = 2.1f;
}
+ if (cpi->use_svc && cpi->svc.number_spatial_layers > 1) {
+ const int aligned_width = ALIGN_POWER_OF_TWO(src_width, MI_SIZE_LOG2);
+ const int aligned_height = ALIGN_POWER_OF_TWO(src_height, MI_SIZE_LOG2);
+ num_mi_cols = aligned_width >> MI_SIZE_LOG2;
+ num_mi_rows = aligned_height >> MI_SIZE_LOG2;
+ }
if (cpi->oxcf.lag_in_frames > 0) {
frames_to_buffer = (cm->current_video_frame == 1)
? (int)vp9_lookahead_depth(cpi->lookahead) - 1
uint64_t avg_sad = 0;
uint64_t tmp_sad = 0;
int num_samples = 0;
- int sb_cols = (cm->mi_cols + MI_BLOCK_SIZE - 1) / MI_BLOCK_SIZE;
- int sb_rows = (cm->mi_rows + MI_BLOCK_SIZE - 1) / MI_BLOCK_SIZE;
+ int sb_cols = (num_mi_cols + MI_BLOCK_SIZE - 1) / MI_BLOCK_SIZE;
+ int sb_rows = (num_mi_rows + MI_BLOCK_SIZE - 1) / MI_BLOCK_SIZE;
if (cpi->oxcf.lag_in_frames > 0) {
src_y = frames[frame]->y_buffer;
src_ystride = frames[frame]->y_stride;
if (avg_sad >
VPXMAX(min_thresh,
(unsigned int)(rc->avg_source_sad[0] * thresh)) &&
- rc->frames_since_key > 1 &&
+ rc->frames_since_key > 1 + cpi->svc.number_spatial_layers &&
num_zero_temp_sad < 3 * (num_samples >> 2))
rc->high_source_sad = 1;
else