shithub: libvpx

Download patch

ref: 529c29bb0f6511a9b3e25177cece0d843827458b
parent: 2d20a42ab60f8fed37612361f2ea776d0bc7ca1a
author: Marco Paniconi <marpan@google.com>
date: Mon Aug 17 17:49:41 EDT 2020

rtc-vp9: Fix to rcstats in vp9_spatial_svc_encoder

Fixes the rcstats for case when #spatial_layers = 1.

Change-Id: Ie28d99852033307bc4c69c7e738e1d4cab4e8cf5

--- a/examples/vp9_spatial_svc_encoder.c
+++ b/examples/vp9_spatial_svc_encoder.c
@@ -828,12 +828,15 @@
   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) {