libilbc
0.0.1
|
00001 /* 00002 * iLBC - a library for the iLBC codec 00003 * 00004 * iLBC_define.h - The head guy amongst the headers 00005 * 00006 * Adapted by Steve Underwood <steveu@coppice.org> from the reference 00007 * iLBC code supplied in RFC3951. 00008 * 00009 * Original code Copyright (C) The Internet Society (2004). 00010 * All changes to produce this version Copyright (C) 2008 by Steve Underwood 00011 * All Rights Reserved. 00012 * 00013 * This program is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00016 * 00017 * $Id: iLBC_define.h,v 1.2 2008/03/06 12:27:38 steveu Exp $ 00018 */ 00019 00020 /*! \file */ 00021 00022 #if !defined(_ILBC_DEFINE_H_) 00023 #define _ILBC_DEFINE_H_ 00024 00025 #include <string.h> 00026 00027 #define FS 8000.0f 00028 #define NSUB_20MS 4 00029 #define NSUB_30MS 6 00030 #define NASUB_20MS 2 00031 00032 00033 #define NASUB_30MS 4 00034 #define NASUB_MAX 4 00035 #define SUBL 40 00036 #define STATE_LEN 80 00037 #define STATE_SHORT_LEN_30MS 58 00038 #define STATE_SHORT_LEN_20MS 57 00039 00040 /* LPC settings */ 00041 00042 #define ILBC_LPC_FILTERORDER 10 00043 #define LPC_CHIRP_SYNTDENUM 0.9025f 00044 #define LPC_CHIRP_WEIGHTDENUM 0.4222f 00045 #define LPC_LOOKBACK 60 00046 #define LPC_N_20MS 1 00047 #define LPC_N_30MS 2 00048 #define LPC_N_MAX 2 00049 #define LPC_ASYMDIFF 20 00050 #define LPC_BW 60.0f 00051 #define LPC_WN 1.0001f 00052 #define LSF_NSPLIT 3 00053 #define LSF_NUMBER_OF_STEPS 4 00054 #define LPC_HALFORDER (ILBC_LPC_FILTERORDER/2) 00055 00056 /* cb settings */ 00057 00058 #define CB_NSTAGES 3 00059 #define CB_EXPAND 2 00060 #define CB_MEML 147 00061 #define CB_FILTERLEN 2*4 00062 #define CB_HALFFILTERLEN 4 00063 #define CB_RESRANGE 34 00064 #define CB_MAXGAIN 1.3f 00065 00066 /* enhancer */ 00067 00068 #define ENH_BLOCKL 80 /* block length */ 00069 #define ENH_BLOCKL_HALF (ENH_BLOCKL/2) 00070 #define ENH_HL 3 /* 2*ENH_HL+1 is number blocks in said second sequence */ 00071 #define ENH_SLOP 2 /* max difference estimated and correct pitch period */ 00072 #define ENH_PLOCSL 20 /* pitch-estimates and pitch-locations buffer length */ 00073 #define ENH_OVERHANG 2 00074 #define ENH_UPS0 4 /* upsampling rate */ 00075 #define ENH_FL0 3 /* 2*FLO+1 is the length of each filter */ 00076 #define ENH_VECTL (ENH_BLOCKL + 2*ENH_FL0) 00077 00078 #define ENH_CORRDIM (2*ENH_SLOP + 1) 00079 #define ENH_NBLOCKS (ILBC_BLOCK_LEN_MAX/ENH_BLOCKL) 00080 #define ENH_NBLOCKS_EXTRA 5 00081 #define ENH_NBLOCKS_TOT 8 /* ENH_NBLOCKS + ENH_NBLOCKS_EXTRA */ 00082 #define ENH_BUFL (ENH_NBLOCKS_TOT*ENH_BLOCKL) 00083 #define ENH_ALPHA0 0.05f 00084 00085 /* Down sampling */ 00086 00087 #define FILTERORDER_DS 7 00088 #define DELAY_DS 3 00089 #define FACTOR_DS 2 00090 00091 /* bit stream defs */ 00092 00093 #define STATE_BITS 3 00094 #define BYTE_LEN 8 00095 00096 /* help parameters */ 00097 00098 #define FLOAT_MAX 1.0e37f 00099 #define EPS 2.220446049250313e-016f 00100 #define PI 3.14159265358979323846f 00101 #define MIN_SAMPLE -32768 00102 #define MAX_SAMPLE 32767 00103 #define TWO_PI 6.283185307f 00104 #define PI2 0.159154943f 00105 00106 #endif 00107 /*- End of file ------------------------------------------------------------*/