| 49 | void ff_build_rac_states(RangeCoder *c, int factor, int max_p); |
| 50 | |
| 51 | static inline void renorm_encoder(RangeCoder *c){ |
| 52 | //FIXME optimize |
| 53 | while(c->range < 0x100){ |
| 54 | if(c->outstanding_byte < 0){ |
| 55 | c->outstanding_byte= c->low>>8; |
| 56 | }else if(c->low <= 0xFF00){ |
| 57 | *c->bytestream++ = c->outstanding_byte; |
| 58 | for(;c->outstanding_count; c->outstanding_count--) |
| 59 | *c->bytestream++ = 0xFF; |
| 60 | c->outstanding_byte= c->low>>8; |
| 61 | }else if(c->low >= 0x10000){ |
| 62 | *c->bytestream++ = c->outstanding_byte + 1; |
| 63 | for(;c->outstanding_count; c->outstanding_count--) |
| 64 | *c->bytestream++ = 0x00; |
| 65 | c->outstanding_byte= (c->low>>8) & 0xFF; |
| 66 | }else{ |
| 67 | c->outstanding_count++; |
| 68 | } |
| 69 | |
| 70 | c->low = (c->low & 0xFF)<<8; |
| 71 | c->range <<= 8; |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | static inline int get_rac_count(RangeCoder *c){ |
| 76 | int x= c->bytestream - c->bytestream_start + c->outstanding_count; |
no outgoing calls
no test coverage detected