From 09ed15d255d96e87ef388ddda7c276dd14042c37 Mon Sep 17 00:00:00 2001 From: Marco Paniconi Date: Mon, 26 Nov 2018 13:58:28 -0800 Subject: [PATCH] vp9-svc: Fix to skip enhancement layer setting If in constrained layer drop mode, avoid setting skip flag if base layer is dropped, as whole superframe will be dropped in this case. This avoids an assert trigger in the svc superframe packing. Change-Id: I51c953c7fee979790c65c798bac9bd3d805dc66f --- vp9/encoder/vp9_encoder.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index 7ced82186..cd3d7e713 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -4692,8 +4692,13 @@ 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. if (cpi->use_svc && cpi->svc.spatial_layer_id > 0 && - cpi->oxcf.target_bandwidth == 0) { + cpi->oxcf.target_bandwidth == 0 && + !(cpi->svc.framedrop_mode != LAYER_DROP && + cpi->svc.drop_spatial_layer[0])) { cpi->svc.skip_enhancement_layer = 1; vp9_rc_postencode_update_drop_frame(cpi); cpi->ext_refresh_frame_flags_pending = 0; -- 2.40.0