diff options
author | James Zern <jzern@google.com> | 2018-08-07 20:07:09 -0700 |
---|---|---|
committer | James Zern <jzern@google.com> | 2018-08-07 20:14:42 -0700 |
commit | 0acc7365abf97214a045c14f66e5934884395e6d (patch) | |
tree | c2f483924471eb4040f047b3627378f898c8f3bb /vp9/common/vp9_thread_common.c | |
parent | aab2aff9aa264d573852f4dce34bea47708cf1be (diff) | |
download | libvpx-0acc7365abf97214a045c14f66e5934884395e6d.tar libvpx-0acc7365abf97214a045c14f66e5934884395e6d.tar.gz libvpx-0acc7365abf97214a045c14f66e5934884395e6d.tar.bz2 libvpx-0acc7365abf97214a045c14f66e5934884395e6d.zip |
loop_filter_rows_mt: use sb_rows to limit workers
Previously if the number of tiles decreased within a clip and there were
fewer super block rows than workers the mi_row calculation would cause
rows to be skipped. The num_workers stored is the max allocated amount,
use sb_rows to limit the active ones if the row count is smaller as
additional threads will provide no benefit.
Change-Id: I1750296c8c21082de2594afecc4d6a3929db1f12
Diffstat (limited to 'vp9/common/vp9_thread_common.c')
-rw-r--r-- | vp9/common/vp9_thread_common.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/vp9/common/vp9_thread_common.c b/vp9/common/vp9_thread_common.c index 8d44e91f2..e0f5e0d83 100644 --- a/vp9/common/vp9_thread_common.c +++ b/vp9/common/vp9_thread_common.c @@ -91,6 +91,7 @@ static INLINE void thread_loop_filter_rows( int y_only, VP9LfSync *const lf_sync) { const int num_planes = y_only ? 1 : MAX_MB_PLANE; const int sb_cols = mi_cols_aligned_to_sb(cm->mi_cols) >> MI_BLOCK_SIZE_LOG2; + const int num_active_workers = VPXMIN(lf_sync->num_workers, lf_sync->rows); int mi_row, mi_col; enum lf_path path; if (y_only) @@ -103,7 +104,7 @@ static INLINE void thread_loop_filter_rows( path = LF_PATH_SLOW; for (mi_row = start; mi_row < stop; - mi_row += lf_sync->num_workers * MI_BLOCK_SIZE) { + mi_row += num_active_workers * MI_BLOCK_SIZE) { MODE_INFO **const mi = cm->mi_grid_visible + mi_row * cm->mi_stride; LOOP_FILTER_MASK *lfm = get_lfm(&cm->lf, mi_row, 0); @@ -157,10 +158,7 @@ static void loop_filter_rows_mt(YV12_BUFFER_CONFIG *frame, VP9_COMMON *cm, const VPxWorkerInterface *const winterface = vpx_get_worker_interface(); // Number of superblock rows and cols const int sb_rows = mi_cols_aligned_to_sb(cm->mi_rows) >> MI_BLOCK_SIZE_LOG2; - // Decoder may allocate more threads than number of tiles based on user's - // input. - const int tile_cols = 1 << cm->log2_tile_cols; - const int num_workers = VPXMIN(nworkers, tile_cols); + const int num_workers = VPXMIN(nworkers, sb_rows); int i; if (!lf_sync->sync_range || sb_rows != lf_sync->rows || |