Commit 785d33a9 authored by David Barker's avatar David Barker

obu: Use correct tile for CDF adaptation

Move the "largest tile size" value from read_tile_buffers()
into the AV1_COMMON structure, so that it can be preserved across
calls. Additionally, only reset the largest tile id once per frame,
rather than once per tile group.

BUG=aomedia:1245

Change-Id: Ia9b96047bcd4e72b1bed24f78d2914505686262c
parent 24e47836
......@@ -249,7 +249,9 @@ typedef struct AV1Common {
// support additional planes.
int subsampling_x;
int subsampling_y;
int largest_tile_id;
size_t largest_tile_size;
// Scale of the current frame with respect to itself.
struct scale_factors sf_identity;
......
......@@ -1838,8 +1838,11 @@ static void get_tile_buffers(AV1Decoder *pbi, const uint8_t *data,
int tile_group_start_row = 0;
#endif
size_t max_tile_size = 0;
cm->largest_tile_id = 0;
if (startTile == 0) {
cm->largest_tile_size = 0;
cm->largest_tile_id = 0;
}
for (int r = 0; r < tile_rows; ++r) {
for (int c = 0; c < tile_cols; ++c, ++tc) {
TileBufferDec *const buf = &tile_buffers[r][c];
......@@ -1884,8 +1887,8 @@ static void get_tile_buffers(AV1Decoder *pbi, const uint8_t *data,
cm->tile_group_start_row[r][c] = tile_group_start_row;
cm->tile_group_start_col[r][c] = tile_group_start_col;
#endif
if (buf->size > max_tile_size) {
max_tile_size = buf->size;
if (buf->size > cm->largest_tile_size) {
cm->largest_tile_size = buf->size;
cm->largest_tile_id = r * tile_cols + c;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment