Unified · Split
| @@ -62,7 +62,6 @@ void ff_build_rac_states(RangeCoder *c, int factor, int max_p); · 61 unmodified lines | ||
| 62 | 62 | static inline void renorm_encoder(RangeCoder *c) |
| 63 | 63 | { |
| 64 | 64 | // FIXME: optimize |
| 65 | − while (c->range < 0x100) { | |
| 66 | 65 | if (c->outstanding_byte < 0) { |
| 67 | 66 | c->outstanding_byte = c->low >> 8; |
| 68 | 67 | } else if (c->low <= 0xFF00) { |
| @@ -81,7 +80,6 @@ static inline void renorm_encoder(RangeCoder *c) · 12 unmodified lines | ||
| 81 | 80 | |
| 82 | 81 | c->low = (c->low & 0xFF) << 8; |
| 83 | 82 | c->range <<= 8; |
| 84 | − } | |
| 85 | 83 | } |
| 86 | 84 | |
| 87 | 85 | static inline int get_rac_count(RangeCoder *c) |
| @@ -108,7 +106,8 @@ static inline void put_rac(RangeCoder *c, uint8_t *const state, int bit) · 20 unmodified lines | ||
| 108 | 106 | *state = c->one_state[*state]; |
| 109 | 107 | } |
| 110 | 108 | |
| 111 | − renorm_encoder(c); | |
| 109 | + while (c->range < 0x100) | |
| 110 | + renorm_encoder(c); | |
| 112 | 111 | } |
| 113 | 112 | |
| 114 | 113 | static inline void refill(RangeCoder *c) |