vp9-svc: Set initial values for ext_buffer/flag indices.

Set initial values for these parameters in the vp9_init_layer_context().

This also fixes an issue in the svc-bypass mode when frame flags are
passed via the vpx_codec_encode().

Change-Id: I0968f04672f8d3d2fe2cea6b8a23f79f80d7a8b1
This commit is contained in:
Marco 2016-01-04 12:19:56 -08:00
Родитель b8c2a4eb0c
Коммит e5dfca02a9
1 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -36,6 +36,12 @@ void vp9_init_layer_context(VP9_COMP *const cpi) {
svc->current_superframe = 0;
for (i = 0; i < REF_FRAMES; ++i)
svc->ref_frame_index[i] = -1;
for (sl = 0; sl < oxcf->ss_number_layers; ++sl) {
cpi->svc.ext_frame_flags[sl] = 0;
cpi->svc.ext_lst_fb_idx[sl] = 0;
cpi->svc.ext_gld_fb_idx[sl] = 1;
cpi->svc.ext_alt_fb_idx[sl] = 2;
}
if (cpi->oxcf.error_resilient_mode == 0 && cpi->oxcf.pass == 2) {
if (vpx_realloc_frame_buffer(&cpi->svc.empty_frame.img,
@ -566,6 +572,8 @@ int vp9_one_pass_cbr_svc_start_layer(VP9_COMP *const cpi) {
// Note that the check (cpi->ext_refresh_frame_flags_pending == 0) is
// needed to support the case where the frame flags may be passed in via
// vpx_codec_encode(), which can be used for the temporal-only svc case.
// TODO(marpan): Consider adding an enc_config parameter to better handle
// this case.
if (cpi->ext_refresh_frame_flags_pending == 0) {
int sl;
cpi->svc.spatial_layer_id = cpi->svc.spatial_layer_to_encode;