summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMarco Paniconi <marpan@google.com>2020-08-17 21:49:41 -0700
committerMarco Paniconi <marpan@google.com>2020-08-17 21:52:12 -0700
commit529c29bb0f6511a9b3e25177cece0d843827458b (patch)
tree762c7f35fae603796dd07f97f38edc35258b7d59 /examples
parent2d20a42ab60f8fed37612361f2ea776d0bc7ca1a (diff)
downloadlibvpx-529c29bb0f6511a9b3e25177cece0d843827458b.tar
libvpx-529c29bb0f6511a9b3e25177cece0d843827458b.tar.gz
libvpx-529c29bb0f6511a9b3e25177cece0d843827458b.tar.bz2
libvpx-529c29bb0f6511a9b3e25177cece0d843827458b.zip
rtc-vp9: Fix to rcstats in vp9_spatial_svc_encoder
Fixes the rcstats for case when #spatial_layers = 1. Change-Id: Ie28d99852033307bc4c69c7e738e1d4cab4e8cf5
Diffstat (limited to 'examples')
-rw-r--r--examples/vp9_spatial_svc_encoder.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/examples/vp9_spatial_svc_encoder.c b/examples/vp9_spatial_svc_encoder.c
index b987989a8..f273c1208 100644
--- a/examples/vp9_spatial_svc_encoder.c
+++ b/examples/vp9_spatial_svc_encoder.c
@@ -828,12 +828,15 @@ static void svc_output_rc_stats(
vpx_codec_control(codec, VP9E_GET_SVC_LAYER_ID, layer_id);
parse_superframe_index(cx_pkt->data.frame.buf, cx_pkt->data.frame.sz,
sizes_parsed, &count);
- if (enc_cfg->ss_number_layers == 1) sizes[0] = cx_pkt->data.frame.sz;
- for (sl = 0; sl < enc_cfg->ss_number_layers; ++sl) {
- sizes[sl] = 0;
- if (cx_pkt->data.frame.spatial_layer_encoded[sl]) {
- sizes[sl] = sizes_parsed[num_layers_encoded];
- num_layers_encoded++;
+ if (enc_cfg->ss_number_layers == 1) {
+ sizes[0] = cx_pkt->data.frame.sz;
+ } else {
+ for (sl = 0; sl < enc_cfg->ss_number_layers; ++sl) {
+ sizes[sl] = 0;
+ if (cx_pkt->data.frame.spatial_layer_encoded[sl]) {
+ sizes[sl] = sizes_parsed[num_layers_encoded];
+ num_layers_encoded++;
+ }
}
}
for (sl = 0; sl < enc_cfg->ss_number_layers; ++sl) {