[FFmpeg-cvslog] r24680 - in trunk/libavcodec: vp8.c vp8data.h

darkshikari subversion
Tue Aug 3 12:37:14 CEST 2010


Author: darkshikari
Date: Tue Aug  3 12:37:14 2010
New Revision: 24680

Log:
VP8: unroll splitmv decoding tree
Much faster splitmv mode decoding.

Modified:
   trunk/libavcodec/vp8.c
   trunk/libavcodec/vp8data.h

Modified: trunk/libavcodec/vp8.c
==============================================================================
--- trunk/libavcodec/vp8.c	Tue Aug  3 12:24:28 2010	(r24679)
+++ trunk/libavcodec/vp8.c	Tue Aug  3 12:37:14 2010	(r24680)
@@ -673,20 +673,19 @@ int decode_splitmvs(VP8Context *s, VP56R
 
         submv_prob = get_submv_prob(left, above);
 
-        switch (vp8_rac_get_tree(c, vp8_submv_ref_tree, submv_prob)) {
-        case VP8_SUBMVMODE_NEW4X4:
-            mb->bmv[n].y = mb->mv.y + read_mv_component(c, s->prob->mvc[0]);
-            mb->bmv[n].x = mb->mv.x + read_mv_component(c, s->prob->mvc[1]);
-            break;
-        case VP8_SUBMVMODE_ZERO4X4:
-            AV_ZERO32(&mb->bmv[n]);
-            break;
-        case VP8_SUBMVMODE_LEFT4X4:
+        if (vp56_rac_get_prob_branchy(c, submv_prob[0])) {
+            if (vp56_rac_get_prob_branchy(c, submv_prob[1])) {
+                if (vp56_rac_get_prob_branchy(c, submv_prob[2])) {
+                    mb->bmv[n].y = mb->mv.y + read_mv_component(c, s->prob->mvc[0]);
+                    mb->bmv[n].x = mb->mv.x + read_mv_component(c, s->prob->mvc[1]);
+                } else {
+                    AV_ZERO32(&mb->bmv[n]);
+                }
+            } else {
+                AV_WN32A(&mb->bmv[n], above);
+            }
+        } else {
             AV_WN32A(&mb->bmv[n], left);
-            break;
-        case VP8_SUBMVMODE_TOP4X4:
-            AV_WN32A(&mb->bmv[n], above);
-            break;
         }
     }
 

Modified: trunk/libavcodec/vp8data.h
==============================================================================
--- trunk/libavcodec/vp8data.h	Tue Aug  3 12:24:28 2010	(r24679)
+++ trunk/libavcodec/vp8data.h	Tue Aug  3 12:37:14 2010	(r24680)
@@ -55,13 +55,6 @@ enum inter_mvmode {
     VP8_MVMODE_SPLIT
 };
 
-enum inter_submvmode {
-    VP8_SUBMVMODE_LEFT4X4,
-    VP8_SUBMVMODE_TOP4X4,
-    VP8_SUBMVMODE_ZERO4X4,
-    VP8_SUBMVMODE_NEW4X4
-};
-
 enum inter_splitmvmode {
     VP8_SPLITMVMODE_16x8 = 0,    ///< 2 16x8 blocks (vertical)
     VP8_SPLITMVMODE_8x16,        ///< 2 8x16 blocks (horizontal)
@@ -139,12 +132,6 @@ static const uint8_t vp8_submv_prob[5][3
     { 208,   1,   1 }
 };
 
-static const int8_t vp8_submv_ref_tree[3][2] = {
-    { -VP8_SUBMVMODE_LEFT4X4, 1 },          // '0'
-     { -VP8_SUBMVMODE_TOP4X4, 2 },          // '10'
-      { -VP8_SUBMVMODE_ZERO4X4, -VP8_SUBMVMODE_NEW4X4 } // '110', '111'
-};
-
 static const uint8_t vp8_pred16x16_prob_intra[4] = { 145, 156, 163, 128 };
 static const uint8_t vp8_pred16x16_prob_inter[4] = { 112,  86, 140,  37 };
 



More information about the ffmpeg-cvslog mailing list