libvoipcodecs  0.0.1
iLBC_define.h
Go to the documentation of this file.
1 /*
2  * iLBC - a library for the iLBC codec
3  *
4  * iLBC_define.h - The head guy amongst the headers
5  *
6  * Adapted by Steve Underwood <steveu@coppice.org> from the reference
7  * iLBC code supplied in RFC3951.
8  *
9  * Original code Copyright (C) The Internet Society (2004).
10  * All changes to produce this version Copyright (C) 2008 by Steve Underwood
11  * All Rights Reserved.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  *
17  * $Id: iLBC_define.h,v 1.2 2008/03/06 12:27:38 steveu Exp $
18  */
19 
20 /*! \file */
21 
22 #if !defined(_ILBC_DEFINE_H_)
23 #define _ILBC_DEFINE_H_
24 
25 #include <string.h>
26 
27 #define FS 8000.0f
28 #define NSUB_20MS 4
29 #define NSUB_30MS 6
30 #define NASUB_20MS 2
31 
32 
33 #define NASUB_30MS 4
34 #define NASUB_MAX 4
35 #define SUBL 40
36 #define STATE_LEN 80
37 #define STATE_SHORT_LEN_30MS 58
38 #define STATE_SHORT_LEN_20MS 57
39 
40 /* LPC settings */
41 
42 #define ILBC_LPC_FILTERORDER 10
43 #define LPC_CHIRP_SYNTDENUM 0.9025f
44 #define LPC_CHIRP_WEIGHTDENUM 0.4222f
45 #define LPC_LOOKBACK 60
46 #define LPC_N_20MS 1
47 #define LPC_N_30MS 2
48 #define LPC_N_MAX 2
49 #define LPC_ASYMDIFF 20
50 #define LPC_BW 60.0f
51 #define LPC_WN 1.0001f
52 #define LSF_NSPLIT 3
53 #define LSF_NUMBER_OF_STEPS 4
54 #define LPC_HALFORDER (ILBC_LPC_FILTERORDER/2)
55 
56 /* cb settings */
57 
58 #define CB_NSTAGES 3
59 #define CB_EXPAND 2
60 #define CB_MEML 147
61 #define CB_FILTERLEN 2*4
62 #define CB_HALFFILTERLEN 4
63 #define CB_RESRANGE 34
64 #define CB_MAXGAIN 1.3f
65 
66 /* enhancer */
67 
68 #define ENH_BLOCKL 80 /* block length */
69 #define ENH_BLOCKL_HALF (ENH_BLOCKL/2)
70 #define ENH_HL 3 /* 2*ENH_HL+1 is number blocks in said second sequence */
71 #define ENH_SLOP 2 /* max difference estimated and correct pitch period */
72 #define ENH_PLOCSL 20 /* pitch-estimates and pitch-locations buffer length */
73 #define ENH_OVERHANG 2
74 #define ENH_UPS0 4 /* upsampling rate */
75 #define ENH_FL0 3 /* 2*FLO+1 is the length of each filter */
76 #define ENH_VECTL (ENH_BLOCKL + 2*ENH_FL0)
77 
78 #define ENH_CORRDIM (2*ENH_SLOP + 1)
79 #define ENH_NBLOCKS (ILBC_BLOCK_LEN_MAX/ENH_BLOCKL)
80 #define ENH_NBLOCKS_EXTRA 5
81 #define ENH_NBLOCKS_TOT 8 /* ENH_NBLOCKS + ENH_NBLOCKS_EXTRA */
82 #define ENH_BUFL (ENH_NBLOCKS_TOT*ENH_BLOCKL)
83 #define ENH_ALPHA0 0.05f
84 
85 /* Down sampling */
86 
87 #define FILTERORDER_DS 7
88 #define DELAY_DS 3
89 #define FACTOR_DS 2
90 
91 /* bit stream defs */
92 
93 #define STATE_BITS 3
94 #define BYTE_LEN 8
95 
96 /* help parameters */
97 
98 #define FLOAT_MAX 1.0e37f
99 #define EPS 2.220446049250313e-016f
100 #define PI 3.14159265358979323846f
101 #define MIN_SAMPLE -32768
102 #define MAX_SAMPLE 32767
103 #define TWO_PI 6.283185307f
104 #define PI2 0.159154943f
105 
106 #endif
107 /*- End of file ------------------------------------------------------------*/