shithub: libvpx

Download patch

ref: d33705d13af462f27b19e7b29b25041d041d664f
parent: 37e7c8a7a8e709b5db8bf43d481db74b45aee1e6
parent: 3035d5c547029d4df1266d89f5ef57fc0dc60e71
author: James Zern <jzern@google.com>
date: Thu Dec 20 22:59:56 EST 2018

Merge "vp9: limit lpf workers to min(threads,tiles,sb_rows)"

--- a/vp9/common/vp9_thread_common.c
+++ b/vp9/common/vp9_thread_common.c
@@ -159,7 +159,12 @@
   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;
-  const int num_workers = VPXMIN(nworkers, sb_rows);
+  const int num_tile_cols = 1 << cm->log2_tile_cols;
+  // Limit the number of workers to prevent changes in frame dimensions from
+  // causing incorrect sync calculations when sb_rows < threads/tile_cols.
+  // Further restrict them by the number of tile columns should the user
+  // request more as this implementation doesn't scale well beyond that.
+  const int num_workers = VPXMIN(nworkers, VPXMIN(num_tile_cols, sb_rows));
   int i;
 
   if (!lf_sync->sync_range || sb_rows != lf_sync->rows ||