Fix msvc compiling errors and warnings

Change-Id: I69916bb6390dd9275341d8cd3fae2d8961e1cae3
diff --git a/av1/common/mvref_common.c b/av1/common/mvref_common.c
index 5b14473..953e14b 100644
--- a/av1/common/mvref_common.c
+++ b/av1/common/mvref_common.c
@@ -1931,7 +1931,7 @@
 #endif  // CONFIG_EXT_WARPED_MOTION
 
 #if CONFIG_EXT_SKIP
-void av1_setup_skip_mode_allowed(AV1_COMMON *const cm) {
+void av1_setup_skip_mode_allowed(AV1_COMMON *cm) {
   cm->is_skip_mode_allowed = 0;
   cm->ref_frame_idx_0 = cm->ref_frame_idx_1 = INVALID_IDX;
 
diff --git a/av1/common/restoration.c b/av1/common/restoration.c
index 7ac4c17..43d2722 100644
--- a/av1/common/restoration.c
+++ b/av1/common/restoration.c
@@ -268,7 +268,7 @@
       dst16[i * dst_stride] = buf[i + RESTORATION_BORDER];
   } else {
     for (int i = -RESTORATION_BORDER; i < h + RESTORATION_BORDER; i++)
-      dst8[i * dst_stride] = buf[i + RESTORATION_BORDER];
+      dst8[i * dst_stride] = (uint8_t)(buf[i + RESTORATION_BORDER]);
   }
 }
 #endif  // CONFIG_LOOPFILTERING_ACROSS_TILES
diff --git a/av1/decoder/decodetxb.c b/av1/decoder/decodetxb.c
index d01c31f..7531aac 100644
--- a/av1/decoder/decodetxb.c
+++ b/av1/decoder/decodetxb.c
@@ -324,24 +324,15 @@
       ctx = get_br_ctx(levels, pos, bwl, level_counts[pos]);
 #endif
       for (idx = 0; idx < COEFF_BASE_RANGE / (BR_CDF_SIZE - 1); ++idx) {
-        int k = av1_read_record_symbol(counts, r,
-#if 0
-            ec_ctx->coeff_br_cdf[AOMMIN(txs_ctx, TX_16X16)][plane_type][ctx],
-#else
-                                       ec_ctx->coeff_br_cdf[AOMMIN(
-                                           txs_ctx, TX_32X32)][plane_type][ctx],
-#endif
-                                       BR_CDF_SIZE, ACCT_STR);
+        int k = av1_read_record_symbol(
+            counts, r,
+            ec_ctx->coeff_br_cdf[AOMMIN(txs_ctx, TX_32X32)][plane_type][ctx],
+            BR_CDF_SIZE, ACCT_STR);
         *level += k;
         if (counts) {
           for (int lps = 0; lps < BR_CDF_SIZE - 1; lps++) {
-#if 0
-            ++counts->coeff_lps[AOMMIN(txs_ctx, TX_16X16)][plane_type][lps][ctx]
-                               [lps == k];
-#else
             ++counts->coeff_lps[AOMMIN(txs_ctx, TX_32X32)][plane_type][lps][ctx]
                                [lps == k];
-#endif
             if (lps == k) break;
           }
           ++counts->coeff_lps_multi[AOMMIN(txs_ctx, TX_32X32)][plane_type][ctx]
@@ -421,7 +412,7 @@
       *level = COEFF_BASE_RANGE + 1 + NUM_BASE_LEVELS;
       // Save golomb in tcoeffs because adding it to level may incur overflow
       tran_high_t t = *level + read_golomb(xd, r, counts);
-      cul_level += t;
+      cul_level += (int)t;
 #if CONFIG_NEW_QUANT
       dqv_val = &dq_val[pos != 0][0];
       t = av1_dequant_abscoeff_nuq(t, dequant[!!pos], dqv_val);
diff --git a/av1/decoder/obu.c b/av1/decoder/obu.c
index 67e9bb9..589b2c7 100644
--- a/av1/decoder/obu.c
+++ b/av1/decoder/obu.c
@@ -186,12 +186,11 @@
       case OBU_FRAME_HEADER:
         // Only decode first frame header received
         if (!frame_header_received) {
-          frame_header_size = obu_payload_size =
+          frame_header_size =
               read_frame_header_obu(pbi, data, data_end, p_data_end);
           frame_header_received = 1;
-        } else {
-          obu_payload_size = frame_header_size;
         }
+        obu_payload_size = frame_header_size;
         if (cm->show_existing_frame) frame_decoding_finished = 1;
         break;
       case OBU_TILE_GROUP:
diff --git a/av1/encoder/encodetxb.h b/av1/encoder/encodetxb.h
index 18a03e3..4d3a8ca 100644
--- a/av1/encoder/encodetxb.h
+++ b/av1/encoder/encodetxb.h
@@ -87,8 +87,7 @@
                                 const SCAN_ORDER *scan_order, int eob);
 void av1_update_txb_context(const AV1_COMP *cpi, ThreadData *td,
                             RUN_TYPE dry_run, BLOCK_SIZE bsize, int *rate,
-                            const int mi_row, const int mi_col,
-                            uint8_t allow_update_cdf);
+                            int mi_row, int mi_col, uint8_t allow_update_cdf);
 
 void av1_update_txb_context_b(int plane, int block, int blk_row, int blk_col,
                               BLOCK_SIZE plane_bsize, TX_SIZE tx_size,