summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_encoder.c
diff options
context:
space:
mode:
authorMarco Paniconi <marpan@google.com>2019-08-30 10:58:15 -0700
committerMarco Paniconi <marpan@google.com>2019-09-06 10:16:57 -0700
commit5a0242ba5c8fddbf32766bfa2ffbbd25f3cd6167 (patch)
treeb3b4a244ce8c45b4f43a3a6dd9947bbcf4c9d08d /vp9/encoder/vp9_encoder.c
parentbacb32aef5cfebae1d616b53c83a8293a786fd0a (diff)
downloadlibvpx-5a0242ba5c8fddbf32766bfa2ffbbd25f3cd6167.tar
libvpx-5a0242ba5c8fddbf32766bfa2ffbbd25f3cd6167.tar.gz
libvpx-5a0242ba5c8fddbf32766bfa2ffbbd25f3cd6167.tar.bz2
libvpx-5a0242ba5c8fddbf32766bfa2ffbbd25f3cd6167.zip
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
Diffstat (limited to 'vp9/encoder/vp9_encoder.c')
-rw-r--r--vp9/encoder/vp9_encoder.c21
1 files changed, 7 insertions, 14 deletions
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;
}