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

Function ac_get

libavcodec/dstdec.c:192–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192static 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
213static uint8_t prob_dst_x_bit(int c)
214{

Callers 1

decode_frameFunction · 0.85

Calls 2

av_log2Function · 0.85
get_bitsFunction · 0.70

Tested by

no test coverage detected