| 244 | } |
| 245 | |
| 246 | void ArithmeticEncoder::writeBit(U32 sym) |
| 247 | { |
| 248 | assert(sym < 2); |
| 249 | |
| 250 | U32 init_base = base; |
| 251 | base += sym * (length >>= 1); // new interval base and length |
| 252 | |
| 253 | if (init_base > base) propagate_carry(); // overflow = carry |
| 254 | if (length < AC__MinLength) renorm_enc_interval(); // renormalization |
| 255 | } |
| 256 | |
| 257 | void ArithmeticEncoder::writeBits(U32 bits, U32 sym) |
| 258 | { |