deblocking_across_tiles->loopfilter_across_tiles

This commit renames deblocking_across_tiles to loopfilter_across_tiles, 
to get ready for dering and clpf integration.

Change-Id: Id25b051da9b1e5cb92f35a9619662597462d9537
diff --git a/av1/common/blockd.h b/av1/common/blockd.h
index c6e57bc..37ae545 100644
--- a/av1/common/blockd.h
+++ b/av1/common/blockd.h
@@ -376,9 +376,8 @@
   int num_proj_ref[2];
   WarpedMotionParams wm_params[2];
 #endif  // CONFIG_WARPED_MOTION
-#if CONFIG_DEBLOCKING_ACROSS_TILES
-  TILE_BOUNDARY_TYPE tile_boundary_info;
-#endif  // CONFIG_DEBLOCKING_ACROSS_TILES
+
+  BOUNDARY_TYPE boundary_info;
 } MB_MODE_INFO;
 
 typedef struct MODE_INFO {
diff --git a/av1/common/enums.h b/av1/common/enums.h
index 5fe3b2d..e232ee4 100644
--- a/av1/common/enums.h
+++ b/av1/common/enums.h
@@ -225,14 +225,16 @@
   TX_TYPES,
 } TX_TYPE;
 
-#if CONFIG_DEBLOCKING_ACROSS_TILES
 typedef enum {
   TILE_LEFT_BOUNDARY = 1,
   TILE_RIGHT_BOUNDARY = 2,
   TILE_ABOVE_BOUNDARY = 4,
   TILE_BOTTOM_BOUNDARY = 8,
-} TILE_BOUNDARY_TYPE;
-#endif  // CONFIG_DEBLOCKING_ACROSS_TILES
+  FRAME_LEFT_BOUNDARY = 16,
+  FRAME_RIGHT_BOUNDARY = 32,
+  FRAME_ABOVE_BOUNDARY = 64,
+  FRAME_BOTTOM_BOUNDARY = 128,
+} BOUNDARY_TYPE;
 
 #if CONFIG_EXT_TX
 #if CONFIG_CB4X4
diff --git a/av1/common/loopfilter.c b/av1/common/loopfilter.c
index 9eab7f5..9f1fff5 100644
--- a/av1/common/loopfilter.c
+++ b/av1/common/loopfilter.c
@@ -893,7 +893,7 @@
     *int_4x4_y |= (size_mask[block_size] & 0xffffffffffffffffULL) << shift_y;
 }
 
-#if CONFIG_DEBLOCKING_ACROSS_TILES
+#if CONFIG_LOOPFILTERING_ACROSS_TILES
 // This function update the bit masks for the entire 64x64 region represented
 // by mi_row, mi_col. In case one of the edge is a tile boundary, loop filtering
 // for that edge is disabled. This function only check the tile boundary info
@@ -905,21 +905,21 @@
   int i;
   MODE_INFO *const mi = cm->mi + mi_row * cm->mi_stride + mi_col;
 
-  if (mi->mbmi.tile_boundary_info & TILE_LEFT_BOUNDARY) {
+  if (mi->mbmi.boundary_info & TILE_LEFT_BOUNDARY) {
     for (i = 0; i <= TX_32X32; i++) {
       lfm->left_y[i] &= 0xfefefefefefefefeULL;
       lfm->left_uv[i] &= 0xeeee;
     }
   }
 
-  if (mi->mbmi.tile_boundary_info & TILE_ABOVE_BOUNDARY) {
+  if (mi->mbmi.boundary_info & TILE_ABOVE_BOUNDARY) {
     for (i = 0; i <= TX_32X32; i++) {
       lfm->above_y[i] &= 0xffffffffffffff00ULL;
       lfm->above_uv[i] &= 0xfff0;
     }
   }
 }
-#endif  // CONFIG_DEBLOCKING_ACROSS_TILES
+#endif  // CONFIG_LOOPFILTERING_ACROSS_TILES
 
 // This function sets up the bit masks for the entire 64x64 region represented
 // by mi_row, mi_col.
@@ -1206,11 +1206,11 @@
     }
   }
 
-#if CONFIG_DEBLOCKING_ACROSS_TILES
+#if CONFIG_LOOPFILTERING_ACROSS_TILES
   if (av1_disable_loopfilter_on_tile_boundary(cm)) {
     update_tile_boundary_filter_mask(cm, mi_row, mi_col, lfm);
   }
-#endif  // CONFIG_DEBLOCKING_ACROSS_TILES
+#endif  // CONFIG_LOOPFILTERING_ACROSS_TILES
 
   // Assert if we try to apply 2 different loop filters at the same position.
   assert(!(lfm->left_y[TX_16X16] & lfm->left_y[TX_8X8]));
@@ -1462,12 +1462,12 @@
 
     // Disable filtering on the leftmost column or tile boundary
     border_mask = ~(mi_col == 0);
-#if CONFIG_DEBLOCKING_ACROSS_TILES
+#if CONFIG_LOOPFILTERING_ACROSS_TILES
     if (av1_disable_loopfilter_on_tile_boundary(cm) &&
-        ((mib[0]->mbmi.tile_boundary_info & TILE_LEFT_BOUNDARY) != 0)) {
+        ((mib[0]->mbmi.boundary_info & TILE_LEFT_BOUNDARY) != 0)) {
       border_mask = 0xfffffffe;
     }
-#endif  // CONFIG_DEBLOCKING_ACROSS_TILES
+#endif  // CONFIG_LOOPFILTERING_ACROSS_TILES
 
 #if CONFIG_AOM_HIGHBITDEPTH
     if (cm->use_highbitdepth) {
@@ -1666,11 +1666,11 @@
     unsigned int mask_8x8_r;
     unsigned int mask_4x4_r;
 
-#if CONFIG_DEBLOCKING_ACROSS_TILES
+#if CONFIG_LOOPFILTERING_ACROSS_TILES
     // Disable filtering on the abovemost row or tile boundary
     const MODE_INFO *mi = cm->mi + (mi_row + r) * cm->mi_stride;
     if ((av1_disable_loopfilter_on_tile_boundary(cm) &&
-         (mi->mbmi.tile_boundary_info & TILE_ABOVE_BOUNDARY)) ||
+         (mi->mbmi.boundary_info & TILE_ABOVE_BOUNDARY)) ||
         (mi_row + idx_r == 0)) {
       mask_16x16_r = 0;
       mask_8x8_r = 0;
@@ -1680,7 +1680,7 @@
       mask_16x16_r = 0;
       mask_8x8_r = 0;
       mask_4x4_r = 0;
-#endif  // CONFIG_DEBLOCKING_ACROSS_TILES
+#endif  // CONFIG_LOOPFILTERING_ACROSS_TILES
     } else {
       mask_16x16_r = mask_16x16[r];
       mask_8x8_r = mask_8x8[r];
diff --git a/av1/common/onyxc_int.h b/av1/common/onyxc_int.h
index 49c952b..2e024e3 100644
--- a/av1/common/onyxc_int.h
+++ b/av1/common/onyxc_int.h
@@ -368,9 +368,9 @@
   int tile_cols, tile_rows;
   int tile_width, tile_height;  // In MI units
 
-#if CONFIG_DEBLOCKING_ACROSS_TILES
+#if CONFIG_LOOPFILTERING_ACROSS_TILES
   int loop_filter_across_tiles_enabled;
-#endif  // CONFIG_DEBLOCKING_ACROSS_TILES
+#endif  // CONFIG_LOOPFILTERING_ACROSS_TILES
 
   int byte_alignment;
   int skip_loop_filter;
diff --git a/av1/common/tile_common.c b/av1/common/tile_common.c
index 62ceb12..76a7e9d 100644
--- a/av1/common/tile_common.c
+++ b/av1/common/tile_common.c
@@ -60,28 +60,39 @@
 }
 #endif  // !CONFIG_EXT_TILE
 
-#if CONFIG_DEBLOCKING_ACROSS_TILES
-void av1_update_tile_boundary_info(const struct AV1Common *cm,
-                                   const TileInfo *const tile_info, int mi_row,
-                                   int mi_col) {
+void av1_update_boundary_info(const struct AV1Common *cm,
+                              const TileInfo *const tile_info, int mi_row,
+                              int mi_col) {
   int row, col;
   for (row = mi_row; row < (mi_row + cm->mib_size); row++)
     for (col = mi_col; col < (mi_col + cm->mib_size); col++) {
       MODE_INFO *const mi = cm->mi + row * cm->mi_stride + col;
-      mi->mbmi.tile_boundary_info = 0;
-      if (row == tile_info->mi_row_start)
-        mi->mbmi.tile_boundary_info |= TILE_ABOVE_BOUNDARY;
-      if (col == tile_info->mi_col_start)
-        mi->mbmi.tile_boundary_info |= TILE_LEFT_BOUNDARY;
-      if ((row + 1) >= tile_info->mi_row_end)
-        mi->mbmi.tile_boundary_info |= TILE_BOTTOM_BOUNDARY;
-      if ((col + 1) >= tile_info->mi_col_end)
-        mi->mbmi.tile_boundary_info |= TILE_RIGHT_BOUNDARY;
+      mi->mbmi.boundary_info = 0;
+      if (cm->tile_cols * cm->tile_rows > 1) {
+        if (row == tile_info->mi_row_start)
+          mi->mbmi.boundary_info |= TILE_ABOVE_BOUNDARY;
+        if (col == tile_info->mi_col_start)
+          mi->mbmi.boundary_info |= TILE_LEFT_BOUNDARY;
+        if ((row + 1) >= tile_info->mi_row_end)
+          mi->mbmi.boundary_info |= TILE_BOTTOM_BOUNDARY;
+        if ((col + 1) >= tile_info->mi_col_end)
+          mi->mbmi.boundary_info |= TILE_RIGHT_BOUNDARY;
+      }
+      // Frame boundary is treated as tile boundary
+      if (row == 0)
+        mi->mbmi.boundary_info |= FRAME_ABOVE_BOUNDARY | TILE_ABOVE_BOUNDARY;
+      if (col == 0)
+        mi->mbmi.boundary_info |= FRAME_LEFT_BOUNDARY | TILE_LEFT_BOUNDARY;
+      if ((row + 1) >= cm->mi_rows)
+        mi->mbmi.boundary_info |= FRAME_BOTTOM_BOUNDARY | TILE_BOTTOM_BOUNDARY;
+      if ((col + 1) >= cm->mi_cols)
+        mi->mbmi.boundary_info |= FRAME_RIGHT_BOUNDARY | TILE_RIGHT_BOUNDARY;
     }
 }
 
+#if CONFIG_LOOPFILTERING_ACROSS_TILES
 int av1_disable_loopfilter_on_tile_boundary(const struct AV1Common *cm) {
   return (!cm->loop_filter_across_tiles_enabled &&
           (cm->tile_cols * cm->tile_rows > 1));
 }
-#endif  // CONFIG_DEBLOCKING_ACROSS_TILES
+#endif  // CONFIG_LOOPFILTERING_ACROSS_TILES
diff --git a/av1/common/tile_common.h b/av1/common/tile_common.h
index 37ef37d..65ad323 100644
--- a/av1/common/tile_common.h
+++ b/av1/common/tile_common.h
@@ -38,12 +38,13 @@
 void av1_get_tile_n_bits(const int mi_cols, int *min_log2_tile_cols,
                          int *max_log2_tile_cols);
 
-#if CONFIG_DEBLOCKING_ACROSS_TILES
-void av1_update_tile_boundary_info(const struct AV1Common *cm,
-                                   const TileInfo *const tile_info, int mi_row,
-                                   int mi_col);
+void av1_update_boundary_info(const struct AV1Common *cm,
+                              const TileInfo *const tile_info, int mi_row,
+                              int mi_col);
+
+#if CONFIG_LOOPFILTERING_ACROSS_TILES
 int av1_disable_loopfilter_on_tile_boundary(const struct AV1Common *cm);
-#endif  // CONFIG_DEBLOCKING_ACROSS_TILES
+#endif  // CONFIG_LOOPFILTERING_ACROSS_TILES
 
 #ifdef __cplusplus
 }  // extern "C"