comparison cabac.h @ 3964:162bea01a5d4 libavcodec

decrease ff_h264_norm_shift[] size
author michael
date Mon, 09 Oct 2006 00:59:42 +0000
parents 2acfc35c3075
children 01e1a12aa380
comparison
equal deleted inserted replaced
3963:075b3e6bdc05 3964:162bea01a5d4
49 }CABACContext; 49 }CABACContext;
50 50
51 extern const uint8_t ff_h264_lps_range[64][4]; 51 extern const uint8_t ff_h264_lps_range[64][4];
52 extern const uint8_t ff_h264_mps_state[64]; 52 extern const uint8_t ff_h264_mps_state[64];
53 extern const uint8_t ff_h264_lps_state[64]; 53 extern const uint8_t ff_h264_lps_state[64];
54 extern const uint8_t ff_h264_norm_shift[256]; 54 extern const uint8_t ff_h264_norm_shift[128];
55 55
56 56
57 void ff_init_cabac_encoder(CABACContext *c, uint8_t *buf, int buf_size); 57 void ff_init_cabac_encoder(CABACContext *c, uint8_t *buf, int buf_size);
58 void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size); 58 void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size);
59 void ff_init_cabac_states(CABACContext *c, uint8_t const (*lps_range)[4], 59 void ff_init_cabac_states(CABACContext *c, uint8_t const (*lps_range)[4],
268 268
269 static void refill2(CABACContext *c){ 269 static void refill2(CABACContext *c){
270 int i, x; 270 int i, x;
271 271
272 x= c->low ^ (c->low-1); 272 x= c->low ^ (c->low-1);
273 i= 9 - ff_h264_norm_shift[x>>(CABAC_BITS+1)]; 273 i= 7 - ff_h264_norm_shift[x>>(CABAC_BITS+1)];
274 274
275 x= -CABAC_MASK; 275 x= -CABAC_MASK;
276 276
277 if(c->bytestream <= c->bytestream_end) 277 if(c->bytestream <= c->bytestream_end)
278 #if CABAC_BITS == 16 278 #if CABAC_BITS == 16
391 if(s<128) 391 if(s<128)
392 *state= s; 392 *state= s;
393 #endif 393 #endif
394 renorm_cabac_decoder_once(c); 394 renorm_cabac_decoder_once(c);
395 }else{ 395 }else{
396 bit= ff_h264_norm_shift[RangeLPS>>17]; 396 bit= ff_h264_norm_shift[RangeLPS>>19];
397 c->low -= c->range; 397 c->low -= c->range;
398 *state= c->lps_state[s]; 398 *state= c->lps_state[s];
399 c->range = RangeLPS<<bit; 399 c->range = RangeLPS<<bit;
400 c->low <<= bit; 400 c->low <<= bit;
401 bit= (s&1)^1; 401 bit= (s&1)^1;