[FFmpeg-soc] [soc]: r840 - in dirac/libavcodec: dirac.c dirac_arith.c

marco subversion at mplayerhq.hu
Thu Aug 16 12:21:29 CEST 2007


Author: marco
Date: Thu Aug 16 12:21:29 2007
New Revision: 840

Log:
remove follow length

Modified:
   dirac/libavcodec/dirac.c
   dirac/libavcodec/dirac_arith.c

Modified: dirac/libavcodec/dirac.c
==============================================================================
--- dirac/libavcodec/dirac.c	(original)
+++ dirac/libavcodec/dirac.c	Thu Aug 16 12:21:29 2007
@@ -617,8 +617,9 @@ static int parse_access_unit_header(Dira
 
 static struct dirac_arith_context_set context_set_split =
     {
-        .follow = { ARITH_CONTEXT_SB_F1, ARITH_CONTEXT_SB_F2 },
-        .follow_length = 2,
+        .follow = { ARITH_CONTEXT_SB_F1, ARITH_CONTEXT_SB_F2,
+                    ARITH_CONTEXT_SB_F2, ARITH_CONTEXT_SB_F2,
+                    ARITH_CONTEXT_SB_F2, ARITH_CONTEXT_SB_F2 },
         .data = ARITH_CONTEXT_SB_DATA
     };
 
@@ -626,15 +627,15 @@ static struct dirac_arith_context_set co
     {
         .follow = { ARITH_CONTEXT_VECTOR_F1, ARITH_CONTEXT_VECTOR_F2,
                     ARITH_CONTEXT_VECTOR_F3, ARITH_CONTEXT_VECTOR_F4,
-                    ARITH_CONTEXT_VECTOR_F5 },
-        .follow_length = 5,
+                    ARITH_CONTEXT_VECTOR_F5, ARITH_CONTEXT_VECTOR_F5 },
         .data = ARITH_CONTEXT_VECTOR_DATA,
         .sign = ARITH_CONTEXT_VECTOR_SIGN
     };
 static struct dirac_arith_context_set context_set_dc =
     {
-        .follow = { ARITH_CONTEXT_DC_F1, ARITH_CONTEXT_DC_F2 },
-        .follow_length = 2,
+        .follow = { ARITH_CONTEXT_DC_F1, ARITH_CONTEXT_DC_F2,
+                    ARITH_CONTEXT_DC_F2, ARITH_CONTEXT_DC_F2,
+                    ARITH_CONTEXT_DC_F2, ARITH_CONTEXT_DC_F2 },
         .data = ARITH_CONTEXT_DC_DATA,
         .sign = ARITH_CONTEXT_DC_SIGN
     };
@@ -645,7 +646,6 @@ static struct dirac_arith_context_set co
         .follow = { ARITH_CONTEXT_ZPZN_F1, ARITH_CONTEXT_ZP_F2,
                     ARITH_CONTEXT_ZP_F3, ARITH_CONTEXT_ZP_F4,
                     ARITH_CONTEXT_ZP_F5, ARITH_CONTEXT_ZP_F6 },
-        .follow_length = 6,
         .data = ARITH_CONTEXT_COEFF_DATA,
         .sign = ARITH_CONTEXT_SIGN_ZERO,
     }, {
@@ -653,7 +653,6 @@ static struct dirac_arith_context_set co
         .follow = { ARITH_CONTEXT_ZPZN_F1, ARITH_CONTEXT_ZP_F2,
                     ARITH_CONTEXT_ZP_F3, ARITH_CONTEXT_ZP_F4,
                     ARITH_CONTEXT_ZP_F5, ARITH_CONTEXT_ZP_F6 },
-        .follow_length = 6,
         .data = ARITH_CONTEXT_COEFF_DATA,
         .sign = ARITH_CONTEXT_SIGN_NEG
     }, {
@@ -661,7 +660,6 @@ static struct dirac_arith_context_set co
         .follow = { ARITH_CONTEXT_ZPZN_F1, ARITH_CONTEXT_ZP_F2,
                     ARITH_CONTEXT_ZP_F3, ARITH_CONTEXT_ZP_F4,
                     ARITH_CONTEXT_ZP_F5, ARITH_CONTEXT_ZP_F6 },
-        .follow_length = 6,
         .data = ARITH_CONTEXT_COEFF_DATA,
         .sign = ARITH_CONTEXT_SIGN_POS
     },
@@ -671,7 +669,6 @@ static struct dirac_arith_context_set co
         .follow = { ARITH_CONTEXT_ZPNN_F1, ARITH_CONTEXT_ZP_F2,
                     ARITH_CONTEXT_ZP_F3, ARITH_CONTEXT_ZP_F4,
                     ARITH_CONTEXT_ZP_F5, ARITH_CONTEXT_ZP_F6 },
-        .follow_length = 6,
         .data = ARITH_CONTEXT_COEFF_DATA,
         .sign = ARITH_CONTEXT_SIGN_ZERO
     }, {
@@ -679,7 +676,6 @@ static struct dirac_arith_context_set co
         .follow = { ARITH_CONTEXT_ZPNN_F1, ARITH_CONTEXT_ZP_F2,
                     ARITH_CONTEXT_ZP_F3, ARITH_CONTEXT_ZP_F4,
                     ARITH_CONTEXT_ZP_F5, ARITH_CONTEXT_ZP_F6 },
-        .follow_length = 6,
         .data = ARITH_CONTEXT_COEFF_DATA,
         .sign = ARITH_CONTEXT_SIGN_NEG
     }, {
@@ -687,7 +683,6 @@ static struct dirac_arith_context_set co
         .follow = { ARITH_CONTEXT_ZPNN_F1, ARITH_CONTEXT_ZP_F2,
                     ARITH_CONTEXT_ZP_F3, ARITH_CONTEXT_ZP_F4,
                     ARITH_CONTEXT_ZP_F5, ARITH_CONTEXT_ZP_F6 },
-        .follow_length = 6,
         .data = ARITH_CONTEXT_COEFF_DATA,
         .sign = ARITH_CONTEXT_SIGN_POS
     },
@@ -697,7 +692,6 @@ static struct dirac_arith_context_set co
         .follow = { ARITH_CONTEXT_NPZN_F1, ARITH_CONTEXT_NP_F2,
                     ARITH_CONTEXT_NP_F3, ARITH_CONTEXT_NP_F4,
                     ARITH_CONTEXT_NP_F5, ARITH_CONTEXT_NP_F6 },
-        .follow_length = 6,
         .data = ARITH_CONTEXT_COEFF_DATA,
         .sign = ARITH_CONTEXT_SIGN_ZERO
     }, {
@@ -705,7 +699,6 @@ static struct dirac_arith_context_set co
         .follow = { ARITH_CONTEXT_NPZN_F1, ARITH_CONTEXT_NP_F2,
                     ARITH_CONTEXT_NP_F3, ARITH_CONTEXT_NP_F4,
                     ARITH_CONTEXT_NP_F5, ARITH_CONTEXT_NP_F6 },
-        .follow_length = 6,
         .data = ARITH_CONTEXT_COEFF_DATA,
         .sign = ARITH_CONTEXT_SIGN_NEG
     }, {
@@ -713,7 +706,6 @@ static struct dirac_arith_context_set co
         .follow = { ARITH_CONTEXT_NPZN_F1, ARITH_CONTEXT_NP_F2,
                     ARITH_CONTEXT_NP_F3, ARITH_CONTEXT_NP_F4,
                     ARITH_CONTEXT_NP_F5, ARITH_CONTEXT_NP_F6 },
-        .follow_length = 6,
         .data = ARITH_CONTEXT_COEFF_DATA,
         .sign = ARITH_CONTEXT_SIGN_POS
     },
@@ -724,7 +716,6 @@ static struct dirac_arith_context_set co
         .follow = { ARITH_CONTEXT_NPNN_F1, ARITH_CONTEXT_NP_F2,
                     ARITH_CONTEXT_NP_F3, ARITH_CONTEXT_NP_F4,
                     ARITH_CONTEXT_NP_F5, ARITH_CONTEXT_NP_F6 },
-        .follow_length = 6,
         .data = ARITH_CONTEXT_COEFF_DATA,
         .sign = ARITH_CONTEXT_SIGN_ZERO
     }, {
@@ -732,7 +723,6 @@ static struct dirac_arith_context_set co
         .follow = { ARITH_CONTEXT_NPNN_F1, ARITH_CONTEXT_NP_F2,
                     ARITH_CONTEXT_NP_F3, ARITH_CONTEXT_NP_F4,
                     ARITH_CONTEXT_NP_F5, ARITH_CONTEXT_NP_F6 },
-        .follow_length = 6,
         .data = ARITH_CONTEXT_COEFF_DATA,
         .sign = ARITH_CONTEXT_SIGN_NEG
     }, {
@@ -740,7 +730,6 @@ static struct dirac_arith_context_set co
         .follow = { ARITH_CONTEXT_NPNN_F1, ARITH_CONTEXT_NP_F2,
                     ARITH_CONTEXT_NP_F3, ARITH_CONTEXT_NP_F4,
                     ARITH_CONTEXT_NP_F5, ARITH_CONTEXT_NP_F6 },
-        .follow_length = 6,
         .data = ARITH_CONTEXT_COEFF_DATA,
         .sign = ARITH_CONTEXT_SIGN_POS
     }

Modified: dirac/libavcodec/dirac_arith.c
==============================================================================
--- dirac/libavcodec/dirac_arith.c	(original)
+++ dirac/libavcodec/dirac_arith.c	Thu Aug 16 12:21:29 2007
@@ -198,7 +198,7 @@ void dirac_arith_put_bit(dirac_arith_sta
 static unsigned inline int follow_context(int index,
                                           struct dirac_arith_context_set *context_set) {
     int pos;
-    pos = FFMIN(index, context_set->follow_length - 1);
+    pos = FFMIN(index, 5);
     return context_set->follow[pos];
 }
 
@@ -332,7 +332,6 @@ void dirac_arith_test(void) {
         .follow = { ARITH_CONTEXT_ZPZN_F1, ARITH_CONTEXT_ZP_F2,
                     ARITH_CONTEXT_ZP_F3, ARITH_CONTEXT_ZP_F4,
                     ARITH_CONTEXT_ZP_F5, ARITH_CONTEXT_ZP_F6 },
-        .follow_length = 6,
         .data = ARITH_CONTEXT_COEFF_DATA,
         .sign = ARITH_CONTEXT_SIGN_ZERO,
     };



More information about the FFmpeg-soc mailing list