#ifndef COMMON_H #define COMMON_H #include "parm.h" #include "qsize.h" #define real float #define RCOPY(X,Y,N) memcpy(Y, X,(N)*sizeof(real)) #define EPSILON 1.0e-35 /* Use hand-pipelined loops for higher speed on 21000 */ #define PIPELINE 1 #define REALZEROP(x) ((x-EPSILON)) #define CLIPP(X,LOW,HIGH) ((X)<(LOW)?(LOW):(X)>(HIGH)?(HIGH):(X)) #define FLOAT2FIX(X,N) ((int) (X)) #define FIX2FLOAT(X) ((float)(X)) #define VOLATILE #define sig_scale(SCALE,A,B) \ {int __i;for(__i=0;__i=0 ; i--) A[i] = 0.0;}) #if 0 #define CHECK1(V) ({if (! (V>=-10000. && V<=10000.)) abort();}) #define CHECK(A,N) ({int __i;for(__i=0;__i=0;_i--)\ NAME[_i]=NAME ## _next[_i]; NAME ## _obsolete_p=0;} /* Copy L words to X from circular buffer CIRC *ending* at offset EOS. CL is the size of circular buffe CIRC */ #define CIRCOPY(X,CIRC,EOS,L,CL) {int _i1,_i2,_i,_lx=0;\ if((EOS)>=(L)){_i1=(EOS)-(L);_i2=(CL);} \ else {_i1=0; _i2=(CL)+(EOS)-(L);}\ for(_i=_i2; _i<(CL); _i++)X[_lx++]=CIRC[_i];\ for(_i=_i1; _i<(EOS); _i++)X[_lx++]=CIRC[_i];} /* get queue index of the most recent vector */ #define QINDEX ({int __qx=vector_end-thequeue; \ __qx ? QSIZE-IDIM : __qx-IDIM;}) extern real QMEM thequeue[]; extern real QMEM * VOLATILE vector_end; /* declare array and its copy together with a semafor */ #define ACLASS extern ACLASS real sf_coeff[LPC+1]; ACLASS real gp_coeff[LPCLG+1]; ACLASS real pwf_z_coeff[LPCW+1]; ACLASS real pwf_p_coeff[LPCW+1]; ACLASS real shape_energy[NCWD]; ACLASS real imp_resp[IDIM]; ACLASS real sf_coeff_next[LPC+1]; ACLASS real gp_coeff_next[LPCLG+1]; ACLASS real pwf_z_coeff_next[LPCW+1]; ACLASS real pwf_p_coeff_next[LPCW+1]; ACLASS real shape_energy_next[NCWD]; ACLASS real imp_resp_next[IDIM]; ACLASS int sf_coeff_obsolete_p; ACLASS int gp_coeff_obsolete_p; ACLASS int pwf_z_coeff_obsolete_p; ACLASS int pwf_p_coeff_obsolete_p; ACLASS int shape_energy_obsolete_p; ACLASS int imp_resp_obsolete_p; extern real synspeech [QSIZE]; /* Synthesized Speech */ extern real qspeech [QSIZE]; /* Quantized Speech */ extern real log_gains[QSIZE/IDIM]; /* Logarithm of Gains */ #ifdef unix #define FFASE(N) if (ffase == N) #endif #define NEXT_FFASE ffase=(ffase==4?1:ffase+1) extern int VOLATILE ffase; #undef ACLASS #define ACLASS #endif /*COMMON_H*/