From 5a0242ba5c8fddbf32766bfa2ffbbd25f3cd6167 Mon Sep 17 00:00:00 2001 From: Marco Paniconi Date: Fri, 30 Aug 2019 10:58:15 -0700 Subject: vp9-svc: Add new frame drop mode for SVC add SVC framedrop mode: Lower spatial layers are constrained to drop if current spatial layer needs to drop. No change in behavior to other existing modes. Change-Id: I2d37959caf8c4b453b405904831b550367f716ba --- vp9/encoder/vp9_encoder.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'vp9/encoder/vp9_encoder.c') diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index 25464b3b8..c18e3d5aa 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -4982,12 +4982,15 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi, size_t *size, TX_SIZE t; // SVC: skip encoding of enhancement layer if the layer target bandwidth = 0. - // If in constrained layer drop mode (svc.framedrop_mode != LAYER_DROP) and - // base spatial layer was dropped, no need to set svc.skip_enhancement_layer, - // as whole superframe will be dropped. + // No need to set svc.skip_enhancement_layer if whole superframe will be + // dropped. if (cpi->use_svc && cpi->svc.spatial_layer_id > 0 && cpi->oxcf.target_bandwidth == 0 && !(cpi->svc.framedrop_mode != LAYER_DROP && + (cpi->svc.framedrop_mode != CONSTRAINED_FROM_ABOVE_DROP || + cpi->svc + .force_drop_constrained_from_above[cpi->svc.number_spatial_layers - + 1]) && cpi->svc.drop_spatial_layer[0])) { cpi->svc.skip_enhancement_layer = 1; vp9_rc_postencode_update_drop_frame(cpi); @@ -4995,17 +4998,7 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi, size_t *size, cpi->last_frame_dropped = 1; cpi->svc.last_layer_dropped[cpi->svc.spatial_layer_id] = 1; cpi->svc.drop_spatial_layer[cpi->svc.spatial_layer_id] = 1; - if (cpi->svc.framedrop_mode == LAYER_DROP || - cpi->svc.drop_spatial_layer[0] == 0) { - // For the case of constrained drop mode where the base is dropped - // (drop_spatial_layer[0] == 1), which means full superframe dropped, - // we don't increment the svc frame counters. In particular temporal - // layer counter (which is incremented in vp9_inc_frame_in_layer()) - // won't be incremented, so on a dropped frame we try the same - // temporal_layer_id on next incoming frame. This is to avoid an - // issue with temporal alignement with full superframe dropping. - vp9_inc_frame_in_layer(cpi); - } + vp9_inc_frame_in_layer(cpi); return; } -- cgit v1.2.3