[Mndiff-dev] [mndiff]: r16 - trunk/mnzip/mnzip.c
michael
subversion at mplayerhq.hu
Sat Jun 9 12:47:13 CEST 2007
Author: michael
Date: Sat Jun 9 12:47:12 2007
New Revision: 16
Log:
get rid of putbit_clip()
Modified:
trunk/mnzip/mnzip.c
Modified: trunk/mnzip/mnzip.c
==============================================================================
--- trunk/mnzip/mnzip.c (original)
+++ trunk/mnzip/mnzip.c Sat Jun 9 12:47:12 2007
@@ -436,30 +436,7 @@ static void init_prob(unsigned short *pr
}
}
-static inline void putbit_clip(RangeCoder *c, uint32_t *state, int b, int min, int max, unsigned short *prob){
-#if 0
- if(*state &1){
- int x= (*state&0xFF)>>1;
- int y= *state>>9;
- uint8_t s= clip((256*x + (x+y)/2) / (x+y), min, max);
- put_rac(c, &s, b);
-
- if(b) x++;
- else y++;
- if(x+y>8)
- *state= ((65536*x + (x+y)/2) / (x+y)) & 0xFFFE;
- else
- *state= (x + y*256)*2+1;
- }else{
- uint8_t s= clip(*state>>8, min, max);
- put_rac(c, &s, b);
-
- *state+= ((b*65536 - *state)*30 + 512)>>10;
- *state&=0xFFFE;
- }
-#elif 0
- put_rac(c, (uint8_t*)state + 1, b);
-#else
+static inline void putbit(RangeCoder *c, uint32_t *state, int b, unsigned short *prob){
int ctx= *state;
uint8_t s= clip(prob[ctx]>>8, 1, 255);
@@ -467,11 +444,6 @@ static inline void putbit_clip(RangeCode
prob[ctx]+= ((b*65536 - prob[ctx])*4 + 512)>>10;
*state= state_table[ctx][b];
-#endif
-}
-
-static inline void putbit(RangeCoder *c, uint32_t *state, int b, unsigned short *prob){
- putbit_clip(c, state, b, 1, 255, prob);
}
static inline int getbit(RangeCoder *c, uint32_t *state, unsigned short *prob){
More information about the Mndiff-dev
mailing list