Lines Matching refs:s
85 band->r[0] = saturate(band->s + d); in block4()
162 band->s = saturate(band->sp + band->sz); in block4()
166 g722_encode_state_t *g722_encode_init(g722_encode_state_t *s, in g722_encode_init() argument
169 if (s == NULL) in g722_encode_init()
172 if ((s = (g722_encode_state_t *) malloc(sizeof(*s))) == NULL) in g722_encode_init()
176 memset(s, 0, sizeof(*s)); in g722_encode_init()
178 s->bits_per_sample = 6; in g722_encode_init()
180 s->bits_per_sample = 7; in g722_encode_init()
182 s->bits_per_sample = 8; in g722_encode_init()
183 s->band[0].det = 32; in g722_encode_init()
184 s->band[1].det = 8; in g722_encode_init()
185 return s; in g722_encode_init()
189 int g722_encode_release(g722_encode_state_t *s) in g722_encode_release() argument
191 free(s); in g722_encode_release()
271 int g722_encode(g722_encode_state_t *s, uint8_t g722_data[], in g722_encode() argument
303 if (s->itu_test_mode) in g722_encode()
314 s->x[i] = s->x[i + 2]; in g722_encode()
316 s->x[22] = amp[j++]; in g722_encode()
317 s->x[23] = amp[j++]; in g722_encode()
324 sumodd += s->x[2*i]*qmf_coeffs[i]; in g722_encode()
325 sumeven += s->x[2*i + 1]*qmf_coeffs[11 - i]; in g722_encode()
344 el = saturate(xlow - s->band[0].s); in g722_encode()
351 wd1 = (q6[i]*s->band[0].det) >> 12; in g722_encode()
360 dlow = (s->band[0].det*wd2) >> 15; in g722_encode()
364 wd = (s->band[0].nb*127) >> 7; in g722_encode()
365 s->band[0].nb = wd + wl[il4]; in g722_encode()
366 if (s->band[0].nb < 0) in g722_encode()
367 s->band[0].nb = 0; in g722_encode()
368 else if (s->band[0].nb > 18432) in g722_encode()
369 s->band[0].nb = 18432; in g722_encode()
372 wd1 = (s->band[0].nb >> 6) & 31; in g722_encode()
373 wd2 = 8 - (s->band[0].nb >> 11); in g722_encode()
375 s->band[0].det = wd3 << 2; in g722_encode()
377 block4(&s->band[0], dlow); in g722_encode()
382 eh = saturate(xhigh - s->band[1].s); in g722_encode()
386 wd1 = (564*s->band[1].det) >> 12; in g722_encode()
392 dhigh = (s->band[1].det*wd2) >> 15; in g722_encode()
396 wd = (s->band[1].nb*127) >> 7; in g722_encode()
403 s->band[1].nb = nb; in g722_encode()
406 wd1 = (s->band[1].nb >> 6) & 31; in g722_encode()
407 wd2 = 10 - (s->band[1].nb >> 11); in g722_encode()
409 s->band[1].det = wd3 << 2; in g722_encode()
411 block4(&s->band[1], dhigh); in g722_encode()
423 s->out_buffer |= (code << s->out_bits); in g722_encode()
424 s->out_bits += s->bits_per_sample; in g722_encode()
425 if (s->out_bits >= 8) in g722_encode()
427 g722_data[g722_bytes++] = (uint8_t) (s->out_buffer & 0xFF); in g722_encode()
428 s->out_bits -= 8; in g722_encode()
429 s->out_buffer >>= 8; in g722_encode()