208{
209
210
211 static integer tau[60] = { 20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,
212 35,36,37,38,39,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,
213 74,76,78,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,
214 140,144,148,152,156 };
215 static integer buflim[4] = { 181,720,25,720 };
216 static real precoef = .9375f;
217
218
220
221
260 real phi[100] , psi[10];
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454 if (speech) {
455 --speech;
456 }
457 if (voice) {
458 --voice;
459 }
460 if (rc) {
461 --rc;
462 }
463
464
465
466
467
468
469
470
472 pebuf = &(st->
pebuf[0]);
473 lpbuf = &(st->
lpbuf[0]);
474 ivbuf = &(st->
ivbuf[0]);
476 osbuf = &(st->
osbuf[0]);
477 osptr = &(st->
osptr);
478 obound = &(st->
obound[0]);
479 vwin = &(st->
vwin[0]);
480 awin = &(st->
awin[0]);
481 voibuf = &(st->
voibuf[0]);
482 rmsbuf = &(st->
rmsbuf[0]);
483 rcbuf = &(st->
rcbuf[0]);
485
487 for (i__ = 181; i__ <= i__1; ++i__) {
489 pebuf[i__ - 181] = pebuf[
contrl_1.lframe + i__ - 181];
490 }
492 for (i__ = 229; i__ <= i__1; ++i__) {
493 ivbuf[i__ - 229] = ivbuf[
contrl_1.lframe + i__ - 229];
494 }
496 for (i__ = 25; i__ <= i__1; ++i__) {
497 lpbuf[i__ - 25] = lpbuf[
contrl_1.lframe + i__ - 25];
498 }
499 j = 1;
500 i__1 = (*osptr) - 1;
501 for (i__ = 1; i__ <= i__1; ++i__) {
502 if (osbuf[i__ - 1] >
contrl_1.lframe) {
503 osbuf[j - 1] = osbuf[i__ - 1] -
contrl_1.lframe;
504 ++j;
505 }
506 }
507 *osptr = j;
508 voibuf[0] = voibuf[2];
509 voibuf[1] = voibuf[3];
510 for (i__ = 1; i__ <= 2; ++i__) {
511 vwin[(i__ << 1) - 2] = vwin[((i__ + 1) << 1) - 2] -
contrl_1.lframe;
512 vwin[(i__ << 1) - 1] = vwin[((i__ + 1) << 1) - 1] -
contrl_1.lframe;
513 awin[(i__ << 1) - 2] = awin[((i__ + 1) << 1) - 2] -
contrl_1.lframe;
514 awin[(i__ << 1) - 1] = awin[((i__ + 1) << 1) - 1] -
contrl_1.lframe;
515
516
517
518
519
520
521
522
523
524
525 obound[i__ - 1] = obound[i__];
526 voibuf[i__ * 2] = voibuf[(i__ + 1) * 2];
527 voibuf[(i__ << 1) + 1] = voibuf[((i__ + 1) << 1) + 1];
528 rmsbuf[i__ - 1] = rmsbuf[i__];
530 for (j = 1; j <= i__1; ++j) {
531 rcbuf[j + i__ * 10 - 11] = rcbuf[j + (i__ + 1) * 10 - 11];
532 }
533 }
534
535
536
537
538
539
540
541
542
543 temp = 0.f;
545 for (i__ = 1; i__ <= i__1; ++i__) {
546 inbuf[720 -
contrl_1.lframe + i__ - 181] = speech[i__] * 4096.f -
547 (*bias);
549 }
551 *bias += 1;
552 }
554 *bias += -1;
555 }
556
559 zpre);
561
562
563
564
565
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
588
589
590
591
593
594
595
596
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613 for (half = 1; half <= 2; ++half) {
614 voicin_(&vwin[4],
inbuf, lpbuf, buflim, &half, &amdf[minptr - 1], &
615 amdf[maxptr - 1], &mintau, ivrc, obound, voibuf, &
c__3, st);
616 }
617
618
619 dyptrk_(amdf, &
c__60, &minptr, &voibuf[7], pitch, &midx, st);
620 ipitch = tau[midx - 1];
621
622 placea_(&ipitch, voibuf, &obound[2], &
c__3, vwin, awin, ewin, &
624
625
626 lanal = awin[5] + 1 - awin[4];
627 dcbias_(&lanal, &pebuf[awin[4] - 181], abuf);
628
629
630
631
632
633
634 i__1 = ewin[5] - ewin[4] + 1;
635 energy_(&i__1, &abuf[ewin[4] - awin[4]], &rmsbuf[2]);
636
640
641 voice[1] = voibuf[2];
642 voice[2] = voibuf[3];
643 *rms = rmsbuf[0];
645 for (i__ = 1; i__ <= i__1; ++i__) {
646 rc[i__] = rcbuf[i__ - 1];
647 }
648 return 0;
649}
int dcbias_(integer *len, real *speech, real *sigout)
int dyptrk_(real *amdf, integer *ltau, integer *minptr, integer *voice, integer *pitch, integer *midx, struct lpc10_encoder_state *st)
int energy_(integer *len, real *speech, real *rms)
int preemp_(real *inbuf, real *pebuf, integer *nsamp, real *coef, real *z__)
int mload_(integer *order, integer *awins, integer *awinf, real *speech, real *phi, real *psi)
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)
int onset_(real *pebuf, integer *osbuf, integer *osptr, integer *oslen, integer *sbufl, integer *sbufh, integer *lframe, struct lpc10_encoder_state *st)
int placev_(integer *osbuf, integer *osptr, integer *oslen, integer *obound, integer *vwin, integer *af, integer *lframe, integer *minwin, integer *maxwin, integer *dvwinl, integer *dvwinh)
int rcchk_(integer *order, real *rc1f, real *rc2f)
int ivfilt_(real *lpbuf, real *ivbuf, integer *len, integer *nsamp, real *ivrc)
int invert_(integer *order, real *phi, real *psi, real *rc)
int placea_(integer *ipitch, integer *voibuf, integer *obound, integer *af, integer *vwin, integer *awin, integer *ewin, integer *lframe, integer *maxwin)
int tbdm_(real *speech, integer *lpita, integer *tau, integer *ltau, real *amdf, integer *minptr, integer *maxptr, integer *mintau)
int lpfilt_(real *inbuf, real *lpbuf, integer *len, integer *nsamp)
static int inbuf(struct baseio *bio, FILE *fi)
utility used by inchar(), for base_encode()