Fix for low-delay: properly set golden frame level

Earlier, the first frame of type GF_UPDATE (from 2nd subgop onwards)
was ignoring the layer_depth specified by the subgop config, and was
setting the layer_depth as 0 always.

Now we set the layer_depth of these frames properly by reading prev_last
step config. This is necessary as GF_UPDATE frame is encoded as first
frame of next subgop.

Before vs After CTC BDRate (Ovr PSNR):

- With --use-fixed-qp-offsets=1:
lowres2:         -11.039
midres2:         -12.445
objective1-fast: -12.420

- With --use-fixed-qp-offsets=0:
lowres2:         -0.297
midres2:         -0.290
objective1-fast: -0.231

Without vs With fixed QP offsets CTC BDRate (Ovr PSNR):
- Before: +10.779 to +14.301
- After:  -1.183 to  +0.204

BUG=aomedia:2832

Change-Id: I4f60adf8e60d65004ce297879f56bfb6a81c1ed6
diff --git a/av1/encoder/gop_structure.c b/av1/encoder/gop_structure.c
index e4ce775..6e6fddb 100644
--- a/av1/encoder/gop_structure.c
+++ b/av1/encoder/gop_structure.c
@@ -223,6 +223,11 @@
     gf_group->layer_depth[frame_index] =
         first_frame_update_type == OVERLAY_UPDATE ? MAX_ARF_LAYERS + 1 : 0;
     gf_group->max_layer_depth = 0;
+    if (gf_group->last_step_prev != NULL &&
+        first_frame_update_type == GF_UPDATE) {
+      gf_group->layer_depth[frame_index] = gf_group->last_step_prev->pyr_level;
+      gf_group->max_layer_depth = gf_group->layer_depth[frame_index];
+    }
     ++frame_index;
     ++cur_frame_index;
   }