Mercurial > libavcodec.hg
comparison cabac.h @ 5752:af20477e9994 libavcodec
Replace CONFIG_VORBIS_DECODER #ifdef by if (ENABLE_VORBIS_DECODER).
Blessed by Luca Barbato on IRC.
author | diego |
---|---|
date | Tue, 02 Oct 2007 12:34:43 +0000 |
parents | 9ad4e94cc5b8 |
children | 6e3cd570c312 |
comparison
equal
deleted
inserted
replaced
5751:3260fa3c89eb | 5752:af20477e9994 |
---|---|
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 | |
93 static void put_cabac(CABACContext *c, uint8_t * const state, int bit){ | 94 static void put_cabac(CABACContext *c, uint8_t * const state, int bit){ |
94 int RangeLPS= ff_h264_lps_range[2*(c->range&0xC0) + *state]; | 95 int RangeLPS= ff_h264_lps_range[2*(c->range&0xC0) + *state]; |
95 | 96 |
96 if(bit == ((*state)&1)){ | 97 if(bit == ((*state)&1)){ |
97 c->range -= RangeLPS; | 98 c->range -= RangeLPS; |
257 | 258 |
258 if(is_signed) | 259 if(is_signed) |
259 put_cabac_bypass(c, sign); | 260 put_cabac_bypass(c, sign); |
260 } | 261 } |
261 } | 262 } |
263 #endif /* 0 */ | |
262 | 264 |
263 static void refill(CABACContext *c){ | 265 static void refill(CABACContext *c){ |
264 #if CABAC_BITS == 16 | 266 #if CABAC_BITS == 16 |
265 c->low+= (c->bytestream[0]<<9) + (c->bytestream[1]<<1); | 267 c->low+= (c->bytestream[0]<<9) + (c->bytestream[1]<<1); |
266 #else | 268 #else |
268 #endif | 270 #endif |
269 c->low -= CABAC_MASK; | 271 c->low -= CABAC_MASK; |
270 c->bytestream+= CABAC_BITS/8; | 272 c->bytestream+= CABAC_BITS/8; |
271 } | 273 } |
272 | 274 |
275 #if 0 | |
273 static void refill2(CABACContext *c){ | 276 static void refill2(CABACContext *c){ |
274 int i, x; | 277 int i, x; |
275 | 278 |
276 x= c->low ^ (c->low-1); | 279 x= c->low ^ (c->low-1); |
277 i= 7 - ff_h264_norm_shift[x>>(CABAC_BITS-1)]; | 280 i= 7 - ff_h264_norm_shift[x>>(CABAC_BITS-1)]; |
285 #endif | 288 #endif |
286 | 289 |
287 c->low += x<<i; | 290 c->low += x<<i; |
288 c->bytestream+= CABAC_BITS/8; | 291 c->bytestream+= CABAC_BITS/8; |
289 } | 292 } |
293 #endif | |
290 | 294 |
291 static inline void renorm_cabac_decoder(CABACContext *c){ | 295 static inline void renorm_cabac_decoder(CABACContext *c){ |
292 while(c->range < 0x100){ | 296 while(c->range < 0x100){ |
293 c->range+= c->range; | 297 c->range+= c->range; |
294 c->low+= c->low; | 298 c->low+= c->low; |
858 if(is_signed && get_cabac_bypass(c)){ | 862 if(is_signed && get_cabac_bypass(c)){ |
859 return -i; | 863 return -i; |
860 }else | 864 }else |
861 return i; | 865 return i; |
862 } | 866 } |
867 #endif /* 0 */ | |
863 | 868 |
864 #endif /* CABAC_H */ | 869 #endif /* CABAC_H */ |