striped-loop-restoration: Respect tile experiments
As of patch https://aomedia-review.googlesource.com/c/aom/+/28821 ,
loop-restoration units cannot cross tile borders. But the context
around each processing unit was still allowed to cross tile borders.
This is fine in the usual case - but, when loop filtering across tiles
is switched off, we're supposed to be able to decode each tile completely
independently (each tile column, if dependent-horztiles is on).
Roughly, the change we need to make is:
When loop filtering across tiles is switched off, we treat each tile
as if it were a full frame, and extend the CDEF output for that tile
to form a 3-pixel border around the tile. We only use deblocked
above/below pixels for processing unit boundaries which lie inside
a tile.
In terms of the code, this is implemented in two parts. This only
applies when the loop_filter_across_tiles_flag is false; otherwise,
we keep the old behaviour.
* For processing units at the top edge of a tile, fill the above context
with copies of the topmost line of CDEF output *from the same tile*,
rather than using deblocked pixels from the tile above.
The below context of processing units at the bottom edge of a tile
is treated analogously.
* When setting up the boundary for a processing stripe at the left edge
of a tile, fill the stripe's left boundary with copies of the
leftmost column of CDEF output from the same tile. Again, processing
stripes at the right edge of a tile are treated analogously.
Similarly to the above/below boundaries, we store the overwritten
pixels into a pair of left/right context buffers, and restore them
to their original values once we've dealt with that processing stripe.
Change-Id: I53a0932793c1c56dc037683c6a4353a3f5dc4539
diff --git a/av1/encoder/pickrst.c b/av1/encoder/pickrst.c
index b51e1c7..b95ef6d 100644
--- a/av1/encoder/pickrst.c
+++ b/av1/encoder/pickrst.c
@@ -182,6 +182,9 @@
limits, rui,
#if CONFIG_STRIPED_LOOP_RESTORATION
&rsi->boundaries, &rlbs, tile_rect, rsc->tile_stripe0,
+#if CONFIG_LOOPFILTERING_ACROSS_TILES
+ cm->loop_filter_across_tiles_enabled,
+#endif
#endif
is_uv && cm->subsampling_x, is_uv && cm->subsampling_y, highbd, bit_depth,
fts->buffers[plane], fts->strides[is_uv], rsc->dst->buffers[plane],