Unify set_contexts() function for encoder and decoder

Remove the separate implementations of set_contexts() in encoder
and decoder.

Change-Id: I9f6e9b075532faae0f74f885d9443589254258a7
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index 04d5282..d3b97d6 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -262,6 +262,8 @@
   MACROBLOCKD *const xd = &x->e_mbd;
   const int mi_width = num_8x8_blocks_wide_lookup[bsize];
   const int mi_height = num_8x8_blocks_high_lookup[bsize];
+  const int bwl = b_width_log2_lookup[AOMMAX(bsize, BLOCK_8X8)];
+  const int bhl = b_height_log2_lookup[AOMMAX(bsize, BLOCK_8X8)];
 
   set_skip_context(xd, mi_row, mi_col);
 
@@ -284,6 +286,8 @@
   x->mv_row_max = (cm->mi_rows - mi_row) * MI_SIZE + AOM_INTERP_EXTEND;
   x->mv_col_max = (cm->mi_cols - mi_col) * MI_SIZE + AOM_INTERP_EXTEND;
 
+  set_plane_n4(xd, mi_width, mi_height, bwl, bhl);
+
   // Set up distance of MB to edge of frame in 1/8th pel units.
   assert(!(mi_col & (mi_width - 1)) && !(mi_row & (mi_height - 1)));
   set_mi_row_col(xd, tile, mi_row, mi_height, mi_col, mi_width, cm->mi_rows,