40#ifdef P_R_O_T_O_T_Y_P_E_S
41extern int voicin_(
integer *vwin,
real *
inbuf,
real *lpbuf,
integer *buflim,
integer *half,
real *minamd,
real *maxamd,
integer *mintau,
real *ivrc,
integer *obound,
integer *voibuf,
integer *af,
struct lpc10_encoder_state *st);
53#define contrl_1 contrl_
266 static real vdc[100] = { 0.f,1714.f,-110.f,
267 334.f,-4096.f,-654.f,3752.f,3769.f,0.f,1181.f,0.f,874.f,-97.f,
268 300.f,-4096.f,-1021.f,2451.f,2527.f,0.f,-500.f,0.f,510.f,-70.f,
269 250.f,-4096.f,-1270.f,2194.f,2491.f,0.f,-1500.f,0.f,500.f,-10.f,
270 200.f,-4096.f,-1300.f,2e3f,2e3f,0.f,-2e3f,0.f,500.f,0.f,0.f,
271 -4096.f,-1300.f,2e3f,2e3f,0.f,-2500.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,
272 0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,
273 0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,
274 0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f };
276 static real vdcl[10] = { 600.f,450.f,300.f,200.f,0.f,0.f,0.f,0.f,0.f,0.f }
280 integer inbuf_offset = 0, lpbuf_offset = 0, i__1, i__2;
289 integer *lbve, *lbue, *fbve, *fbue;
477 voice = (&st->
voice[0]);
482 ofbue = (&st->
ofbue);
483 olbue = (&st->
olbue);
484 sfbue = (&st->
sfbue);
485 slbue = (&st->
slbue);
495 inbuf_offset = buflim[1];
496 inbuf -= inbuf_offset;
499 lpbuf_offset = buflim[3];
500 lpbuf -= lpbuf_offset;
564 *maxmin = *maxamd /
max(*minamd,1.f);
567 vparms_(&vwin[1], &
inbuf[inbuf_offset], &lpbuf[lpbuf_offset], &buflim[1],
568 half, dither, mintau, &zc, &lbe, &fbe, &qs, &rc1, &ar_b__, &
575 r__1 = (*snr + *fbve / (
real)
max(*fbue,1)) * 63 / 64.f;
577 snr2 = *snr * *fbue /
max(*lbue,1);
581 for (snrl = 1; snrl <= i__1; ++snrl) {
582 if (snr2 > vdcl[snrl - 1]) {
598 voice[*half + 3] = vdc[snrl * 10 - 1];
599 for (i__ = 1; i__ <= 8; ++i__) {
600 voice[*half + 3] += vdc[i__ + snrl * 10 - 11] *
value[i__ - 1];
604 if (voice[*half + 3] > 0.f) {
605 voibuf[*half + 6] = 1;
607 voibuf[*half + 6] = 0;
661 ot = ((obound[1] & 2) != 0 || obound[2] == 1) && (obound[3] & 1) == 0;
663 vstate = (voibuf[3] << 3) + (voibuf[4] << 2) + (voibuf[5] << 1) + voibuf[
665 switch (vstate + 1) {
684 if (ot && voibuf[7] == 1) {
689 if (voibuf[7] == 0 || voice[2] < -voice[3]) {
699 if (voice[1] < -voice[2]) {
707 if (voibuf[1] == 1 || voibuf[7] == 1 || voice[3] > voice[0]) {
724 if (voice[2] < -voice[1]) {
734 if (voibuf[7] == 0 && voice[3] < -voice[2]) {
741 if (ot && voibuf[7] == 0) {
757 if (voibuf[*half + 6] == 0) {
759 i__1 = fbe, i__2 = *ofbue * 3;
760 r__1 = (*sfbue * 63 + (
min(i__1,i__2) << 3)) / 64.f;
765 i__1 = lbe, i__2 = *olbue * 3;
766 r__1 = (*slbue * 63 + (
min(i__1,i__2) << 3)) / 64.f;
771 r__1 = (*lbve * 63 + lbe) / 64.f;
773 r__1 = (*fbve * 63 + fbe) / 64.f;
781 r__2 = (
real)(sqrt((
real) (*lbue * *lbve)) * 64 / 3000);
782 r__1 =
max(r__2,1.f);
783 *dither =
min(r__1,20.f);
int vparms_(integer *vwin, real *inbuf, real *lpbuf, integer *buflim, integer *half, real *dither, integer *mintau, integer *zc, integer *lbe, integer *fbe, real *qs, real *rc1, real *ar_b__, real *ar_f__)
static int inbuf(struct baseio *bio, FILE *fi)
utility used by inchar(), for base_encode()
int voicin_(integer *vwin, real *inbuf, real *lpbuf, integer *buflim, integer *half, real *minamd, real *maxamd, integer *mintau, real *ivrc, integer *obound, integer *voibuf, integer *af, struct lpc10_encoder_state *st)