cm->intra_only = 0;
// if the flags indicate intra frame, but if the current picture is for
// non-zero spatial layer, it should not be an intra picture.
- if ((source->flags & VPX_EFLAG_FORCE_KF) &&
- cpi->svc.spatial_layer_id > cpi->svc.first_spatial_layer_to_encode) {
+ if ((source->flags & VPX_EFLAG_FORCE_KF) && cpi->use_svc &&
+ cpi->svc.spatial_layer_id > 0) {
source->flags &= ~(unsigned int)(VPX_EFLAG_FORCE_KF);
}
cm->frame_type = INTER_FRAME;
if (is_one_pass_cbr_svc(cpi)) {
LAYER_CONTEXT *lc = &svc->layer_context[layer];
- if (svc->spatial_layer_id == svc->first_spatial_layer_to_encode) {
- lc->is_key_frame = 0;
- } else {
- lc->is_key_frame =
- svc->layer_context[svc->temporal_layer_id].is_key_frame;
- }
+ lc->is_key_frame =
+ svc->spatial_layer_id == 0
+ ? 0
+ : svc->layer_context[svc->temporal_layer_id].is_key_frame;
target = calc_pframe_target_size_one_pass_cbr(cpi);
}
}
svc->spatial_layer_id = 0;
svc->temporal_layer_id = 0;
- svc->first_spatial_layer_to_encode = 0;
svc->force_zero_mode_spatial_ref = 0;
svc->use_base_mv = 0;
svc->use_partition_reuse = 0;
int number_temporal_layers;
int spatial_layer_to_encode;
- int first_spatial_layer_to_encode;
// Workaround for multiple frame contexts
enum { ENCODED = 0, ENCODING, NEED_TO_ENCODE } encode_empty_frame_state;
VP9_COMP *const cpi = (VP9_COMP *)ctx->cpi;
SVC *const svc = &cpi->svc;
- svc->first_spatial_layer_to_encode = data->spatial_layer_id;
svc->spatial_layer_to_encode = data->spatial_layer_id;
svc->temporal_layer_id = data->temporal_layer_id;
// Checks on valid layer_id input.
svc->temporal_layer_id >= (int)ctx->cfg.ts_number_layers) {
return VPX_CODEC_INVALID_PARAM;
}
- 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;
- }
+
return VPX_CODEC_OK;
}