Fix deallocation in encoder row-mt While switching between row-mt and tile-mt at frame level, in case the last frame is being encoded with tile-mt, the memory allocated for row-mt use case should also be freed. Change-Id: I6b18f86a3116063192fa8cf7931dbd878204b594
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c index 9cfcd58..2896519 100644 --- a/av1/encoder/encoder.c +++ b/av1/encoder/encoder.c
@@ -3089,7 +3089,7 @@ aom_get_worker_interface()->end(worker); // Deallocate allocated thread data. - if (cpi->row_mt == 1) aom_free(thread_data->td->tctx); + aom_free(thread_data->td->tctx); if (t > 0) { aom_free(thread_data->td->palette_buffer); aom_free(thread_data->td->tmp_conv_dst); @@ -3114,11 +3114,9 @@ } } #if CONFIG_MULTITHREAD - if (cpi->row_mt == 1) { - if (cpi->row_mt_mutex_ != NULL) { - pthread_mutex_destroy(cpi->row_mt_mutex_); - aom_free(cpi->row_mt_mutex_); - } + if (cpi->row_mt_mutex_ != NULL) { + pthread_mutex_destroy(cpi->row_mt_mutex_); + aom_free(cpi->row_mt_mutex_); } #endif av1_row_mt_mem_dealloc(cpi);