MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / renorm_encoder

Function renorm_encoder

libavcodec/rangecoder.h:51–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49void ff_build_rac_states(RangeCoder *c, int factor, int max_p);
50
51static 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
75static inline int get_rac_count(RangeCoder *c){
76 int x= c->bytestream - c->bytestream_start + c->outstanding_count;

Callers 2

ff_rac_terminateFunction · 0.85
put_racFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected