Add an experiment to disable lpf on tile boundaries

This commit adds a new experiment to allow disabling of loop filtering
on tile boundaries. It is implemented by adding a syntax field
"loopfilter_across_tiles_enabled" into the uncompressed frame header. 
If it is set to 0, decoder and encoder will disables loop filtering for
block edges that are also tile boundaries.

Change-Id: Ib80bfd82d49c74f1ba46ae18ceedb30704ac8aa5
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index d721e53..0cb3bf1 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -3382,6 +3382,10 @@
   aom_wb_write_bit(wb, cm->log2_tile_rows != 0);
   if (cm->log2_tile_rows != 0) aom_wb_write_bit(wb, cm->log2_tile_rows != 1);
 #endif  // CONFIG_EXT_TILE
+
+#if CONFIG_DEBLOCKING_ACROSS_TILES
+  aom_wb_write_bit(wb, cm->loop_filter_across_tiles_enabled);
+#endif  // CONFIG_DEBLOCKING_ACROSS_TILES
 }
 
 static int get_refresh_mask(AV1_COMP *cpi) {
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index 01fe0b7..beb9126 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -4380,6 +4380,11 @@
     MODE_INFO **mi = cm->mi_grid_visible + idx_str;
     PC_TREE *const pc_root = td->pc_root[cm->mib_size_log2 - MIN_MIB_SIZE_LOG2];
 
+#if CONFIG_DEBLOCKING_ACROSS_TILES
+    if (av1_disable_loopfilter_on_tile_boundary(cm)) {
+      av1_update_tile_boundary_info(cm, tile_info, mi_row, mi_col);
+    }
+#endif  // CONFIG_DEBLOCKING_ACROSS_TILES
     if (sf->adaptive_pred_interp_filter) {
       for (i = 0; i < leaf_nodes; ++i)
         td->leaf_tree[i].pred_interp_filter = SWITCHABLE;
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index 0ff8871..e9e7eb3 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -863,6 +863,11 @@
   cm->tile_width = ALIGN_POWER_OF_TWO(cm->tile_width, MAX_MIB_SIZE_LOG2);
   cm->tile_height = ALIGN_POWER_OF_TWO(cm->tile_height, MAX_MIB_SIZE_LOG2);
 #endif  // CONFIG_EXT_TILE
+
+#if CONFIG_DEBLOCKING_ACROSS_TILES
+  cm->loop_filter_across_tiles_enabled =
+      cpi->oxcf.loop_filter_across_tiles_enabled;
+#endif  // CONFIG_DEBLOCKING_ACROSS_TILES
 }
 
 static void update_frame_size(AV1_COMP *cpi) {
diff --git a/av1/encoder/encoder.h b/av1/encoder/encoder.h
index ca5918a..e149bfb 100644
--- a/av1/encoder/encoder.h
+++ b/av1/encoder/encoder.h
@@ -238,6 +238,9 @@
 
   int tile_columns;
   int tile_rows;
+#if CONFIG_DEBLOCKING_ACROSS_TILES
+  int loop_filter_across_tiles_enabled;
+#endif  // CONFIG_DEBLOCKING_ACROSS_TILES
 
   int max_threads;