37 #ifdef P_R_O_T_O_T_Y_P_E_S
38 extern int bsynz_(real *coef, integer *ip, integer *iv, real *sout, real *rms, real *ratio, real *g2pass,
struct lpc10_decoder_state *st);
46 integer order, lframe;
50 #define contrl_1 contrl_
122 int bsynz_(real *coef, integer *ip, integer *iv,
123 real *sout, real *rms, real *ratio, real *g2pass,
130 static integer kexc[25] = { 8,-16,26,-48,86,-162,294,-502,718,-728,184,
131 672,-610,-672,184,728,718,502,294,162,86,48,26,16,8 };
146 double sqrt(doublereal);
151 real noise[166], pulse;
331 exc2 = &(st->exc2[0]);
338 rmso = &(st->rmso_bsynz);
343 r__1 = *rmso / (*rms + 1e-6f);
346 i__1 = contrl_1.order;
347 for (i__ = 1; i__ <= i__1; ++i__) {
348 exc2[i__ - 1] = exc2[*ipo + i__ - 1] * xy;
354 for (i__ = 1; i__ <= i__1; ++i__) {
355 exc[contrl_1.order + i__ - 1] = (real) (random_(st) / 64);
365 px = (random_(st) + 32768) * (*ip - 1) / 65536 + contrl_1.order + 1;
366 r__1 = *ratio / 4 * 1.f;
371 exc[px - 1] += pulse;
375 sscale = (real)sqrt((real) (*ip)) / 6.928f;
377 for (i__ = 1; i__ <= i__1; ++i__) {
378 exc[contrl_1.order + i__ - 1] = 0.f;
380 exc[contrl_1.order + i__ - 1] = sscale * kexc[i__ - 1];
382 lpi0 = exc[contrl_1.order + i__ - 1];
383 r__2 = exc[contrl_1.order + i__ - 1] * .125f + *lpi1 * .75f;
384 r__1 = r__2 + *lpi2 * .125f;
385 exc[contrl_1.order + i__ - 1] = r__1 + *lpi3 * 0.f;
391 for (i__ = 1; i__ <= i__1; ++i__) {
392 noise[contrl_1.order + i__ - 1] = random_(st) * 1.f / 64;
393 hpi0 = noise[contrl_1.order + i__ - 1];
394 r__2 = noise[contrl_1.order + i__ - 1] * -.125f + *hpi1 * .25f;
395 r__1 = r__2 + *hpi2 * -.125f;
396 noise[contrl_1.order + i__ - 1] = r__1 + *hpi3 * 0.f;
402 for (i__ = 1; i__ <= i__1; ++i__) {
403 exc[contrl_1.order + i__ - 1] += noise[contrl_1.order + i__ - 1];
410 for (i__ = 1; i__ <= i__1; ++i__) {
411 k = contrl_1.order + i__;
413 i__2 = contrl_1.order;
414 for (j = 1; j <= i__2; ++j) {
415 sum += coef[j] * exc[k - j - 1];
418 exc2[k - 1] = sum + exc[k - 1];
422 for (i__ = 1; i__ <= i__1; ++i__) {
423 k = contrl_1.order + i__;
425 i__2 = contrl_1.order;
426 for (j = 1; j <= i__2; ++j) {
427 sum += coef[j] * exc2[k - j - 1];
429 exc2[k - 1] = sum + exc2[k - 1];
430 xssq += exc2[k - 1] * exc2[k - 1];
433 i__1 = contrl_1.order;
434 for (i__ = 1; i__ <= i__1; ++i__) {
435 exc[i__ - 1] = exc[*ip + i__ - 1];
436 exc2[i__ - 1] = exc2[*ip + i__ - 1];
441 gain = (real)sqrt(ssq / xssq);
443 for (i__ = 1; i__ <= i__1; ++i__) {
444 sout[i__] = gain * exc2[contrl_1.order + i__ - 1];