vp9-svc: Add condition on allocation for scaled_temp.

scaled_temp frame is used as an intermediate buffer for
2 stage down-sampling: two stages of 1/2 down-sampling
for a target of 1/4x1/4. This is used in 3 layer SVC
to avoid duplicate frame downsampling (on middle layer).

As this allocation is only needed/used when the
number_spatial_layers > 2, add this condition to avoid
unneeded allocation for 1 and 2 spatial SVC.

Change-Id: If342466644f685c1ea3ca5344b581793e5136c09
This commit is contained in:
Marco 2018-01-31 15:15:40 -08:00
parent 2c950e131c
commit cb16652598

View File

@ -1121,8 +1121,9 @@ static void alloc_util_frame_buffers(VP9_COMP *cpi) {
// For 1 pass cbr: allocate scaled_frame that may be used as an intermediate
// buffer for a 2 stage down-sampling: two stages of 1:2 down-sampling for a
// target of 1/4x1/4.
if (is_one_pass_cbr_svc(cpi) && !cpi->svc.scaled_temp_is_alloc) {
// target of 1/4x1/4. number_spatial_layers must be greater than 2.
if (is_one_pass_cbr_svc(cpi) && !cpi->svc.scaled_temp_is_alloc &&
cpi->svc.number_spatial_layers > 2) {
cpi->svc.scaled_temp_is_alloc = 1;
if (vpx_realloc_frame_buffer(
&cpi->svc.scaled_temp, cm->width >> 1, cm->height >> 1,