| 235 | } |
| 236 | |
| 237 | U32 ArithmeticDecoder::readBit() |
| 238 | { |
| 239 | U32 sym = value / (length >>= 1); // decode symbol, change length |
| 240 | value -= length * sym; // update interval |
| 241 | |
| 242 | if (length < AC__MinLength) renorm_dec_interval(); // renormalization |
| 243 | |
| 244 | if (sym >= 2) |
| 245 | { |
| 246 | throw 4711; |
| 247 | } |
| 248 | |
| 249 | return sym; |
| 250 | } |
| 251 | |
| 252 | U32 ArithmeticDecoder::readBits(U32 bits) |
| 253 | { |