| 190 | } |
| 191 | |
| 192 | static av_always_inline void ac_get(ArithCoder *ac, GetBitContext *gb, int p, int *e) |
| 193 | { |
| 194 | unsigned int k = (ac->a >> 8) | ((ac->a >> 7) & 1); |
| 195 | unsigned int q = k * p; |
| 196 | unsigned int a_q = ac->a - q; |
| 197 | |
| 198 | *e = ac->c < a_q; |
| 199 | if (*e) { |
| 200 | ac->a = a_q; |
| 201 | } else { |
| 202 | ac->a = q; |
| 203 | ac->c -= a_q; |
| 204 | } |
| 205 | |
| 206 | if (ac->a < 2048) { |
| 207 | int n = 11 - av_log2(ac->a); |
| 208 | ac->a <<= n; |
| 209 | ac->c = (ac->c << n) | get_bits(gb, n); |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | static uint8_t prob_dst_x_bit(int c) |
| 214 | { |
no test coverage detected