[FFmpeg-soc] [soc]: r455 - dirac/dirac.c

marco subversion at mplayerhq.hu
Tue Jul 17 17:40:58 CEST 2007


Author: marco
Date: Tue Jul 17 17:40:58 2007
New Revision: 455

Log:
Merge the two functions, arith_renormalize is not required.


Modified:
   dirac/dirac.c

Modified: dirac/dirac.c
==============================================================================
--- dirac/dirac.c	(original)
+++ dirac/dirac.c	Tue Jul 17 17:40:58 2007
@@ -564,26 +564,6 @@ static void arith_init (AVCodecContext *
     }
 }
 
-static void arith_renormalize (GetBitContext *gb) {
-    if (((arith_low + arith_range - 1)^arith_low) >= 0x8000) {
-        arith_code ^= 0x4000;
-        arith_low ^= 0x4000;
-    }
-    arith_low <<= 1;
-    arith_range <<= 1;
-    arith_low &= 0xFFFF;
-    arith_code <<= 1;
-    if (arith_bits_left > 0) {
-        arith_code |= get_bits (gb, 1);
-        arith_bits_left--;
-    }
-    else {
-        /* Get default: */
-        arith_code |= 1;
-    }
-    arith_code &= 0xffff;
-}
-
 static unsigned int arith_lookup[256] = {
     0,    2,    5,    8,    11,   15,   20,   24,
     29,   35,   41,   47,   53,   60,   67,   74,
@@ -642,8 +622,26 @@ static int arith_get_bit (GetBitContext 
     else
         arith_contexts[context] += arith_lookup[255 - (arith_contexts[context] >> 8)];
 
-    while (arith_range <= 0x4000)
-        arith_renormalize (gb);
+    while (arith_range <= 0x4000) {
+        if (((arith_low + arith_range - 1)^arith_low) >= 0x8000) {
+            arith_code ^= 0x4000;
+            arith_low ^= 0x4000;
+        }
+        arith_low <<= 1;
+        arith_range <<= 1;
+        arith_low &= 0xFFFF;
+        arith_code <<= 1;
+        if (arith_bits_left > 0) {
+            arith_code |= get_bits (gb, 1);
+            arith_bits_left--;
+        }
+        else {
+            /* Get default: */
+            arith_code |= 1;
+        }
+        arith_code &= 0xffff;
+    }
+
     return ret;
 }
 



More information about the FFmpeg-soc mailing list