Fix alloc and dealloc in enc row-mt for superres
Allocation and deallocation of sync memory in row based
multi-threading of encoder has been fixed.
Change-Id: Ice792f47209bf0535a0b970345a9538da43dd404
diff --git a/av1/encoder/av1_multi_thread.c b/av1/encoder/av1_multi_thread.c
index c552ccb..a0c556e 100644
--- a/av1/encoder/av1_multi_thread.c
+++ b/av1/encoder/av1_multi_thread.c
@@ -31,7 +31,9 @@
tile_row++) {
for (tile_col = 0; tile_col < multi_thread_ctxt->allocated_tile_cols;
tile_col++) {
- TileDataEnc *this_tile = &cpi->tile_data[tile_row * tile_cols + tile_col];
+ TileDataEnc *this_tile =
+ &cpi->tile_data[tile_row * multi_thread_ctxt->allocated_tile_cols +
+ tile_col];
av1_row_mt_sync_mem_alloc(&this_tile->row_mt_sync, cm, max_sb_rows);
}
}
@@ -39,8 +41,6 @@
void av1_row_mt_mem_dealloc(AV1_COMP *cpi) {
MultiThreadHandle *multi_thread_ctxt = &cpi->multi_thread_ctxt;
- AV1_COMMON *const cm = &cpi->common;
- const int tile_cols = cm->tile_cols;
int tile_col;
int tile_row;
@@ -49,7 +49,9 @@
tile_row++) {
for (tile_col = 0; tile_col < multi_thread_ctxt->allocated_tile_cols;
tile_col++) {
- TileDataEnc *this_tile = &cpi->tile_data[tile_row * tile_cols + tile_col];
+ TileDataEnc *this_tile =
+ &cpi->tile_data[tile_row * multi_thread_ctxt->allocated_tile_cols +
+ tile_col];
av1_row_mt_sync_mem_dealloc(&this_tile->row_mt_sync);
}
}