Fix YUV444 lossless mode unit test

Properly scale the chroma component size per color plane.

Change-Id: Ibf192d0e99f2fc3611beb82a3a9951ad09b292d3
diff --git a/av1/encoder/encodemb.c b/av1/encoder/encodemb.c
index 1df0dc3..13bbb7a 100644
--- a/av1/encoder/encodemb.c
+++ b/av1/encoder/encodemb.c
@@ -940,11 +940,14 @@
 
   for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
 #if CONFIG_CB4X4 && !CONFIG_CHROMA_2X2
-    if (!is_chroma_reference(mi_row, mi_col, bsize,
-                             xd->plane[plane].subsampling_x,
-                             xd->plane[plane].subsampling_y))
+    const int subsampling_x = xd->plane[plane].subsampling_x;
+    const int subsampling_y = xd->plane[plane].subsampling_y;
+
+    if (!is_chroma_reference(mi_row, mi_col, bsize, subsampling_x,
+                             subsampling_y))
       continue;
-    if (plane) bsize = AOMMAX(bsize, BLOCK_8X8);
+
+    bsize = scale_chroma_bsize(bsize, subsampling_x, subsampling_y);
 #else
     (void)mi_row;
     (void)mi_col;
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index c00c3d2..cbed979 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -3754,7 +3754,9 @@
 
 #if CONFIG_CB4X4 && !CONFIG_CHROMA_2X2
   if (x->skip_chroma_rd) return is_cost_valid;
-  bsize = AOMMAX(BLOCK_8X8, bsize);
+
+  bsize = scale_chroma_bsize(bsize, xd->plane[1].subsampling_x,
+                             xd->plane[1].subsampling_y);
 #endif  // CONFIG_CB4X4 && !CONFIG_CHROMA_2X2
 
 #if !CONFIG_PVQ