Lines Matching refs:row_mt_sync
69 void av1_row_mt_sync_read_dummy(struct AV1RowMTSyncData *const row_mt_sync, in av1_row_mt_sync_read_dummy() argument
71 (void)row_mt_sync; in av1_row_mt_sync_read_dummy()
77 void av1_row_mt_sync_write_dummy(struct AV1RowMTSyncData *const row_mt_sync, in av1_row_mt_sync_write_dummy() argument
79 (void)row_mt_sync; in av1_row_mt_sync_write_dummy()
86 void av1_row_mt_sync_read(AV1RowMTSync *const row_mt_sync, int r, int c) { in av1_row_mt_sync_read() argument
88 const int nsync = row_mt_sync->sync_range; in av1_row_mt_sync_read()
91 pthread_mutex_t *const mutex = &row_mt_sync->mutex_[r - 1]; in av1_row_mt_sync_read()
94 while (c > row_mt_sync->cur_col[r - 1] - nsync) { in av1_row_mt_sync_read()
95 pthread_cond_wait(&row_mt_sync->cond_[r - 1], mutex); in av1_row_mt_sync_read()
100 (void)row_mt_sync; in av1_row_mt_sync_read()
106 void av1_row_mt_sync_write(AV1RowMTSync *const row_mt_sync, int r, int c, in av1_row_mt_sync_write() argument
109 const int nsync = row_mt_sync->sync_range; in av1_row_mt_sync_write()
122 pthread_mutex_lock(&row_mt_sync->mutex_[r]); in av1_row_mt_sync_write()
124 row_mt_sync->cur_col[r] = cur; in av1_row_mt_sync_write()
126 pthread_cond_signal(&row_mt_sync->cond_[r]); in av1_row_mt_sync_write()
127 pthread_mutex_unlock(&row_mt_sync->mutex_[r]); in av1_row_mt_sync_write()
130 (void)row_mt_sync; in av1_row_mt_sync_write()
138 void av1_row_mt_sync_mem_alloc(AV1RowMTSync *row_mt_sync, AV1_COMMON *cm, in av1_row_mt_sync_mem_alloc() argument
140 row_mt_sync->rows = rows; in av1_row_mt_sync_mem_alloc()
145 CHECK_MEM_ERROR(cm, row_mt_sync->mutex_, in av1_row_mt_sync_mem_alloc()
146 aom_malloc(sizeof(*row_mt_sync->mutex_) * rows)); in av1_row_mt_sync_mem_alloc()
147 if (row_mt_sync->mutex_) { in av1_row_mt_sync_mem_alloc()
149 pthread_mutex_init(&row_mt_sync->mutex_[i], NULL); in av1_row_mt_sync_mem_alloc()
153 CHECK_MEM_ERROR(cm, row_mt_sync->cond_, in av1_row_mt_sync_mem_alloc()
154 aom_malloc(sizeof(*row_mt_sync->cond_) * rows)); in av1_row_mt_sync_mem_alloc()
155 if (row_mt_sync->cond_) { in av1_row_mt_sync_mem_alloc()
157 pthread_cond_init(&row_mt_sync->cond_[i], NULL); in av1_row_mt_sync_mem_alloc()
163 CHECK_MEM_ERROR(cm, row_mt_sync->cur_col, in av1_row_mt_sync_mem_alloc()
164 aom_malloc(sizeof(*row_mt_sync->cur_col) * rows)); in av1_row_mt_sync_mem_alloc()
167 row_mt_sync->sync_range = 1; in av1_row_mt_sync_mem_alloc()
171 void av1_row_mt_sync_mem_dealloc(AV1RowMTSync *row_mt_sync) { in av1_row_mt_sync_mem_dealloc() argument
172 if (row_mt_sync != NULL) { in av1_row_mt_sync_mem_dealloc()
176 if (row_mt_sync->mutex_ != NULL) { in av1_row_mt_sync_mem_dealloc()
177 for (i = 0; i < row_mt_sync->rows; ++i) { in av1_row_mt_sync_mem_dealloc()
178 pthread_mutex_destroy(&row_mt_sync->mutex_[i]); in av1_row_mt_sync_mem_dealloc()
180 aom_free(row_mt_sync->mutex_); in av1_row_mt_sync_mem_dealloc()
182 if (row_mt_sync->cond_ != NULL) { in av1_row_mt_sync_mem_dealloc()
183 for (i = 0; i < row_mt_sync->rows; ++i) { in av1_row_mt_sync_mem_dealloc()
184 pthread_cond_destroy(&row_mt_sync->cond_[i]); in av1_row_mt_sync_mem_dealloc()
186 aom_free(row_mt_sync->cond_); in av1_row_mt_sync_mem_dealloc()
189 aom_free(row_mt_sync->cur_col); in av1_row_mt_sync_mem_dealloc()
193 av1_zero(*row_mt_sync); in av1_row_mt_sync_mem_dealloc()
672 memset(this_tile->row_mt_sync.cur_col, -1, in av1_encode_tiles_row_mt()
673 sizeof(*this_tile->row_mt_sync.cur_col) * max_sb_rows); in av1_encode_tiles_row_mt()