f2c.h 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. /*
  2. $Log$
  3. Revision 1.15 2004/06/26 03:50:14 markster
  4. Merge source cleanups (bug #1911)
  5. Revision 1.14 2003/02/12 13:59:15 matteo
  6. mer feb 12 14:56:57 CET 2003
  7. Revision 1.1.1.1 2003/02/12 13:59:15 matteo
  8. mer feb 12 14:56:57 CET 2003
  9. Revision 1.2 2000/01/05 08:20:39 markster
  10. Some OSS fixes and a few lpc changes to make it actually work
  11. * Revision 1.2 1996/08/20 20:26:28 jaf
  12. * Any typedef defining a type that was used in lpc10_encoder_state or
  13. * lpc10_decoder_state struct's was commented out here and added to
  14. * lpc10.h.
  15. *
  16. * Revision 1.1 1996/08/19 22:32:13 jaf
  17. * Initial revision
  18. *
  19. */
  20. /*
  21. * f2c.h
  22. *
  23. * SCCS ID: @(#)f2c.h 1.2 96/05/19
  24. */
  25. /* f2c.h -- Standard Fortran to C header file */
  26. /** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed."
  27. - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */
  28. #ifndef F2C_INCLUDE
  29. #define F2C_INCLUDE
  30. #include "lpc10.h"
  31. /*typedef long int integer;*/
  32. /*typedef INT32 integer;*/
  33. /*typedef short int shortint;*/
  34. /*typedef INT16 shortint;*/
  35. /*typedef float real;*/
  36. /* doublereal only used for function arguments to sqrt, exp, etc. */
  37. typedef double doublereal;
  38. /* 32 bits seems wasteful, but there really aren't that many logical
  39. * variables around, and making them 32 bits could avoid word
  40. * alignment problems, perhaps. */
  41. /*typedef long int logical;*/
  42. /*typedef INT32 logical;*/
  43. /* The following types are not used in the translated C code for the
  44. * LPC-10 coder, but they might be needed by the definitions down
  45. * below, so they don't cause compilation errors. */
  46. typedef char *address;
  47. typedef struct { real r, i; } complex;
  48. typedef struct { doublereal r, i; } doublecomplex;
  49. typedef short int shortlogical;
  50. typedef char logical1;
  51. typedef char integer1;
  52. /* typedef long long longint; */ /* system-dependent */
  53. #define TRUE_ (1)
  54. #define FALSE_ (0)
  55. /* Extern is for use with -E */
  56. #ifndef Extern
  57. #define Extern extern
  58. #endif
  59. /* I/O stuff */
  60. #ifdef f2c_i2
  61. /* for -i2 */
  62. typedef short flag;
  63. typedef short ftnlen;
  64. typedef short ftnint;
  65. #else
  66. typedef long int flag;
  67. typedef long int ftnlen;
  68. typedef long int ftnint;
  69. #endif
  70. /*external read, write*/
  71. typedef struct
  72. { flag cierr;
  73. ftnint ciunit;
  74. flag ciend;
  75. char *cifmt;
  76. ftnint cirec;
  77. } cilist;
  78. /*internal read, write*/
  79. typedef struct
  80. { flag icierr;
  81. char *iciunit;
  82. flag iciend;
  83. char *icifmt;
  84. ftnint icirlen;
  85. ftnint icirnum;
  86. } icilist;
  87. /*open*/
  88. typedef struct
  89. { flag oerr;
  90. ftnint ounit;
  91. char *ofnm;
  92. ftnlen ofnmlen;
  93. char *osta;
  94. char *oacc;
  95. char *ofm;
  96. ftnint orl;
  97. char *oblnk;
  98. } olist;
  99. /*close*/
  100. typedef struct
  101. { flag cerr;
  102. ftnint cunit;
  103. char *csta;
  104. } cllist;
  105. /*rewind, backspace, endfile*/
  106. typedef struct
  107. { flag aerr;
  108. ftnint aunit;
  109. } alist;
  110. /* inquire */
  111. typedef struct
  112. { flag inerr;
  113. ftnint inunit;
  114. char *infile;
  115. ftnlen infilen;
  116. ftnint *inex; /*parameters in standard's order*/
  117. ftnint *inopen;
  118. ftnint *innum;
  119. ftnint *innamed;
  120. char *inname;
  121. ftnlen innamlen;
  122. char *inacc;
  123. ftnlen inacclen;
  124. char *inseq;
  125. ftnlen inseqlen;
  126. char *indir;
  127. ftnlen indirlen;
  128. char *infmt;
  129. ftnlen infmtlen;
  130. char *inform;
  131. ftnint informlen;
  132. char *inunf;
  133. ftnlen inunflen;
  134. ftnint *inrecl;
  135. ftnint *innrec;
  136. char *inblank;
  137. ftnlen inblanklen;
  138. } inlist;
  139. #define VOID void
  140. union Multitype { /* for multiple entry points */
  141. integer1 g;
  142. shortint h;
  143. integer i;
  144. /* longint j; */
  145. real r;
  146. doublereal d;
  147. complex c;
  148. doublecomplex z;
  149. };
  150. typedef union Multitype Multitype;
  151. /*typedef long int Long;*/ /* No longer used; formerly in Namelist */
  152. struct Vardesc { /* for Namelist */
  153. char *name;
  154. char *addr;
  155. ftnlen *dims;
  156. int type;
  157. };
  158. typedef struct Vardesc Vardesc;
  159. struct Namelist {
  160. char *name;
  161. Vardesc **vars;
  162. int nvars;
  163. };
  164. typedef struct Namelist Namelist;
  165. #define abs(x) ((x) >= 0 ? (x) : -(x))
  166. #define dabs(x) (doublereal)abs(x)
  167. #define min(a,b) ((a) <= (b) ? (a) : (b))
  168. #define max(a,b) ((a) >= (b) ? (a) : (b))
  169. #define dmin(a,b) (doublereal)min(a,b)
  170. #define dmax(a,b) (doublereal)max(a,b)
  171. /* procedure parameter types for -A and -C++ */
  172. #define F2C_proc_par_types 1
  173. #ifdef __cplusplus
  174. typedef int /* Unknown procedure type */ (*U_fp)(...);
  175. typedef shortint (*J_fp)(...);
  176. typedef integer (*I_fp)(...);
  177. typedef real (*R_fp)(...);
  178. typedef doublereal (*D_fp)(...), (*E_fp)(...);
  179. typedef /* Complex */ VOID (*C_fp)(...);
  180. typedef /* Double Complex */ VOID (*Z_fp)(...);
  181. typedef logical (*L_fp)(...);
  182. typedef shortlogical (*K_fp)(...);
  183. typedef /* Character */ VOID (*H_fp)(...);
  184. typedef /* Subroutine */ int (*S_fp)(...);
  185. #else
  186. typedef int /* Unknown procedure type */ (*U_fp)(VOID);
  187. typedef shortint (*J_fp)(VOID);
  188. typedef integer (*I_fp)(VOID);
  189. typedef real (*R_fp)(VOID);
  190. typedef doublereal (*D_fp)(VOID), (*E_fp)(VOID);
  191. typedef /* Complex */ VOID (*C_fp)(VOID);
  192. typedef /* Double Complex */ VOID (*Z_fp)(VOID);
  193. typedef logical (*L_fp)(VOID);
  194. typedef shortlogical (*K_fp)(VOID);
  195. typedef /* Character */ VOID (*H_fp)(VOID);
  196. typedef /* Subroutine */ int (*S_fp)(VOID);
  197. #endif
  198. /* E_fp is for real functions when -R is not specified */
  199. typedef VOID C_f; /* complex function */
  200. typedef VOID H_f; /* character function */
  201. typedef VOID Z_f; /* double complex function */
  202. typedef doublereal E_f; /* real function with -R not specified */
  203. /* undef any lower-case symbols that your C compiler predefines, e.g.: */
  204. #ifndef Skip_f2c_Undefs
  205. #undef cray
  206. #undef gcos
  207. #undef mc68010
  208. #undef mc68020
  209. #undef mips
  210. #undef pdp11
  211. #undef sgi
  212. #undef sparc
  213. #undef sun
  214. #undef sun2
  215. #undef sun3
  216. #undef sun4
  217. #undef u370
  218. #undef u3b
  219. #undef u3b2
  220. #undef u3b5
  221. #undef unix
  222. #undef vax
  223. #endif
  224. #ifdef KR_headers
  225. extern integer pow_ii(ap, bp);
  226. extern double r_sign(a,b);
  227. extern integer i_nint(x);
  228. #else
  229. extern integer pow_ii(integer *ap, integer *bp);
  230. extern double r_sign(real *a, real *b);
  231. extern integer i_nint(real *x);
  232. #endif
  233. #ifdef P_R_O_T_O_T_Y_P_E_S
  234. extern int bsynz_(real *coef, integer *ip, integer *iv,
  235. real *sout, real *rms, real *ratio, real *g2pass,
  236. struct lpc10_decoder_state *st);
  237. extern int chanwr_(integer *order, integer *ipitv, integer *irms,
  238. integer *irc, integer *ibits, struct lpc10_encoder_state *st);
  239. extern int chanrd_(integer *order, integer *ipitv, integer *irms,
  240. integer *irc, integer *ibits);
  241. extern int chanwr_0_(int n__, integer *order, integer *ipitv,
  242. integer *irms, integer *irc, integer *ibits,
  243. struct lpc10_encoder_state *st);
  244. extern int dcbias_(integer *len, real *speech, real *sigout);
  245. extern int decode_(integer *ipitv, integer *irms, integer *irc,
  246. integer *voice, integer *pitch, real *rms,
  247. real *rc, struct lpc10_decoder_state *st);
  248. extern int deemp_(real *x, integer *n, struct lpc10_decoder_state *st);
  249. extern int difmag_(real *speech, integer *lpita, integer *tau, integer *ltau,
  250. integer *maxlag, real *amdf, integer *minptr, integer *maxptr);
  251. extern int dyptrk_(real *amdf, integer *ltau, integer *
  252. minptr, integer *voice, integer *pitch, integer *midx,
  253. struct lpc10_encoder_state *st);
  254. extern int encode_(integer *voice, integer *pitch, real *rms, real *rc,
  255. integer *ipitch, integer *irms, integer *irc);
  256. extern int energy_(integer *len, real *speech, real *rms);
  257. extern int ham84_(integer *input, integer *output, integer *errcnt);
  258. extern int hp100_(real *speech, integer *start, integer *end,
  259. struct lpc10_encoder_state *st);
  260. extern int inithp100_(void);
  261. extern int invert_(integer *order, real *phi, real *psi, real *rc);
  262. extern int irc2pc_(real *rc, real *pc, integer *order, real *gprime, real *g2pass);
  263. extern int ivfilt_(real *lpbuf, real *ivbuf, integer *len, integer *nsamp, real *ivrc);
  264. extern int lpcdec_(integer *bits, real *speech);
  265. extern int initlpcdec_(void);
  266. extern int lpcenc_(real *speech, integer *bits);
  267. extern int initlpcenc_(void);
  268. extern int lpfilt_(real *inbuf, real *lpbuf, integer *len, integer *nsamp);
  269. extern integer median_(integer *d1, integer *d2, integer *d3);
  270. extern int mload_(integer *order, integer *awins, integer *awinf, real *speech, real *phi, real *psi);
  271. extern int onset_(real *pebuf, integer *osbuf, integer *osptr, integer *oslen, integer *sbufl, integer *sbufh, integer *lframe, struct lpc10_encoder_state *st);
  272. extern int pitsyn_(integer *order, integer *voice, integer *pitch, real *rms, real *rc, integer *lframe, integer *ivuv, integer *ipiti, real *rmsi, real *rci, integer *nout, real *ratio, struct lpc10_decoder_state *st);
  273. extern int placea_(integer *ipitch, integer *voibuf, integer *obound, integer *af, integer *vwin, integer *awin, integer *ewin, integer *lframe, integer *maxwin);
  274. extern int placev_(integer *osbuf, integer *osptr, integer *oslen, integer *obound, integer *vwin, integer *af, integer *lframe, integer *minwin, integer *maxwin, integer *dvwinl, integer *dvwinh);
  275. extern int preemp_(real *inbuf, real *pebuf, integer *nsamp, real *coef, real *z__);
  276. extern int prepro_(real *speech, integer *length,
  277. struct lpc10_encoder_state *st);
  278. extern int decode_(integer *ipitv, integer *irms, integer *irc, integer *voice, integer *pitch, real *rms, real *rc, struct lpc10_decoder_state *st);
  279. extern integer random_(struct lpc10_decoder_state *st);
  280. extern int rcchk_(integer *order, real *rc1f, real *rc2f);
  281. extern int synths_(integer *voice, integer *pitch, real *rms, real *rc, real *speech, integer *k, struct lpc10_decoder_state *st);
  282. extern int tbdm_(real *speech, integer *lpita, integer *tau, integer *ltau, real *amdf, integer *minptr, integer *maxptr, integer *mintau);
  283. extern 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);
  284. extern 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__);
  285. #endif
  286. #endif /* ! defined F2C_INCLUDE */