| OLD | NEW |
| 1 /* Copyright (c) 2001-2011 Timothy B. Terriberry | 1 /* Copyright (c) 2001-2011 Timothy B. Terriberry |
| 2 Copyright (c) 2008-2009 Xiph.Org Foundation */ | 2 Copyright (c) 2008-2009 Xiph.Org Foundation */ |
| 3 /* | 3 /* |
| 4 Redistribution and use in source and binary forms, with or without | 4 Redistribution and use in source and binary forms, with or without |
| 5 modification, are permitted provided that the following conditions | 5 modification, are permitted provided that the following conditions |
| 6 are met: | 6 are met: |
| 7 | 7 |
| 8 - Redistributions of source code must retain the above copyright | 8 - Redistributions of source code must retain the above copyright |
| 9 notice, this list of conditions and the following disclaimer. | 9 notice, this list of conditions and the following disclaimer. |
| 10 | 10 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 } | 78 } |
| 79 @ARTICLE{MNW98, | 79 @ARTICLE{MNW98, |
| 80 author="Alistair Moffat and Radford Neal and Ian H. Witten", | 80 author="Alistair Moffat and Radford Neal and Ian H. Witten", |
| 81 title="Arithmetic Coding Revisited", | 81 title="Arithmetic Coding Revisited", |
| 82 journal="{ACM} Transactions on Information Systems", | 82 journal="{ACM} Transactions on Information Systems", |
| 83 year=1998, | 83 year=1998, |
| 84 volume=16, | 84 volume=16, |
| 85 number=3, | 85 number=3, |
| 86 pages="256--294", | 86 pages="256--294", |
| 87 month=Jul, | 87 month=Jul, |
| 88 URL="http://www.stanford.edu/class/ee398/handouts/papers/Moffat98ArithmCoding
.pdf" | 88 URL="http://www.stanford.edu/class/ee398a/handouts/papers/Moffat98ArithmCodin
g.pdf" |
| 89 }*/ | 89 }*/ |
| 90 | 90 |
| 91 static int ec_read_byte(ec_dec *_this){ | 91 static int ec_read_byte(ec_dec *_this){ |
| 92 return _this->offs<_this->storage?_this->buf[_this->offs++]:0; | 92 return _this->offs<_this->storage?_this->buf[_this->offs++]:0; |
| 93 } | 93 } |
| 94 | 94 |
| 95 static int ec_read_byte_from_end(ec_dec *_this){ | 95 static int ec_read_byte_from_end(ec_dec *_this){ |
| 96 return _this->end_offs<_this->storage? | 96 return _this->end_offs<_this->storage? |
| 97 _this->buf[_this->storage-++(_this->end_offs)]:0; | 97 _this->buf[_this->storage-++(_this->end_offs)]:0; |
| 98 } | 98 } |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 while(available<=EC_WINDOW_SIZE-EC_SYM_BITS); | 236 while(available<=EC_WINDOW_SIZE-EC_SYM_BITS); |
| 237 } | 237 } |
| 238 ret=(opus_uint32)window&(((opus_uint32)1<<_bits)-1U); | 238 ret=(opus_uint32)window&(((opus_uint32)1<<_bits)-1U); |
| 239 window>>=_bits; | 239 window>>=_bits; |
| 240 available-=_bits; | 240 available-=_bits; |
| 241 _this->end_window=window; | 241 _this->end_window=window; |
| 242 _this->nend_bits=available; | 242 _this->nend_bits=available; |
| 243 _this->nbits_total+=_bits; | 243 _this->nbits_total+=_bits; |
| 244 return ret; | 244 return ret; |
| 245 } | 245 } |
| OLD | NEW |