No need to update frame contexts while large_scale_tile = 1

While large_scale_tile = 1, no backward CDF update happens during
encoding. So, no need to update frame contexts at end of frame
encoding.

Change-Id: I2267b1e58d400768ba1ef95b339001b420e84c4b
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index 335dcb5..04a59fe 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -3869,16 +3869,24 @@
   }
 #endif
 
-  // Non frame parallel update frame context here.
-  if (!cm->frame_parallel_decode ||
-      cm->refresh_frame_context != REFRESH_FRAME_CONTEXT_FORWARD) {
+// Non frame parallel update frame context here.
+#if CONFIG_EXT_TILE
+  if (!cm->large_scale_tile) {
+#endif  // CONFIG_EXT_TILE
+    // TODO(yunqingwang): If cm->frame_parallel_decode = 0, then the following
+    // update always happens. Seems it is done more than necessary.
+    if (!cm->frame_parallel_decode ||
+        cm->refresh_frame_context != REFRESH_FRAME_CONTEXT_FORWARD) {
 #if CONFIG_NO_FRAME_CONTEXT_SIGNALING
-    cm->frame_contexts[cm->new_fb_idx] = *cm->fc;
+      cm->frame_contexts[cm->new_fb_idx] = *cm->fc;
 #else
     if (!cm->error_resilient_mode)
       cm->frame_contexts[cm->frame_context_idx] = *cm->fc;
 #endif
+    }
+#if CONFIG_EXT_TILE
   }
+#endif  // CONFIG_EXT_TILE
 }
 
 #if CONFIG_OBU
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index 1c61c9b..a37d785 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -6649,12 +6649,18 @@
 
 #endif
 
+#if CONFIG_EXT_TILE
+  if (!cm->large_scale_tile) {
+#endif  // CONFIG_EXT_TILE
 #if CONFIG_NO_FRAME_CONTEXT_SIGNALING
-  cm->frame_contexts[cm->new_fb_idx] = *cm->fc;
+    cm->frame_contexts[cm->new_fb_idx] = *cm->fc;
 #else
   if (!cm->error_resilient_mode)
     cm->frame_contexts[cm->frame_context_idx] = *cm->fc;
 #endif  // CONFIG_NO_FRAME_CONTEXT_SIGNALING
+#if CONFIG_EXT_TILE
+  }
+#endif  // CONFIG_EXT_TILE
 
   // No frame encoded, or frame was dropped, release scaled references.
   if ((*size == 0) && (frame_is_intra_only(cm) == 0)) {