Fix static-analysis warnings

This commit fixes the warnings of "value stored to 'mode_ctx' during
its initialization is never read".

Change-Id: I39e78a5915d29c74854306d009b7a6e002dda781
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 8b9d17d..6b86bf2 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -1360,7 +1360,7 @@
     if (bsize >= BLOCK_8X8) write_filter_intra_mode_info(cm, mbmi, w);
 #endif  // CONFIG_FILTER_INTRA
   } else {
-    int16_t mode_ctx = mbmi_ext->mode_context[mbmi->ref_frame[0]];
+    int16_t mode_ctx;
     write_ref_frames(cm, xd, w);
 
 #if CONFIG_REF_MV
@@ -1371,7 +1371,9 @@
 #endif  // CONFIG_EXT_INTER
       mode_ctx = av1_mode_context_analyzer(mbmi_ext->mode_context,
                                            mbmi->ref_frame, bsize, -1);
-#endif
+#else  // CONFIG_REF_MV
+    mode_ctx = mbmi_ext->mode_context[mbmi->ref_frame[0]];
+#endif  // CONFIG_REF_MV
 
     // If segment skip is not enabled code the mode.
     if (!segfeature_active(seg, segment_id, SEG_LVL_SKIP)) {
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index e0e16a0..5db31e6 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -1984,7 +1984,10 @@
 
     if (inter_block &&
         !segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP)) {
-      int16_t mode_ctx = mbmi_ext->mode_context[mbmi->ref_frame[0]];
+      int16_t mode_ctx;
+#if !CONFIG_REF_MV
+      mode_ctx = mbmi_ext->mode_context[mbmi->ref_frame[0]];
+#endif
       if (bsize >= BLOCK_8X8) {
         const PREDICTION_MODE mode = mbmi->mode;
 #if CONFIG_REF_MV
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 6114e5d..8ac38e8 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -4394,7 +4394,7 @@
   const int num_4x4_blocks_wide = num_4x4_blocks_wide_lookup[mbmi->sb_type];
   const int num_4x4_blocks_high = num_4x4_blocks_high_lookup[mbmi->sb_type];
   const int is_compound = has_second_ref(mbmi);
-  int mode_ctx = mbmi_ext->mode_context[mbmi->ref_frame[0]];
+  int mode_ctx;
 
   switch (mode) {
     case NEWMV:
@@ -4534,7 +4534,9 @@
 #endif  // CONFIG_EXT_INTER
     mode_ctx = av1_mode_context_analyzer(mbmi_ext->mode_context,
                                          mbmi->ref_frame, mbmi->sb_type, i);
-#endif
+#else  // CONFIG_REF_MV
+  mode_ctx = mbmi_ext->mode_context[mbmi->ref_frame[0]];
+#endif  // CONFIG_REF_MV
 #if CONFIG_REF_MV && CONFIG_EXT_INTER
   return cost_mv_ref(cpi, mode, is_compound, mode_ctx) + thismvcost;
 #else
@@ -6979,7 +6981,7 @@
 
   int skip_txfm_sb = 0;
   int64_t skip_sse_sb = INT64_MAX;
-  int16_t mode_ctx = mbmi_ext->mode_context[refs[0]];
+  int16_t mode_ctx;
 #if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
   av1_invalid_rd_stats(&best_rd_stats);
 #endif
@@ -7004,7 +7006,9 @@
 #endif  // CONFIG_EXT_INTER
     mode_ctx = av1_mode_context_analyzer(mbmi_ext->mode_context,
                                          mbmi->ref_frame, bsize, -1);
-#endif
+#else   // CONFIG_REF_MV
+  mode_ctx = mbmi_ext->mode_context[refs[0]];
+#endif  // CONFIG_REF_MV
 
 #if CONFIG_AOM_HIGHBITDEPTH
   if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH)