[Mndiff-dev] [mndiff]: r17 - trunk/mnzip/mnzip.c

michael subversion at mplayerhq.hu
Sat Jun 9 12:55:26 CEST 2007


Author: michael
Date: Sat Jun  9 12:55:26 2007
New Revision: 17

Log:
simplify


Modified:
   trunk/mnzip/mnzip.c

Modified: trunk/mnzip/mnzip.c
==============================================================================
--- trunk/mnzip/mnzip.c	(original)
+++ trunk/mnzip/mnzip.c	Sat Jun  9 12:55:26 2007
@@ -441,7 +441,7 @@ static inline void putbit(RangeCoder *c,
 
     uint8_t s= clip(prob[ctx]>>8, 1, 255);
     put_rac(c, &s, b);
-    prob[ctx]+= ((b*65536 - prob[ctx])*4 + 512)>>10;
+    prob[ctx]+= (b*65536 - prob[ctx] + 128)>>8;
 
     *state= state_table[ctx][b];
 }
@@ -451,7 +451,7 @@ static inline int getbit(RangeCoder *c, 
 
     uint8_t s= clip(prob[ctx]>>8, 1, 255);
     int b= get_rac(c, &s);
-    prob[ctx]+= ((b*65536 - prob[ctx])*4 + 512)>>10;
+    prob[ctx]+= (b*65536 - prob[ctx] + 128)>>8;
 
     *state= state_table[ctx][b];
 



More information about the Mndiff-dev mailing list