vp10: don't reset contextual skip flag if block has no coefficients.
authorRonald S. Bultje <rsbultje@gmail.com>
Tue, 8 Sep 2015 18:24:30 +0000 (14:24 -0400)
committerRonald S. Bultje <rsbultje@gmail.com>
Wed, 16 Sep 2015 10:41:51 +0000 (06:41 -0400)
The implicitly changed value would be used for contextualizing future
skip flags of neighbour blocks (bottom/right), which is certainly not
what was intended. The original code stems from vp8, and was useful
in cases where coding of the skip flag was disabled. In vp9, the skip
flag is always coded. The result of this change is that for bitstream
parsing purposes, decoding of the skip flag becomes independent of
decoding of block coefficients.

See issue 1014.

Change-Id: I8629e6abe76f7c1d649f28cd6fe22a675ce4a15d

vp10/common/blockd.h
vp10/common/loopfilter.c
vp10/decoder/decodeframe.c

index 3e455cb..db49d97 100644 (file)
@@ -70,6 +70,9 @@ typedef struct {
   PREDICTION_MODE mode;
   TX_SIZE tx_size;
   int8_t skip;
+#if CONFIG_MISC_FIXES
+  int8_t has_no_coeffs;
+#endif
   int8_t segment_id;
   int8_t seg_id_predicted;  // valid only when temporal_update is enabled
 
index 1b1f67d..1b89ed5 100644 (file)
@@ -754,8 +754,13 @@ static void build_masks(const loop_filter_info_n *const lfi_n,
 
   // If the block has no coefficients and is not intra we skip applying
   // the loop filter on block edges.
+#if CONFIG_MISC_FIXES
+  if ((mbmi->skip || mbmi->has_no_coeffs) && is_inter_block(mbmi))
+    return;
+#else
   if (mbmi->skip && is_inter_block(mbmi))
     return;
+#endif
 
   // Here we are adding a mask for the transform size. The transform
   // size mask is set to be correct for a 64x64 prediction block size. We
@@ -812,8 +817,13 @@ static void build_y_mask(const loop_filter_info_n *const lfi_n,
   *above_y |= above_prediction_mask[block_size] << shift_y;
   *left_y |= left_prediction_mask[block_size] << shift_y;
 
+#if CONFIG_MISC_FIXES
+  if ((mbmi->skip || mbmi->has_no_coeffs) && is_inter_block(mbmi))
+    return;
+#else
   if (mbmi->skip && is_inter_block(mbmi))
     return;
+#endif
 
   *above_y |= (size_mask[block_size] &
                above_64x64_txform_mask[tx_size_y]) << shift_y;
index b4c8841..d6a4e6f 100644 (file)
@@ -858,7 +858,11 @@ static void decode_block(VP10Decoder *const pbi, MACROBLOCKD *const xd,
       }
 
       if (!less8x8 && eobtotal == 0)
+#if CONFIG_MISC_FIXES
+        mbmi->has_no_coeffs = 1;  // skip loopfilter
+#else
         mbmi->skip = 1;  // skip loopfilter
+#endif
     }
   }