]> granicus.if.org Git - libvpx/commitdiff
rtc-vp9: Fix to rcstats in vp9_spatial_svc_encoder
authorMarco Paniconi <marpan@google.com>
Tue, 18 Aug 2020 04:49:41 +0000 (21:49 -0700)
committerMarco Paniconi <marpan@google.com>
Tue, 18 Aug 2020 04:52:12 +0000 (21:52 -0700)
Fixes the rcstats for case when #spatial_layers = 1.

Change-Id: Ie28d99852033307bc4c69c7e738e1d4cab4e8cf5

examples/vp9_spatial_svc_encoder.c

index b987989a86cf1f1149db87e6db5f28d70684c9f2..f273c1208a1e4a19f159d3170aadd0da4d26aa10 100644 (file)
@@ -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) {