vp9: 1 pass: Move source sad computation into encodeframe loop.

Refactor to split the 1 passs source sad computation into scene
detection (currently used for VBR and screen-content mode), and
superblock based source sad computation (used in non-rd CBR mode).

This allows the source sad computation for CBR mode to be
multi-threaded.

No change in compression.

Change-Id: I112f2918613ccbd37c1771d852606d3af18c1388
This commit is contained in:
Marco
2017-03-23 14:37:47 -07:00
parent 07ad5a15c2
commit 66c6b4d6fc
7 changed files with 83 additions and 63 deletions

View File

@@ -512,12 +512,9 @@ static void set_rt_speed_feature_framesize_independent(
}
if (!cpi->external_resize) sf->use_source_sad = 1;
if (sf->use_source_sad) {
// For SVC allocate for top layer.
if (cpi->content_state_sb == NULL &&
if (cpi->content_state_sb_fd == NULL &&
(!cpi->use_svc ||
cpi->svc.spatial_layer_id == cpi->svc.number_spatial_layers - 1)) {
cpi->content_state_sb = (uint8_t *)vpx_calloc(
(cm->mi_stride >> 3) * ((cm->mi_rows >> 3) + 1), sizeof(uint8_t));
cpi->content_state_sb_fd = (uint8_t *)vpx_calloc(
(cm->mi_stride >> 3) * ((cm->mi_rows >> 3) + 1), sizeof(uint8_t));
}