[NORMATIVE-SYNTAX] Fix max tile width/area calculation
As per the linked bug report, the maximum #pixels in each tile
was previously being computed in a way which depended on the
superblock size. This patch fixes this by making max_tile_width_sb
and max_tile_area_sb depend on the superblock size.
One potential source of confusion comes from the fact that we
already have a variable called max_tile_width_sb elsewhere in
the code, which tracks the width of the widest tile in the current
frame. To avoid confusion, this is renamed to widest_tile_sb,
so that max_* always means a limit in this context.
BUG=aomedia:1508
Change-Id: I94ebbc46e54cb5b1e8eda5f8ab3f0a3cd61698e8
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index d0a2e9d..1bf5b35 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -2303,7 +2303,8 @@
// columns
for (i = 0; i < cm->tile_cols; i++) {
size_sb = cm->tile_col_start_sb[i + 1] - cm->tile_col_start_sb[i];
- wb_write_uniform(wb, AOMMIN(width_sb, MAX_TILE_WIDTH_SB), size_sb - 1);
+ wb_write_uniform(wb, AOMMIN(width_sb, cm->max_tile_width_sb),
+ size_sb - 1);
width_sb -= size_sb;
}
assert(width_sb == 0);