summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Paniconi <marpan@google.com>2018-06-25 09:02:24 -0700
committerMarco Paniconi <marpan@google.com>2018-06-25 09:11:23 -0700
commit3edef86c5f5651f4a89004012ec3efe3232351df (patch)
treec2c91999fb7921225286b998b1b402c81672d686
parentbd6b274dc04b75289ae3403564f03c2717b878d1 (diff)
downloadlibvpx-3edef86c5f5651f4a89004012ec3efe3232351df.tar
libvpx-3edef86c5f5651f4a89004012ec3efe3232351df.tar.gz
libvpx-3edef86c5f5651f4a89004012ec3efe3232351df.tar.bz2
libvpx-3edef86c5f5651f4a89004012ec3efe3232351df.zip
vp9-svc: Fix to frame dropping when layer is skipped.
Fix condition in frame dropper for SVC to handle case where spatial layer is skipped encoded (due to 0 bitrate). Change-Id: I24185178774d73e8bb1c406acc0292422dfbe174
-rw-r--r--vp9/encoder/vp9_ratectrl.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c
index fdc8e1494..cea13b027 100644
--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -414,9 +414,12 @@ static int check_buffer_above_thresh(VP9_COMP *cpi, int drop_mark) {
svc->number_temporal_layers);
LAYER_CONTEXT *lc = &svc->layer_context[layer];
RATE_CONTROL *lrc = &lc->rc;
- const int drop_mark_layer =
- (int)(cpi->svc.framedrop_thresh[i] * lrc->optimal_buffer_level / 100);
- if (!(lrc->buffer_level > drop_mark_layer)) return 0;
+ // Exclude check for layer whose bitrate is 0.
+ if (lc->target_bandwidth > 0) {
+ const int drop_mark_layer = (int)(cpi->svc.framedrop_thresh[i] *
+ lrc->optimal_buffer_level / 100);
+ if (!(lrc->buffer_level > drop_mark_layer)) return 0;
+ }
}
return 1;
}
@@ -439,12 +442,15 @@ static int check_buffer_below_thresh(VP9_COMP *cpi, int drop_mark) {
svc->number_temporal_layers);
LAYER_CONTEXT *lc = &svc->layer_context[layer];
RATE_CONTROL *lrc = &lc->rc;
- const int drop_mark_layer =
- (int)(cpi->svc.framedrop_thresh[i] * lrc->optimal_buffer_level / 100);
- if (cpi->svc.framedrop_mode == FULL_SUPERFRAME_DROP) {
- if (lrc->buffer_level <= drop_mark_layer) return 1;
- } else {
- if (!(lrc->buffer_level <= drop_mark_layer)) return 0;
+ // Exclude check for layer whose bitrate is 0.
+ if (lc->target_bandwidth > 0) {
+ const int drop_mark_layer = (int)(cpi->svc.framedrop_thresh[i] *
+ lrc->optimal_buffer_level / 100);
+ if (cpi->svc.framedrop_mode == FULL_SUPERFRAME_DROP) {
+ if (lrc->buffer_level <= drop_mark_layer) return 1;
+ } else {
+ if (!(lrc->buffer_level <= drop_mark_layer)) return 0;
+ }
}
}
if (cpi->svc.framedrop_mode == FULL_SUPERFRAME_DROP)