summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_encoder.c
diff options
context:
space:
mode:
authorMarco Paniconi <marpan@google.com>2018-05-24 11:13:36 -0700
committerMarco Paniconi <marpan@google.com>2018-05-24 15:19:47 -0700
commitfc1c5d1c9cba8829995c68d07e827bc9bcccd9e8 (patch)
tree0f3339bd07c95f463af8d2219413f6a63673e252 /vp9/encoder/vp9_encoder.c
parent8446af7e9a12c5725e845564f40272dd9185c1cc (diff)
downloadlibvpx-fc1c5d1c9cba8829995c68d07e827bc9bcccd9e8.tar
libvpx-fc1c5d1c9cba8829995c68d07e827bc9bcccd9e8.tar.gz
libvpx-fc1c5d1c9cba8829995c68d07e827bc9bcccd9e8.tar.bz2
libvpx-fc1c5d1c9cba8829995c68d07e827bc9bcccd9e8.zip
vp9-svc: Add max_consec_drop to SVC frame drop.
For any spatial, limits the amount of consecutive frame drop. Change-Id: I692d90363f329f571f2b59e12cc680ad2e76065d
Diffstat (limited to 'vp9/encoder/vp9_encoder.c')
-rw-r--r--vp9/encoder/vp9_encoder.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c
index f5b7b1264..97e632165 100644
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -4594,24 +4594,26 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi, size_t *size,
cm->frame_type != KEY_FRAME &&
(!cpi->use_svc ||
!cpi->svc.layer_context[cpi->svc.temporal_layer_id].is_key_frame)) {
+ SVC *svc = &cpi->svc;
int svc_prev_layer_dropped = 0;
// In the constrained or full_superframe framedrop mode for svc
// (framedrop_mode != LAYER_DROP), if the previous spatial layer was
// dropped, drop the current spatial layer.
- if (cpi->use_svc && cpi->svc.spatial_layer_id > 0 &&
- cpi->svc.drop_spatial_layer[cpi->svc.spatial_layer_id - 1])
+ if (cpi->use_svc && svc->spatial_layer_id > 0 &&
+ svc->drop_spatial_layer[svc->spatial_layer_id - 1])
svc_prev_layer_dropped = 1;
- if ((svc_prev_layer_dropped && cpi->svc.framedrop_mode != LAYER_DROP) ||
+ if ((svc_prev_layer_dropped && svc->framedrop_mode != LAYER_DROP) ||
vp9_rc_drop_frame(cpi)) {
vp9_rc_postencode_update_drop_frame(cpi);
cpi->ext_refresh_frame_flags_pending = 0;
cpi->last_frame_dropped = 1;
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;
- cpi->svc.skip_enhancement_layer = 1;
- if (cpi->svc.framedrop_mode == LAYER_DROP ||
- cpi->svc.drop_spatial_layer[0] == 0) {
+ svc->last_layer_dropped[svc->spatial_layer_id] = 1;
+ svc->drop_spatial_layer[svc->spatial_layer_id] = 1;
+ svc->drop_count[svc->spatial_layer_id]++;
+ svc->skip_enhancement_layer = 1;
+ if (svc->framedrop_mode == LAYER_DROP ||
+ 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
@@ -4621,16 +4623,16 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi, size_t *size,
// 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) {
+ if (svc->spatial_layer_id == svc->number_spatial_layers - 1) {
int i;
int all_layers_drop = 1;
- for (i = 0; i < cpi->svc.spatial_layer_id; i++) {
- if (cpi->svc.drop_spatial_layer[i] == 0) {
+ for (i = 0; i < svc->spatial_layer_id; i++) {
+ if (svc->drop_spatial_layer[i] == 0) {
all_layers_drop = 0;
break;
}
}
- if (all_layers_drop == 1) cpi->svc.skip_enhancement_layer = 0;
+ if (all_layers_drop == 1) svc->skip_enhancement_layer = 0;
}
}
return;