libilbc 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
18/*! \file */
19
20#if !defined(_ILBC_DEFINE_H_)
21#define _ILBC_DEFINE_H_
22
23#include <string.h>
24
25#define FS 8000.0f
26#define NSUB_20MS 4
27#define NSUB_30MS 6
28#define NASUB_20MS 2
29
30
31#define NASUB_30MS 4
32#define NASUB_MAX 4
33#define SUBL 40
34#define STATE_LEN 80
35#define STATE_SHORT_LEN_30MS 58
36#define STATE_SHORT_LEN_20MS 57
37
38/* LPC settings */
39
40#define ILBC_LPC_FILTERORDER 10
41#define LPC_CHIRP_SYNTDENUM 0.9025f
42#define LPC_CHIRP_WEIGHTDENUM 0.4222f
43#define LPC_LOOKBACK 60
44#define LPC_N_20MS 1
45#define LPC_N_30MS 2
46#define LPC_N_MAX 2
47#define LPC_ASYMDIFF 20
48#define LPC_BW 60.0f
49#define LPC_WN 1.0001f
50#define LSF_NSPLIT 3
51#define LSF_NUMBER_OF_STEPS 4
52#define LPC_HALFORDER (ILBC_LPC_FILTERORDER/2)
53
54/* cb settings */
55
56#define CB_NSTAGES 3
57#define CB_EXPAND 2
58#define CB_MEML 147
59#define CB_FILTERLEN 2*4
60#define CB_HALFFILTERLEN 4
61#define CB_RESRANGE 34
62#define CB_MAXGAIN 1.3f
63
64/* enhancer */
65
66#define ENH_BLOCKL 80 /* block length */
67#define ENH_BLOCKL_HALF (ENH_BLOCKL/2)
68#define ENH_HL 3 /* 2*ENH_HL+1 is number blocks in said second sequence */
69#define ENH_SLOP 2 /* max difference estimated and correct pitch period */
70#define ENH_PLOCSL 20 /* pitch-estimates and pitch-locations buffer length */
71#define ENH_OVERHANG 2
72#define ENH_UPS0 4 /* upsampling rate */
73#define ENH_FL0 3 /* 2*FLO+1 is the length of each filter */
74#define ENH_VECTL (ENH_BLOCKL + 2*ENH_FL0)
75
76#define ENH_CORRDIM (2*ENH_SLOP + 1)
77#define ENH_NBLOCKS (ILBC_BLOCK_LEN_MAX/ENH_BLOCKL)
78#define ENH_NBLOCKS_EXTRA 5
79#define ENH_NBLOCKS_TOT 8 /* ENH_NBLOCKS + ENH_NBLOCKS_EXTRA */
80#define ENH_BUFL (ENH_NBLOCKS_TOT*ENH_BLOCKL)
81#define ENH_ALPHA0 0.05f
82
83/* Down sampling */
84
85#define FILTERORDER_DS 7
86#define DELAY_DS 3
87#define FACTOR_DS 2
88
89/* bit stream defs */
90
91#define STATE_BITS 3
92#define BYTE_LEN 8
93
94/* help parameters */
95
96#define FLOAT_MAX 1.0e37f
97#define EPS 2.220446049250313e-016f
98#define PI 3.14159265358979323846f
99#define MIN_SAMPLE -32768
100#define MAX_SAMPLE 32767
101#define TWO_PI 6.283185307f
102#define PI2 0.159154943f
103
104#endif
105/*- End of file ------------------------------------------------------------*/