www.pudn.com > lpc.zip > synths.c
/******************************************************************
*
* SYNTHS Version 48
*
******************************************************************
*
* NOTE: There is excessive buffering here, BSYNZ and DEEMP should be
* changed to operate on variable positions within SOUT. Also,
* the output length parameter is bogus, and PITSYN should be
* rewritten to allow a constant frame length output
*/
#include "ourstuff.h"
#include "config.ch"
#include "lpcdefs.h"
#include "contrl.ch"
extern int_type ipiti_i[11], ivuv_i[11];
extern int_type rci_i[MAXORD][11], rmsi_i[11], pc_i[MAXORD];
extern int_type exc_i[MAXPIT+MAXORD], exc2_i[MAXPIT+MAXORD];
extern int_type noise_i[MAXPIT+MAXORD];
extern long_type exc_l[MAXPIT+MAXORD], exc2_l[MAXPIT+MAXORD];
synths(voice_i, pitch_i, rms_i, rc_i, speech_i, k )
int_type voice_i[];
int_type *pitch_i;
int_type rc_i[];
int_type *rms_i;
int_type speech_i[];
int_type *k;
{
int i, j;
static int_type sout_i[MAXFRM];
int_type nout_i, ratio_i;
int_type gprime_i=11469;
int_type g2pass_i;
*pitch_i = mmax(mmin(*pitch_i,156),20);
for (i = 1; i<=ORDER;i++)
rc_i[i] = mmax(mmin(rc_i[i],16220),-16220);
*rms_i = *rms_i<<5;
*k = 0;
pitsyn_i(voice_i-1, pitch_i, rms_i, rc_i-1, ivuv_i-1, ipiti_i-1,
rmsi_i-1, rci_i, &nout_i, &ratio_i);
if(nout_i>0) {
for(j=0;j