Mercurial > libavcodec.hg
comparison cabac.h @ 5754:6e3cd570c312 libavcodec
100l: Revert accidental commit, restore previous version.
author | diego |
---|---|
date | Tue, 02 Oct 2007 13:14:37 +0000 |
parents | af20477e9994 |
children | 2926fc2a0396 |
comparison
equal
deleted
inserted
replaced
5753:25429b089d96 | 5754:6e3cd570c312 |
---|---|
88 c->range+= c->range; | 88 c->range+= c->range; |
89 c->low += c->low; | 89 c->low += c->low; |
90 } | 90 } |
91 } | 91 } |
92 | 92 |
93 #if 0 | |
94 static void put_cabac(CABACContext *c, uint8_t * const state, int bit){ | 93 static void put_cabac(CABACContext *c, uint8_t * const state, int bit){ |
95 int RangeLPS= ff_h264_lps_range[2*(c->range&0xC0) + *state]; | 94 int RangeLPS= ff_h264_lps_range[2*(c->range&0xC0) + *state]; |
96 | 95 |
97 if(bit == ((*state)&1)){ | 96 if(bit == ((*state)&1)){ |
98 c->range -= RangeLPS; | 97 c->range -= RangeLPS; |
258 | 257 |
259 if(is_signed) | 258 if(is_signed) |
260 put_cabac_bypass(c, sign); | 259 put_cabac_bypass(c, sign); |
261 } | 260 } |
262 } | 261 } |
263 #endif /* 0 */ | |
264 | 262 |
265 static void refill(CABACContext *c){ | 263 static void refill(CABACContext *c){ |
266 #if CABAC_BITS == 16 | 264 #if CABAC_BITS == 16 |
267 c->low+= (c->bytestream[0]<<9) + (c->bytestream[1]<<1); | 265 c->low+= (c->bytestream[0]<<9) + (c->bytestream[1]<<1); |
268 #else | 266 #else |
270 #endif | 268 #endif |
271 c->low -= CABAC_MASK; | 269 c->low -= CABAC_MASK; |
272 c->bytestream+= CABAC_BITS/8; | 270 c->bytestream+= CABAC_BITS/8; |
273 } | 271 } |
274 | 272 |
275 #if 0 | |
276 static void refill2(CABACContext *c){ | 273 static void refill2(CABACContext *c){ |
277 int i, x; | 274 int i, x; |
278 | 275 |
279 x= c->low ^ (c->low-1); | 276 x= c->low ^ (c->low-1); |
280 i= 7 - ff_h264_norm_shift[x>>(CABAC_BITS-1)]; | 277 i= 7 - ff_h264_norm_shift[x>>(CABAC_BITS-1)]; |
288 #endif | 285 #endif |
289 | 286 |
290 c->low += x<<i; | 287 c->low += x<<i; |
291 c->bytestream+= CABAC_BITS/8; | 288 c->bytestream+= CABAC_BITS/8; |
292 } | 289 } |
293 #endif | |
294 | 290 |
295 static inline void renorm_cabac_decoder(CABACContext *c){ | 291 static inline void renorm_cabac_decoder(CABACContext *c){ |
296 while(c->range < 0x100){ | 292 while(c->range < 0x100){ |
297 c->range+= c->range; | 293 c->range+= c->range; |
298 c->low+= c->low; | 294 c->low+= c->low; |
862 if(is_signed && get_cabac_bypass(c)){ | 858 if(is_signed && get_cabac_bypass(c)){ |
863 return -i; | 859 return -i; |
864 }else | 860 }else |
865 return i; | 861 return i; |
866 } | 862 } |
867 #endif /* 0 */ | |
868 | 863 |
869 #endif /* CABAC_H */ | 864 #endif /* CABAC_H */ |