[NORMATIVE]Convert row/col counter into binaries for inter mode

Convert the row and column counters into binaries effectively to
build the inter mode context model.

BUG=aomedia:1288

Change-Id: Ida7f256c5e0c8c24f8f93d5edf10d9788adc031c
diff --git a/av1/common/mvref_common.c b/av1/common/mvref_common.c
index 54d0b3f..b918222 100644
--- a/av1/common/mvref_common.c
+++ b/av1/common/mvref_common.c
@@ -747,7 +747,7 @@
   uint8_t nearest_refmv_count[MODE_CTX_REF_FRAMES];
 
   nearest_match[ref_frame] =
-      row_match_count[ref_frame] + col_match_count[ref_frame];
+      (row_match_count[ref_frame] > 0) + (col_match_count[ref_frame] > 0);
   nearest_refmv_count[ref_frame] = refmv_count[ref_frame];
 
   // TODO(yunqing): for comp_search, do it for all 3 cases.
@@ -887,7 +887,7 @@
                   max_col_offset, &processed_cols);
 
   ref_match_count[ref_frame] =
-      row_match_count[ref_frame] + col_match_count[ref_frame];
+      (row_match_count[ref_frame] > 0) + (col_match_count[ref_frame] > 0);
 
 #if CONFIG_OPT_REF_MV
   switch (nearest_match[ref_frame])
diff --git a/test/decode_to_md5.sh b/test/decode_to_md5.sh
index 3df232b..ee42554 100755
--- a/test/decode_to_md5.sh
+++ b/test/decode_to_md5.sh
@@ -57,7 +57,7 @@
 
 decode_to_md5_av1() {
   # expected MD5 sum for the last frame.
-  local expected_md5="be1cd883ce2cefa722be2dfec20318e1"
+  local expected_md5="08d6acb77b20a408237fd42c7575e67d"
   local file="${AV1_IVF_FILE}"
 
   # TODO(urvang): Check in the encoded file (like libvpx does) to avoid