Rework sub8x8 chroma reference check to support non-420 format

Make is_chroma_reference() account for all the YUV420, 444, and
422 formats.

Change-Id: Ia87e51894493dcea86843194a34e5de05799248a
diff --git a/av1/common/onyxc_int.h b/av1/common/onyxc_int.h
index 67a587b..f5558b2 100644
--- a/av1/common/onyxc_int.h
+++ b/av1/common/onyxc_int.h
@@ -722,11 +722,19 @@
 }
 
 #if CONFIG_CB4X4
-static INLINE int is_chroma_reference(const int mi_row, const int mi_col) {
+static INLINE int is_chroma_reference(const int mi_row, const int mi_col,
+                                      const BLOCK_SIZE bsize,
+                                      const int subsampling_x,
+                                      const int subsampling_y) {
 #if CONFIG_CHROMA_2X2
   return 1;
 #endif
-  return !((mi_row & 0x01) || (mi_col & 0x01));
+  int ref_pos = !(((mi_row & 0x01) && subsampling_y) ||
+                  ((mi_col & 0x01) && subsampling_x));
+
+  if (bsize >= BLOCK_8X8) ref_pos = 1;
+
+  return ref_pos;
 }
 #endif