Lines Matching refs:rb
43 av_assert0(rc->rng_cur < rc->rb.position);
144 while (rc->rb.bytes && rc->rb.cachelen < count) {
145 rc->rb.cacheval |= *--rc->rb.position << rc->rb.cachelen;
146 rc->rb.cachelen += 8;
147 rc->rb.bytes--;
150 value = av_mod_uintp2(rc->rb.cacheval, count);
151 rc->rb.cacheval >>= count;
152 rc->rb.cachelen -= count;
163 const int to_write = FFMIN(32 - rc->rb.cachelen, count);
166 rc->rb.cacheval |= av_mod_uintp2(val, to_write) << rc->rb.cachelen;
167 rc->rb.cachelen = (rc->rb.cachelen + to_write) % 32;
169 if (!rc->rb.cachelen && count) {
170 AV_WB32((uint8_t *)rc->rb.position, rc->rb.cacheval);
171 rc->rb.bytes += 4;
172 rc->rb.position -= 4;
173 rc->rb.cachelen = count - to_write;
174 rc->rb.cacheval = av_mod_uintp2(val >> to_write, rc->rb.cachelen);
175 av_assert0(rc->rng_cur < rc->rb.position);
354 rc->rb.position = rightend;
355 rc->rb.bytes = bytes;
356 rc->rb.cachelen = 0;
357 rc->rb.cacheval = 0;
386 rc->waste = size*8 - (rc->rb.bytes*8 + rc->rb.cachelen) - rng_bytes*8;
389 if (rc->rb.bytes || rc->rb.cachelen) {
392 ff_opus_rc_put_raw(rc, 0, 32 - rc->rb.cachelen);
393 rb_src = rc->buf + OPUS_MAX_PACKET_SIZE + 12 - rc->rb.bytes;
394 rb_dst = dst + FFMAX(size - rc->rb.bytes, 0);
398 memcpy(&rb_dst[lap], &rb_src[lap], FFMAX(rc->rb.bytes - lap, 0));