MAX_TILE experiment: add explicit tiles
This patch is designed to complete the CONFIG_MAX_TILE experiment.
It adds the following features:
- Explicit tiles of same width can be signalled with command line --tile_width
- Explicit tiles of same hieght can be signalled with command line --tile_height
- max_tile now works with the depenedent horizontal tiles experiment
- additional checking added to ensure maximum number of rows/columns <= 64
- one fix to the tile group code for when the number of tiles is not a power of two
Change-Id: I749a68fdb3dcdd8d1ced2b3558f3817e4b832c06
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index c03dff9..4716258 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -3246,14 +3246,14 @@
cm->log2_tile_cols++;
}
} else {
- for (i = 0, start_sb = 0; width_sb > 0; i++) {
+ for (i = 0, start_sb = 0; width_sb > 0 && i < MAX_TILE_COLS; i++) {
size_sb = 1 + rb_read_uniform(rb, AOMMIN(width_sb, MAX_TILE_WIDTH_SB));
cm->tile_col_start_sb[i] = start_sb;
start_sb += size_sb;
width_sb -= size_sb;
}
cm->tile_cols = i;
- cm->tile_col_start_sb[i] = start_sb;
+ cm->tile_col_start_sb[i] = start_sb + width_sb;
}
av1_calculate_tile_cols(cm);
@@ -3267,7 +3267,7 @@
cm->log2_tile_rows++;
}
} else {
- for (i = 0, start_sb = 0; height_sb > 0; i++) {
+ for (i = 0, start_sb = 0; height_sb > 0 && i < MAX_TILE_ROWS; i++) {
size_sb =
1 + rb_read_uniform(rb, AOMMIN(height_sb, cm->max_tile_height_sb));
cm->tile_row_start_sb[i] = start_sb;
@@ -3275,7 +3275,7 @@
height_sb -= size_sb;
}
cm->tile_rows = i;
- cm->tile_row_start_sb[i] = start_sb;
+ cm->tile_row_start_sb[i] = start_sb + height_sb;
}
av1_calculate_tile_rows(cm);
}