Add av1_predict_intra_block_facade

A simpler interface for intra block prediction

Change-Id: I97e3f385746928d87999e6862b1d71a197df0302
diff --git a/av1/encoder/encodemb.c b/av1/encoder/encodemb.c
index b378674..d5859d4 100644
--- a/av1/encoder/encodemb.c
+++ b/av1/encoder/encodemb.c
@@ -1082,7 +1082,6 @@
   const int block_raster_idx = av1_block_index_to_raster_order(tx_size, block);
   const TX_TYPE tx_type =
       get_tx_type(plane_type, xd, block_raster_idx, tx_size);
-  PREDICTION_MODE mode;
   const int diff_stride = block_size_wide[plane_bsize];
   uint8_t *src, *dst;
   int16_t *src_diff;
@@ -1098,15 +1097,13 @@
   int i, j;
 #endif
 
+  av1_predict_intra_block_facade(xd, plane, block_raster_idx, blk_col, blk_row,
+                                 tx_size);
+
   dst = &pd->dst.buf[(blk_row * dst_stride + blk_col) << tx_size_wide_log2[0]];
   src = &p->src.buf[(blk_row * src_stride + blk_col) << tx_size_wide_log2[0]];
   src_diff =
       &p->src_diff[(blk_row * diff_stride + blk_col) << tx_size_wide_log2[0]];
-  mode = (plane == 0) ? get_y_mode(xd->mi[0], block_raster_idx) : mbmi->uv_mode;
-  av1_predict_intra_block(xd, pd->width, pd->height, txsize_to_bsize[tx_size],
-                          mode, dst, dst_stride, dst, dst_stride, blk_col,
-                          blk_row, plane);
-
   subtract_block(xd, tx1d_height, tx1d_width, src_diff, diff_stride, src,
                  src_stride, dst, dst_stride);
 
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 76857af..72575c3 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -2401,14 +2401,15 @@
   const int max_blocks_high = max_block_high(xd, bsize, 0);
   mbmi->tx_size = tx_size;
   // Prediction.
+  const int step = stepr * stepc;
+  int block = 0;
   for (row = 0; row < max_blocks_high; row += stepr) {
     for (col = 0; col < max_blocks_wide; col += stepc) {
-      struct macroblockd_plane *const pd = &xd->plane[0];
-      uint8_t *dst =
-          &pd->dst.buf[(row * pd->dst.stride + col) << tx_size_wide_log2[0]];
-      av1_predict_intra_block(xd, pd->width, pd->height,
-                              txsize_to_bsize[tx_size], mbmi->mode, dst,
-                              pd->dst.stride, dst, pd->dst.stride, col, row, 0);
+      const int block_raster_idx =
+          av1_block_index_to_raster_order(tx_size, block);
+      av1_predict_intra_block_facade(xd, 0, block_raster_idx, col, row,
+                                     tx_size);
+      block += step;
     }
   }
   // RD estimation.