3 * Revision 1.2 1996/08/20 20:41:32 jaf
4 * Removed all static local variables that were SAVE'd in the Fortran
5 * code, and put them in struct lpc10_decoder_state that is passed as an
8 * Removed init function, since all initialization is now done in
9 * init_lpc10_decoder_state().
11 * Revision 1.1 1996/08/19 22:30:49 jaf
17 /* -- translated by f2c (version 19951025).
18 You must link the resulting object file with the libraries:
19 -lf2c -lm (in that order)
24 extern integer
random_(struct lpc10_decoder_state
*st
);
26 /* ********************************************************************** */
28 /* RANDOM Version 49 */
31 * Revision 1.2 1996/08/20 20:41:32 jaf
32 * Removed all static local variables that were SAVE'd in the Fortran
33 * code, and put them in struct lpc10_decoder_state that is passed as an
36 * Removed init function, since all initialization is now done in
37 * init_lpc10_decoder_state().
39 * Revision 1.1 1996/08/19 22:30:49 jaf
42 /* Revision 1.3 1996/03/20 16:13:54 jaf */
43 /* Rearranged comments a little bit, and added comments explaining that */
44 /* even though there is local state here, there is no need to create an */
45 /* ENTRY for reinitializing it. */
47 /* Revision 1.2 1996/03/14 22:25:29 jaf */
48 /* Just rearranged the comments and local variable declarations a bit. */
50 /* Revision 1.1 1996/02/07 14:49:01 jaf */
51 /* Initial revision */
54 /* ********************************************************************* */
56 /* Pseudo random number generator based on Knuth, Vol 2, p. 27. */
58 /* Function Return: */
59 /* RANDOM - Integer variable, uniformly distributed over -32768 to 32767 */
61 /* This subroutine maintains local state from one call to the next. */
62 /* In the context of the LPC10 coder, there is no reason to reinitialize */
63 /* this local state when switching between audio streams, because its */
64 /* results are only used to generate noise for unvoiced frames. */
66 integer
random_(struct lpc10_decoder_state
*st
)
68 /* Initialized data */
74 /* System generated locals */
77 /* Parameters/constants */
79 /* The following is a 16 bit 2's complement addition, */
80 /* with overflow checking disabled */
86 y
[*k
- 1] += y
[*j
- 1];