Commit a54057c7 authored by Hui Su's avatar Hui Su

intrabc: fix multithread encoding data race

Change-Id: I44ad31b395c142ef2a8efa7ddcef0acf692776dd
parent efcf1e91
......@@ -3446,10 +3446,6 @@ void av1_encode_tile(AV1_COMP *cpi, ThreadData *td, int tile_row,
encode_rd_sb_row(cpi, td, this_tile, mi_row, &tok);
}
#if CONFIG_INTRABC
cpi->intrabc_used |= td->intrabc_used_this_tile;
#endif // CONFIG_INTRABC
cpi->tok_count[tile_row][tile_col] =
(unsigned int)(tok - cpi->tile_tok[tile_row][tile_col]);
assert(cpi->tok_count[tile_row][tile_col] <=
......@@ -3463,9 +3459,14 @@ static void encode_tiles(AV1_COMP *cpi) {
av1_init_tile_data(cpi);
for (tile_row = 0; tile_row < cm->tile_rows; ++tile_row)
for (tile_col = 0; tile_col < cm->tile_cols; ++tile_col)
for (tile_row = 0; tile_row < cm->tile_rows; ++tile_row) {
for (tile_col = 0; tile_col < cm->tile_cols; ++tile_col) {
av1_encode_tile(cpi, &cpi->td, tile_row, tile_col);
#if CONFIG_INTRABC
cpi->intrabc_used |= cpi->td.intrabc_used_this_tile;
#endif // CONFIG_INTRABC
}
}
}
#if CONFIG_FP_MB_STATS
......
......@@ -179,7 +179,9 @@ void av1_encode_tiles_mt(AV1_COMP *cpi) {
for (i = 0; i < num_workers; i++) {
AVxWorker *const worker = &cpi->workers[i];
EncWorkerData *const thread_data = (EncWorkerData *)worker->data1;
#if CONFIG_INTRABC
cpi->intrabc_used |= thread_data->td->intrabc_used_this_tile;
#endif // CONFIG_INTRABC
// Accumulate counters.
if (i < cpi->num_workers - 1) {
av1_accumulate_frame_counts(&cm->counts, thread_data->td->counts);
......
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