Lines Matching defs:state_ptr
85 * pointed to by 'state_ptr'.
90 struct audio_g72x_state *state_ptr)
94 state_ptr->yl = 34816;
95 state_ptr->yu = 544;
96 state_ptr->dms = 0;
97 state_ptr->dml = 0;
98 state_ptr->ap = 0;
100 state_ptr->a[cnta] = 0;
101 state_ptr->pk[cnta] = 0;
102 state_ptr->sr[cnta] = 32;
105 state_ptr->b[cnta] = 0;
106 state_ptr->dq[cnta] = 32;
108 state_ptr->td = 0;
109 state_ptr->leftover_cnt = 0; /* no left over codes */
182 struct audio_g72x_state *state_ptr,
196 if (state_ptr->td == 0)
198 else if (state_ptr->yl > 0x40000)
201 thr2 = (0x20 + ((state_ptr->yl >> 10) & 0x1F)) <<
202 (state_ptr->yl >> 15);
214 state_ptr->yu = y + ((_witab[i] - y) >> 5);
217 if (state_ptr->yu < 544)
218 state_ptr->yu = 544;
219 else if (state_ptr->yu > 5120)
220 state_ptr->yu = 5120;
223 state_ptr->yl += state_ptr->yu + ((-state_ptr->yl) >> 6);
229 state_ptr->a[0] = 0;
230 state_ptr->a[1] = 0;
231 state_ptr->b[0] = 0;
232 state_ptr->b[1] = 0;
233 state_ptr->b[2] = 0;
234 state_ptr->b[3] = 0;
235 state_ptr->b[4] = 0;
236 state_ptr->b[5] = 0;
240 pks1 = pk0 ^ state_ptr->pk[0];
242 a2p = state_ptr->a[1] - (state_ptr->a[1] >> 7);
244 fa1 = (pks1) ? state_ptr->a[0] : -state_ptr->a[0];
252 if (pk0 ^ state_ptr->pk[1])
269 state_ptr->a[1] = a2p;
272 state_ptr->a[0] -= state_ptr->a[0] >> 8;
275 state_ptr->a[0] += 192;
277 state_ptr->a[0] -= 192;
281 if (state_ptr->a[0] < -a1ul)
282 state_ptr->a[0] = -a1ul;
283 else if (state_ptr->a[0] > a1ul)
284 state_ptr->a[0] = a1ul;
288 state_ptr->b[cnt] -= state_ptr->b[cnt] >> 8;
291 if ((dq ^ state_ptr->dq[cnt]) >= 0)
292 state_ptr->b[cnt] += 128;
294 state_ptr->b[cnt] -= 128;
300 state_ptr->dq[cnt] = state_ptr->dq[cnt-1];
303 state_ptr->dq[0] = (dq >= 0) ? 0x20 : 0xFC20;
306 state_ptr->dq[0] = (dq >= 0) ?
311 state_ptr->sr[1] = state_ptr->sr[0];
314 state_ptr->sr[0] = 0x20;
317 state_ptr->sr[0] = (exp << 6) + ((sr << 6) >> exp);
321 state_ptr->sr[0] = (exp << 6) + ((mag << 6) >> exp) - 0x400;
325 state_ptr->pk[1] = state_ptr->pk[0];
326 state_ptr->pk[0] = pk0;
330 state_ptr->td = 0;
332 state_ptr->td = 1;
334 state_ptr->td = 0;
340 state_ptr->dms += (fi - state_ptr->dms) >> 5; /* FILTA */
341 state_ptr->dml += (((fi << 2) - state_ptr->dml) >> 7); /* FILTB */
344 state_ptr->ap = 256;
346 state_ptr->ap += (0x200 - state_ptr->ap) >> 4;
347 else if (state_ptr->td == 1)
348 state_ptr->ap += (0x200 - state_ptr->ap) >> 4;
349 else if (abs((state_ptr->dms << 2) - state_ptr->dml) >=
350 (state_ptr->dml >> 3))
351 state_ptr->ap += (0x200 - state_ptr->ap) >> 4;
353 state_ptr->ap += (-state_ptr->ap) >> 4;
562 struct audio_g72x_state *state_ptr)
574 sezi = _g723_fmult(state_ptr->b[0] >> 2, state_ptr->dq[0]);
576 sezi = sezi + _g723_fmult(state_ptr->b[cnt] >> 2,
577 state_ptr->dq[cnt]);
580 sei = sei + _g723_fmult(state_ptr->a[cnt] >> 2,
581 state_ptr->sr[cnt]);
587 if (state_ptr->ap >= 256)
588 y = state_ptr->yu;
590 y = state_ptr->yl >> 6;
591 dif = state_ptr->yu - y;
592 al = state_ptr->ap >> 2;
613 _g723_update(y, i, dq, sr, pk0, state_ptr, sigpk);
652 struct audio_g72x_state *state_ptr)
664 leftover = &state_ptr->leftover[0];
668 for (i = 0; state_ptr->leftover_cnt > 0; i++) {
670 state_ptr->leftover_cnt -= 8;
678 state_ptr->leftover_cnt = 0;
695 offset = state_ptr->leftover_cnt / 8;
696 bits = state_ptr->leftover_cnt % 8;
702 i = _encoder(*short_ptr++ >> 2, state_ptr);
705 i = _encoder(audio_a2s(*char_ptr++) >> 2, state_ptr);
708 i = _encoder(audio_u2s(*char_ptr++) >> 2, state_ptr);
722 state_ptr->leftover_cnt += 3;
730 state_ptr->leftover_cnt = 0;
737 state_ptr->leftover_cnt += bits;
760 struct audio_g72x_state *state_ptr) /* the decoder's state structure. */
785 bits = state_ptr->leftover_cnt;
786 codes = (bits > 0) ? state_ptr->leftover[0] : 0;
795 sezi = _g723_fmult(state_ptr->b[0] >> 2, state_ptr->dq[0]);
797 sezi = sezi + _g723_fmult(state_ptr->b[cnt] >> 2,
798 state_ptr->dq[cnt]);
801 sei = sei + _g723_fmult(state_ptr->a[cnt] >> 2,
802 state_ptr->sr[cnt]);
806 if (state_ptr->ap >= 256)
807 y = state_ptr->yu;
809 y = state_ptr->yl >> 6;
810 dif = state_ptr->yu - y;
811 al = state_ptr->ap >> 2;
831 _g723_update(y, i, dq, sr, pk0, state_ptr, sigpk);
850 state_ptr->leftover_cnt = bits;
852 state_ptr->leftover[0] = codes;