comparison cabac.c @ 2116:48d9f86fb047 libavcodec

overread fix
author michael
date Thu, 08 Jul 2004 00:53:21 +0000
parents f65d87bfdd5a
children 1c39d9786efd
comparison
equal deleted inserted replaced
2115:4ea05f23730b 2116:48d9f86fb047
91 * @param buf_size size of buf in bits 91 * @param buf_size size of buf in bits
92 */ 92 */
93 void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size){ 93 void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size){
94 c->bytestream_start= 94 c->bytestream_start=
95 c->bytestream= buf; 95 c->bytestream= buf;
96 c->bytestream_end= buf + buf_size;
96 97
97 c->low= *c->bytestream++; 98 c->low= *c->bytestream++;
98 c->low= (c->low<<9) + ((*c->bytestream++)<<1); 99 c->low= (c->low<<9) + ((*c->bytestream++)<<1);
99 c->range= 0x1FE00; 100 c->range= 0x1FE00;
100 c->bits_left= 7; 101 c->bits_left= 7;