VP8: Unroll decoding segment update
authorDavid Conrad <lessen42@gmail.com>
Sun, 25 Jul 2010 02:44:31 +0000 (22:44 -0400)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 26 Oct 2011 22:00:29 +0000 (00:00 +0200)
libavcodec/vp8.c

index 8c03803..9b07608 100644 (file)
@@ -627,9 +627,10 @@ void decode_mb_mode(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, uint8_
 {
     VP56RangeCoder *c = &s->c;
 
-    if (s->segmentation.update_map)
-        *segment = vp8_rac_get_tree(c, vp8_segmentid_tree, s->prob->segmentid);
-    else
+    if (s->segmentation.update_map) {
+        int bit  = vp56_rac_get_prob(c, s->prob->segmentid[0]);
+        *segment = vp56_rac_get_prob(c, s->prob->segmentid[1+bit]) + 2*bit;
+    } else
         *segment = ref ? *ref : *segment;
     s->segment = *segment;