// non-zero spatial layer, it should not be an intra picture.
// TODO(Won Kap): this needs to change if per-layer intra frame is
// allowed.
- if ((source->flags & VPX_EFLAG_FORCE_KF) && cpi->svc.spatial_layer_id) {
+ if ((source->flags & VPX_EFLAG_FORCE_KF) &&
+ cpi->svc.spatial_layer_id > cpi->svc.first_spatial_layer_to_encode) {
source->flags &= ~(unsigned int)(VPX_EFLAG_FORCE_KF);
}
cpi->ref_frame_flags &= (~VP9_ALT_FLAG);
} else if (is_one_pass_cbr_svc(cpi)) {
LAYER_CONTEXT *lc = &cpi->svc.layer_context[layer];
- if (cpi->svc.spatial_layer_id == 0) {
+ if (cpi->svc.spatial_layer_id == cpi->svc.first_spatial_layer_to_encode) {
lc->is_key_frame = 0;
} else {
lc->is_key_frame =
svc->spatial_layer_id = 0;
svc->temporal_layer_id = 0;
+ svc->first_spatial_layer_to_encode = 0;
if (cpi->oxcf.error_resilient_mode == 0 && cpi->oxcf.pass == 2) {
if (vpx_realloc_frame_buffer(&cpi->svc.empty_frame.img,
int number_temporal_layers;
int spatial_layer_to_encode;
+ int first_spatial_layer_to_encode;
// Workaround for multiple frame contexts
enum {
VP9_COMP *const cpi = (VP9_COMP *)ctx->cpi;
SVC *const svc = &cpi->svc;
- svc->spatial_layer_id = data->spatial_layer_id;
+ svc->first_spatial_layer_to_encode = data->spatial_layer_id;
svc->temporal_layer_id = data->temporal_layer_id;
// Checks on valid layer_id input.
if (svc->temporal_layer_id < 0 ||
svc->temporal_layer_id >= (int)ctx->cfg.ts_number_layers) {
return VPX_CODEC_INVALID_PARAM;
}
- if (svc->spatial_layer_id < 0 ||
- svc->spatial_layer_id >= (int)ctx->cfg.ss_number_layers) {
+ if (svc->first_spatial_layer_to_encode < 0 ||
+ svc->first_spatial_layer_to_encode >= (int)ctx->cfg.ss_number_layers) {
return VPX_CODEC_INVALID_PARAM;
}
+ // First spatial layer to encode not implemented for two-pass.
+ if (is_two_pass_svc(cpi) && svc->first_spatial_layer_to_encode > 0)
+ return VPX_CODEC_INVALID_PARAM;
return VPX_CODEC_OK;
}