Let's also include aclocal.m4
[asterisk-bristuff.git] / codecs / lpc10 / median.c
blob383c46e894dfd13373766d8fff97b5cddf2ade93
1 /*
3 $Log$
4 Revision 1.15 2004/06/26 03:50:14 markster
5 Merge source cleanups (bug #1911)
7 Revision 1.14 2003/02/12 13:59:15 matteo
8 mer feb 12 14:56:57 CET 2003
10 Revision 1.1.1.1 2003/02/12 13:59:15 matteo
11 mer feb 12 14:56:57 CET 2003
13 Revision 1.2 2000/01/05 08:20:39 markster
14 Some OSS fixes and a few lpc changes to make it actually work
16 * Revision 1.1 1996/08/19 22:31:31 jaf
17 * Initial revision
22 /* -- translated by f2c (version 19951025).
23 You must link the resulting object file with the libraries:
24 -lf2c -lm (in that order)
27 #include "f2c.h"
29 #ifdef P_R_O_T_O_T_Y_P_E_S
30 extern integer median_(integer *d1, integer *d2, integer *d3);
31 #endif
33 /* ********************************************************************* */
35 /* MEDIAN Version 45G */
37 /* $Log$
38 * Revision 1.15 2004/06/26 03:50:14 markster
39 * Merge source cleanups (bug #1911)
41 * Revision 1.14 2003/02/12 13:59:15 matteo
42 * mer feb 12 14:56:57 CET 2003
44 * Revision 1.1.1.1 2003/02/12 13:59:15 matteo
45 * mer feb 12 14:56:57 CET 2003
47 * Revision 1.2 2000/01/05 08:20:39 markster
48 * Some OSS fixes and a few lpc changes to make it actually work
50 * Revision 1.1 1996/08/19 22:31:31 jaf
51 * Initial revision
52 * */
53 /* Revision 1.2 1996/03/14 22:30:22 jaf */
54 /* Just rearranged the comments and local variable declarations a bit. */
56 /* Revision 1.1 1996/02/07 14:47:53 jaf */
57 /* Initial revision */
60 /* ********************************************************************* */
62 /* Find median of three values */
64 /* Input: */
65 /* D1,D2,D3 - Three input values */
66 /* Output: */
67 /* MEDIAN - Median value */
69 integer median_(integer *d1, integer *d2, integer *d3)
71 /* System generated locals */
72 integer ret_val;
74 /* Arguments */
75 ret_val = *d2;
76 if (*d2 > *d1 && *d2 > *d3) {
77 ret_val = *d1;
78 if (*d3 > *d1) {
79 ret_val = *d3;
81 } else if (*d2 < *d1 && *d2 < *d3) {
82 ret_val = *d1;
83 if (*d3 < *d1) {
84 ret_val = *d3;
87 return ret_val;
88 } /* median_ */