Commit 37a03fc7 authored by Ronald S. Bultje's avatar Ronald S. Bultje
Browse files

Check absolute tile positions in sb-to-tile_idx table generation

Otherwise the table can get out of sync when the frame size and tile
count stays the same, but the tile coordinates change. Fixes #266.
parent 2c1467b4
Pipeline #9101 passed with stages
in 5 minutes and 40 seconds
......@@ -2595,8 +2595,10 @@ int dav1d_decode_frame(Dav1dFrameContext *const f) {
f->tile_thread.titsati_sz = titsati_sz;
}
if (f->tile_thread.titsati_init[0] != f->frame_hdr->tiling.cols ||
f->tile_thread.titsati_init[1] != f->sbh ||
f->tile_thread.titsati_init[2] != f->frame_hdr->tiling.rows)
f->tile_thread.titsati_init[1] != f->frame_hdr->tiling.rows ||
memcmp(f->frame_hdr->tiling.row_start_sb, f->tile_thread.titsati_index_rows,
sizeof(*f->tile_thread.titsati_index_rows) *
(f->frame_hdr->tiling.rows + 1)))
{
for (int tile_row = 0, tile_idx = 0;
tile_row < f->frame_hdr->tiling.rows; tile_row++)
......@@ -2614,8 +2616,10 @@ int dav1d_decode_frame(Dav1dFrameContext *const f) {
}
}
f->tile_thread.titsati_init[0] = f->frame_hdr->tiling.cols;
f->tile_thread.titsati_init[1] = f->sbh;
f->tile_thread.titsati_init[2] = f->frame_hdr->tiling.rows;
f->tile_thread.titsati_init[1] = f->frame_hdr->tiling.rows;
memcpy(f->tile_thread.titsati_index_rows, f->frame_hdr->tiling.row_start_sb,
sizeof(*f->tile_thread.titsati_index_rows) *
(f->frame_hdr->tiling.rows + 1));
}
}
......
......@@ -235,7 +235,8 @@ struct Dav1dFrameContext {
pthread_cond_t cond, icond;
int tasks_left, num_tasks;
int (*task_idx_to_sby_and_tile_idx)[2];
int titsati_sz, titsati_init[3];
int titsati_sz, titsati_init[2];
uint16_t titsati_index_rows[1 + DAV1D_MAX_TILE_ROWS];
int inited;
} tile_thread;
};
......
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