summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorMarco Paniconi <marpan@google.com>2018-05-07 22:54:48 -0700
committerMarco Paniconi <marpan@google.com>2018-05-11 09:39:29 -0700
commitf362bf981c4648b426aa2a0735d4fb6bda4136c0 (patch)
tree172a1478aba4ec76c58cb390580fb405a801ce06 /vp9
parentaf355dacd568dfe5c109ae2d6d22104f94cdcf7f (diff)
downloadlibvpx-f362bf981c4648b426aa2a0735d4fb6bda4136c0.tar
libvpx-f362bf981c4648b426aa2a0735d4fb6bda4136c0.tar.gz
libvpx-f362bf981c4648b426aa2a0735d4fb6bda4136c0.tar.bz2
libvpx-f362bf981c4648b426aa2a0735d4fb6bda4136c0.zip
vp9-svc: Fix when whole superframe is dropped.
When the whole superframe is dropped (due to rate control), don't increment the temporal layer counter. This is a temporary fix to prevent an issue where temporal prediction pattern is possibly broken. Updated svc_datarate tests to handle this case. Change-Id: Icac44fdc9d0f08a957776c937584db4b2c7927c7
Diffstat (limited to 'vp9')
-rw-r--r--vp9/encoder/vp9_encoder.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c
index 3384de7ea..13f01a3ab 100644
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -4560,8 +4560,18 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi, size_t *size,
if (cpi->use_svc) {
cpi->svc.last_layer_dropped[cpi->svc.spatial_layer_id] = 1;
cpi->svc.drop_spatial_layer[cpi->svc.spatial_layer_id] = 1;
- vp9_inc_frame_in_layer(cpi);
cpi->svc.skip_enhancement_layer = 1;
+ if (cpi->svc.framedrop_mode != CONSTRAINED_LAYER_DROP ||
+ cpi->svc.drop_spatial_layer[0] == 0) {
+ // For the case of CONSTRAINED_LAYER_DROP 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);
+ }
if (cpi->svc.spatial_layer_id == cpi->svc.number_spatial_layers - 1) {
int i;
int all_layers_drop = 1;