]> granicus.if.org Git - libvpx/commitdiff
Row tile fix
authorDebargha Mukherjee <debargha@google.com>
Fri, 15 May 2015 15:01:21 +0000 (08:01 -0700)
committerDebargha Mukherjee <debargha@google.com>
Fri, 15 May 2015 15:01:21 +0000 (08:01 -0700)
Fixes mismatch with intrabc experiment.

Change-Id: I1d83a8aa5584fb35396351f7fae7f9365598d00f

vp9/decoder/vp9_decodeframe.c

index e34818c598fcf8f877e60f5870762983979400b2..eeb0a496d0e289f57fb6452bf759d38e9056283a 100644 (file)
@@ -2017,9 +2017,9 @@ static const uint8_t *decode_tiles(VP9Decoder *pbi,
   }
 
   for (tile_row = 0; tile_row < tile_rows; ++tile_row) {
+    TileInfo tile;
+    vp9_tile_set_row(&tile, cm, tile_row);
     for (tile_col = 0; tile_col < tile_cols; ++tile_col) {
-      TileInfo tile;
-      vp9_tile_set_row(&tile, cm, tile_row);
       vp9_tile_set_col(&tile, cm, tile_col);
 
       for (mi_row = tile.mi_row_start; mi_row < tile.mi_row_end;
@@ -2041,13 +2041,38 @@ static const uint8_t *decode_tiles(VP9Decoder *pbi,
         pbi->mb.corrupted |= tile_data->xd.corrupted;
       }
     }
+#if !CONFIG_INTRABC
+    // Loopfilter one row.
+    if (!pbi->mb.corrupted && cm->lf.filter_level) {
+      const int lf_start = tile.mi_row_start - MI_BLOCK_SIZE;
+      LFWorkerData *const lf_data = (LFWorkerData*)pbi->lf_worker.data1;
+
+      // delay the loopfilter by 1 macroblock row.
+      if (lf_start < 0) continue;
+
+      // decoding has completed: finish up the loop filter in this thread.
+      if (tile.mi_row_end >= cm->mi_rows) continue;
+
+      winterface->sync(&pbi->lf_worker);
+      lf_data->start = lf_start;
+      lf_data->stop = tile.mi_row_end - MI_BLOCK_SIZE;;
+      if (pbi->max_threads > 1) {
+        winterface->launch(&pbi->lf_worker);
+      } else {
+        winterface->execute(&pbi->lf_worker);
+      }
+    }
+#endif  // !CONFIG_INTRABC
   }
 
-#if !CONFIG_INTRABC
-  if (cm->lf.filter_level > 0)
-    vp9_loop_filter_frame(get_frame_new_buffer(cm), cm,
-                          &pbi->mb, cm->lf.filter_level, 0, 0);
-#endif
+  // Loopfilter remaining rows in the frame.
+  if (!pbi->mb.corrupted && cm->lf.filter_level) {
+    LFWorkerData *const lf_data = (LFWorkerData*)pbi->lf_worker.data1;
+    winterface->sync(&pbi->lf_worker);
+    lf_data->start = lf_data->stop;
+    lf_data->stop = cm->mi_rows;
+    winterface->execute(&pbi->lf_worker);
+  }
 
   // Get last tile data.
   tile_data = pbi->tile_data + tile_cols * tile_rows - 1;