Use av1_num_planes(cm) in av1_init_mt_sync() Use av1_num_planes(cm) instead of MAX_MB_PLANE for the av1_loop_restoration_alloc() call in av1_init_mt_sync(). Change-Id: I0fb4a17abede20a8e4715bc425bd194ac528d971
diff --git a/av1/encoder/ethread.c b/av1/encoder/ethread.c index 0422856..9fad50c 100644 --- a/av1/encoder/ethread.c +++ b/av1/encoder/ethread.c
@@ -920,12 +920,13 @@ int rst_unit_size = cpi->sf.lpf_sf.min_lr_unit_size; int num_rows_lr = av1_lr_count_units(rst_unit_size, cm->height); int num_lr_workers = av1_get_num_mod_workers_for_alloc(p_mt_info, MOD_LR); + const int num_planes = av1_num_planes(cm); if (!lr_sync->sync_range || num_rows_lr > lr_sync->rows || num_lr_workers > lr_sync->num_workers || - MAX_MB_PLANE > lr_sync->num_planes) { + num_planes > lr_sync->num_planes) { av1_loop_restoration_dealloc(lr_sync); av1_loop_restoration_alloc(lr_sync, cm, num_lr_workers, num_rows_lr, - MAX_MB_PLANE, cm->width); + num_planes, cm->width); } } #endif