decoder: reset segmentation map on keyframes
authorJohn Koleszar <jkoleszar@google.com>
Thu, 16 Feb 2012 19:15:11 +0000 (11:15 -0800)
committerJohn Koleszar <jkoleszar@google.com>
Thu, 16 Feb 2012 20:22:18 +0000 (12:22 -0800)
Refactoring some of the mode decoding logic introduced a bug where
the segmentation maps would not be properly reset on keyframes.

http://code.google.com/p/webm/issues/detail?id=378

The text of the bug is somewhat misleading as I initially read it to
imply the bug was present in v0.9.7-p1 (Cayuga), but note the text
"master", which indicates this was something subsequent. This issue
bisects back to v0.9.7-p1-84-ga99c20c, so unfortunately it was broken
during the Duclair release.

Thanks to Alexei Leonenko for investigating the root cause.

Change-Id: I9713c9f070eb37b31b3b029d9ef96be9b6ea2def

vp8/decoder/decodframe.c

index ad86ea5..1ac868f 100644 (file)
@@ -827,6 +827,12 @@ int vp8_decode_frame(VP8D_COMP *pbi)
             }
         }
     }
+    else
+    {
+        /* No segmentation updates on this frame */
+        xd->update_mb_segmentation_map = 0;
+        xd->update_mb_segmentation_data = 0;
+    }
 
     /* Read the loop filter level and type */
     pc->filter_type = (LOOPFILTERTYPE) vp8_read_bit(bc);