Lines Matching refs:state
98 static av_always_inline av_flatten void put_symbol(RangeCoder *c, uint8_t *state, int v, int is_signed, uint64_t rc_stat[256][2], uint64_t rc_stat2[32][2]){
105 rc_stat2[(S)-state][B]++;\
113 put_rac(c, state+0, 0);
116 put_rac(c, state+1+i, 1); //1..10
118 put_rac(c, state+1+i, 0);
121 put_rac(c, state+22+i, (a>>i)&1); //22..31
125 put_rac(c, state+11 + e, v < 0); //11..21
128 put_rac(c, state+1+FFMIN(i,9), 1); //1..10
130 put_rac(c, state+1+9, 0);
133 put_rac(c, state+22+FFMIN(i,9), (a>>i)&1); //22..31
137 put_rac(c, state+11 + 10, v < 0); //11..21
140 put_rac(c, state+0, 1);
145 static inline av_flatten int get_symbol(RangeCoder *c, uint8_t *state, int is_signed){
146 if(get_rac(c, state+0))
152 while(get_rac(c, state+1 + FFMIN(e,9))){ //1..10
160 a += a + get_rac(c, state+22 + FFMIN(i,9)); //22..31
163 e= -(is_signed && get_rac(c, state+11 + FFMIN(e, 10))); //11..21
169 static inline int intlist_write(RangeCoder *c, uint8_t *state, int *buf, int entries, int base_2_part)
174 put_symbol(c, state, buf[i], 1, NULL, NULL);
179 static inline int intlist_read(RangeCoder *c, uint8_t *state, int *buf, int entries, int base_2_part)
184 buf[i] = get_symbol(c, state, 1);
457 static void predictor_init_state(int *k, int *state, int order)
463 int j, p, x = state[i];
467 int tmp = x + shift_down(k[j] * (unsigned)state[p], LATTICE_SHIFT);
468 state[p] += shift_down(k[j]* (unsigned)x, LATTICE_SHIFT);
474 static int predictor_calc_error(int *k, int *state, int order, int error)
476 int i, x = error - (unsigned)shift_down(k[order-1] * (unsigned)state[order-1], LATTICE_SHIFT);
480 *state_ptr = &(state[order-2]);
490 x -= (unsigned)shift_down(k[i] * state[i], LATTICE_SHIFT);
491 state[i+1] = state[i] + shift_down(k[i] * x, LATTICE_SHIFT);
499 state[0] = x;
513 int *state = window + window_entries;
515 memcpy(state, window, window_entries * sizeof(*state));
523 int *state_ptr = &(state[0]);
558 state_ptr = &(state[0]);
571 int stateval=state[j];
573 state[j] += shift_down(k * stepval, LATTICE_SHIFT);
728 uint8_t state[32];
735 memset(state, 128, sizeof(state));
782 if ((ret = intlist_write(&c, state, s->predictor_k, s->num_taps, 0)) < 0)
825 put_symbol(&c, state, quant, 0, NULL, NULL);
837 if ((ret = intlist_write(&c, state, s->coded_samples[ch], s->block_align, 1)) < 0)
990 uint8_t state[32];
1003 memset(state, 128, sizeof(state));
1007 intlist_read(&c, state, s->predictor_k, s->num_taps, 0);
1016 quant = get_symbol(&c, state, 0) * (unsigned)SAMPLE_FACTOR;
1029 intlist_read(&c, state, s->coded_samples[ch], s->block_align, 1);