[vp9] Fix handling of skip in row_mt=1
authorHarish Mahendrakar <harish.mahendrakar@ittiam.com>
Fri, 19 Apr 2019 23:37:37 +0000 (16:37 -0700)
committerHarish Mahendrakar <harish.mahendrakar@ittiam.com>
Mon, 22 Apr 2019 15:55:24 +0000 (15:55 +0000)
For row_mt=1, when mi->skip is set to 1 after parse based on
eobtotal for that partition, dqcoeff and eob need to be restored
as recon_partition doesn't increment these pointers for skip cases

Change-Id: I79711b0c175937aa6da3bba3b3bc053f91a8ce35

vp9/decoder/vp9_decodeframe.c

index ccfb813..d80472c 100644 (file)
@@ -1056,10 +1056,28 @@ static void parse_block(TileWorkerData *twd, VP9Decoder *const pbi, int mi_row,
     predict_recon_intra(xd, mi, twd, parse_intra_block_row_mt);
   } else {
     if (!mi->skip) {
-      const int eobtotal =
-          predict_recon_inter(xd, mi, twd, parse_inter_block_row_mt);
-
-      if (bsize >= BLOCK_8X8 && eobtotal == 0) mi->skip = 1;  // skip loopfilter
+      tran_low_t *dqcoeff[MAX_MB_PLANE];
+      int *eob[MAX_MB_PLANE];
+      int plane;
+      int eobtotal;
+      // Based on eobtotal and bsize, this may be mi->skip may be set to true
+      // In that case dqcoeff and eob need to be backed up and restored as
+      // recon_block will not increment these pointers for skip cases
+      for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
+        const struct macroblockd_plane *const pd = &xd->plane[plane];
+        dqcoeff[plane] = pd->dqcoeff;
+        eob[plane] = pd->eob;
+      }
+      eobtotal = predict_recon_inter(xd, mi, twd, parse_inter_block_row_mt);
+
+      if (bsize >= BLOCK_8X8 && eobtotal == 0) {
+        mi->skip = 1;  // skip loopfilter
+        for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
+          struct macroblockd_plane *pd = &xd->plane[plane];
+          pd->dqcoeff = dqcoeff[plane];
+          pd->eob = eob[plane];
+        }
+      }
     }
   }