⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 constants.c

📁 PA1688网络电话机全部源程序
💻 C
📖 第 1 页 / 共 3 页
字号:
    
   /****************************************************************** 
    
       iLBC Speech Coder ANSI-C Source Code 
    
       constants.c 
    
       Copyright (c) 2001, 
       Global IP Sound AB. 
       All rights reserved. 
    
   ******************************************************************/ 
    
   #include "iLBC_define.h" 
    
   /* ULP bit allocation */ 
    
       /* 20 ms frame */ 
    
   const iLBC_ULP_Inst_t ULP_20msTbl = { 
       /* LSF */ 
     
    
    
       {   {6,0,0,0,0}, {7,0,0,0,0}, {7,0,0,0,0},  
           {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}}, 
       /* Start state location, gain and samples */ 
       {2,0,0,0,0}, 
       {1,0,0,0,0}, 
       {6,0,0,0,0}, 
       {0,1,2,0,0}, 
       /* extra CB index and extra CB gain */ 
       {{6,0,1,0,0}, {0,0,7,0,0}, {0,0,7,0,0}}, 
       {{2,0,3,0,0}, {1,1,2,0,0}, {0,0,3,0,0}}, 
       /* CB index and CB gain */ 
       {   {{7,0,1,0,0}, {0,0,7,0,0}, {0,0,7,0,0}}, 
           {{0,0,8,0,0}, {0,0,8,0,0}, {0,0,8,0,0}}, 
           {{0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}}, 
           {{0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}}}, 
       {   {{1,2,2,0,0}, {1,1,2,0,0}, {0,0,3,0,0}}, 
           {{1,1,3,0,0}, {0,2,2,0,0}, {0,0,3,0,0}}, 
           {{0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}}, 
           {{0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}}} 
   }; 
    
       /* 30 ms frame */ 
    
   const iLBC_ULP_Inst_t ULP_30msTbl = { 
       /* LSF */ 
       {   {6,0,0,0,0}, {7,0,0,0,0}, {7,0,0,0,0},  
           {6,0,0,0,0}, {7,0,0,0,0}, {7,0,0,0,0}}, 
       /* Start state location, gain and samples */ 
       {3,0,0,0,0}, 
       {1,0,0,0,0}, 
       {6,0,0,0,0}, 
       {0,1,2,0,0}, 
       /* extra CB index and extra CB gain */ 
       {{4,2,1,0,0}, {0,0,7,0,0}, {0,0,7,0,0}}, 
       {{1,1,3,0,0}, {1,1,2,0,0}, {0,0,3,0,0}}, 
       /* CB index and CB gain */ 
       {   {{6,1,1,0,0}, {0,0,7,0,0}, {0,0,7,0,0}}, 
           {{0,7,1,0,0}, {0,0,8,0,0}, {0,0,8,0,0}}, 
           {{0,7,1,0,0}, {0,0,8,0,0}, {0,0,8,0,0}}, 
           {{0,7,1,0,0}, {0,0,8,0,0}, {0,0,8,0,0}}}, 
       {   {{1,2,2,0,0}, {1,2,1,0,0}, {0,0,3,0,0}}, 
           {{0,2,3,0,0}, {0,2,2,0,0}, {0,0,3,0,0}}, 
           {{0,1,4,0,0}, {0,1,3,0,0}, {0,0,3,0,0}}, 
           {{0,1,4,0,0}, {0,1,3,0,0}, {0,0,3,0,0}}} 
   }; 
    
   /* HP Filters */ 
    
   float hpi_zero_coefsTbl[3] = { 
       (float)0.92727436, (float)-1.8544941, (float)0.92727436 
   }; 
   float hpi_pole_coefsTbl[3] = { 
       (float)1.0, (float)-1.9059465, (float)0.9114024 
     
    
    
   }; 
   float hpo_zero_coefsTbl[3] = { 
       (float)0.93980581, (float)-1.8795834, (float)0.93980581 
   }; 
   float hpo_pole_coefsTbl[3] = { 
       (float)1.0, (float)-1.9330735, (float)0.93589199 
   }; 
    
   /* LP Filter */ 
    
   float lpFilt_coefsTbl[FILTERORDER_DS]={ 
       (float)-0.066650, (float)0.125000, (float)0.316650,  
       (float)0.414063, (float)0.316650,  
       (float)0.125000, (float)-0.066650 
   }; 
    
   /* State quantization tables */ 
    
   float state_sq3Tbl[8] = { 
       (float)-3.719849, (float)-2.177490, (float)-1.130005,  
       (float)-0.309692, (float)0.444214, (float)1.329712,  
       (float)2.436279, (float)3.983887 
   }; 
    
   float state_frgqTbl[64] = { 
       (float)1.000085, (float)1.071695, (float)1.140395,  
       (float)1.206868, (float)1.277188, (float)1.351503,  
       (float)1.429380, (float)1.500727, (float)1.569049,  
       (float)1.639599, (float)1.707071, (float)1.781531,  
       (float)1.840799, (float)1.901550, (float)1.956695,  
       (float)2.006750, (float)2.055474, (float)2.102787,  
       (float)2.142819, (float)2.183592, (float)2.217962,  
       (float)2.257177, (float)2.295739, (float)2.332967,  
       (float)2.369248, (float)2.402792, (float)2.435080,  
       (float)2.468598, (float)2.503394, (float)2.539284,  
       (float)2.572944, (float)2.605036, (float)2.636331,  
       (float)2.668939, (float)2.698780, (float)2.729101,  
       (float)2.759786, (float)2.789834, (float)2.818679,  
       (float)2.848074, (float)2.877470, (float)2.906899,  
       (float)2.936655, (float)2.967804, (float)3.000115,  
       (float)3.033367, (float)3.066355, (float)3.104231,  
       (float)3.141499, (float)3.183012, (float)3.222952,  
       (float)3.265433, (float)3.308441, (float)3.350823,  
       (float)3.395275, (float)3.442793, (float)3.490801,  
       (float)3.542514, (float)3.604064, (float)3.666050,  
       (float)3.740994, (float)3.830749, (float)3.938770,  
       (float)4.101764 
   }; 
    
   /* CB tables */ 
    
   int search_rangeTbl[5][CB_NSTAGES]={{58,58,58}, {108,44,44},  
               {108,108,108}, {108,108,108}, {108,108,108}}; 
     
    
    
   int stMemLTbl=85; 
   int memLfTbl[NASUB_MAX]={147,147,147,147}; 
    
   /* expansion filter(s) */ 
    
   float cbfiltersTbl[CB_FILTERLEN]={ 
       (float)-0.033691, (float)0.083740, (float)-0.144043,  
           (float)0.713379, (float)0.806152, (float)-0.184326,  
           (float)0.108887, (float)-0.034180}; 
    
   /* Gain Quantization */ 
    
   float gain_sq3Tbl[8]={ 
       (float)-1.000000,  (float)-0.659973,  (float)-0.330017, 
       (float)0.000000, (float)0.250000, (float)0.500000,  
       (float)0.750000, (float)1.00000}; 
    
   float gain_sq4Tbl[16]={ 
       (float)-1.049988, (float)-0.900024, (float)-0.750000,  
       (float)-0.599976, (float)-0.450012, (float)-0.299988,  
       (float)-0.150024, (float)0.000000, (float)0.150024,  
       (float)0.299988, (float)0.450012, (float)0.599976,  
       (float)0.750000, (float)0.900024, (float)1.049988,  
       (float)1.200012}; 
    
   float gain_sq5Tbl[32]={ 
       (float)0.037476, (float)0.075012, (float)0.112488,  
       (float)0.150024, (float)0.187500, (float)0.224976,  
       (float)0.262512, (float)0.299988, (float)0.337524,  
       (float)0.375000, (float)0.412476, (float)0.450012,  
       (float)0.487488, (float)0.525024, (float)0.562500,  
       (float)0.599976, (float)0.637512, (float)0.674988,  
       (float)0.712524, (float)0.750000, (float)0.787476,  
       (float)0.825012, (float)0.862488, (float)0.900024,  
       (float)0.937500, (float)0.974976, (float)1.012512,  
       (float)1.049988, (float)1.087524, (float)1.125000,  
       (float)1.162476, (float)1.200012}; 
    
   /* Enhancer - Upsamling a factor 4 (ENH_UPS0 = 4) */ 
   float polyphaserTbl[ENH_UPS0*(2*ENH_FL0+1)]={  
       (float)0.000000, (float)0.000000, (float)0.000000, 
   (float)1.000000,  
           (float)0.000000, (float)0.000000, (float)0.000000,  
       (float)0.015625, (float)-0.076904, (float)0.288330, 
   (float)0.862061,  
           (float)-0.106445, (float)0.018799, (float)-0.015625,  
       (float)0.023682, (float)-0.124268, (float)0.601563, 
   (float)0.601563,  
           (float)-0.124268, (float)0.023682, (float)-0.023682,  
       (float)0.018799, (float)-0.106445, (float)0.862061, 
   (float)0.288330,  
           (float)-0.076904, (float)0.015625, (float)-0.018799}; 
    
     
    
    
   float enh_plocsTbl[ENH_NBLOCKS_TOT] = {(float)40.0, (float)120.0,  
               (float)200.0, (float)280.0, (float)360.0,  
               (float)440.0, (float)520.0, (float)600.0}; 
    
   /* LPC analysis and quantization */  
    
   int dim_lsfCbTbl[LSF_NSPLIT] = {3, 3, 4}; 
   int size_lsfCbTbl[LSF_NSPLIT] = {64,128,128}; 
    
    
   float lsfmeanTbl[LPC_FILTERORDER] = {  
       (float)0.281738, (float)0.445801, (float)0.663330,  
       (float)0.962524, (float)1.251831, (float)1.533081,  
       (float)1.850586, (float)2.137817, (float)2.481445,  
       (float)2.777344}; 
    
   float lsf_weightTbl_30ms[6] = {(float)(1.0/2.0), (float)1.0, 
   (float)(2.0/3.0),  
       (float)(1.0/3.0), (float)0.0, (float)0.0}; 
    
   float lsf_weightTbl_20ms[4] = {(float)(3.0/4.0), (float)(2.0/4.0),  
       (float)(1.0/4.0), (float)(0.0)}; 
    
   /* Hanning LPC window */ 
   float lpc_winTbl[BLOCKL_MAX]={ 
       (float)0.000183, (float)0.000671, (float)0.001526, 
       (float)0.002716, (float)0.004242, (float)0.006104, 
       (float)0.008301, (float)0.010834, (float)0.013702, 
       (float)0.016907, (float)0.020416, (float)0.024261, 
       (float)0.028442, (float)0.032928, (float)0.037750, 
       (float)0.042877, (float)0.048309, (float)0.054047, 
       (float)0.060089, (float)0.066437, (float)0.073090, 
       (float)0.080017, (float)0.087219, (float)0.094727, 
       (float)0.102509, (float)0.110535, (float)0.118835, 
       (float)0.127411, (float)0.136230, (float)0.145294, 
       (float)0.154602, (float)0.164154, (float)0.173920, 
       (float)0.183899, (float)0.194122, (float)0.204529, 
       (float)0.215149, (float)0.225952, (float)0.236938, 
       (float)0.248108, (float)0.259460, (float)0.270966, 
       (float)0.282654, (float)0.294464, (float)0.306396, 
       (float)0.318481, (float)0.330688, (float)0.343018, 
       (float)0.355438, (float)0.367981, (float)0.380585, 
       (float)0.393280, (float)0.406067, (float)0.418884, 
       (float)0.431763, (float)0.444702, (float)0.457672, 
       (float)0.470673, (float)0.483704, (float)0.496735, 
       (float)0.509766, (float)0.522797, (float)0.535828, 
       (float)0.548798, (float)0.561768, (float)0.574677, 
       (float)0.587524, (float)0.600342, (float)0.613068, 
       (float)0.625732, (float)0.638306, (float)0.650787, 
       (float)0.663147, (float)0.675415, (float)0.687561, 
       (float)0.699585, (float)0.711487, (float)0.723206, 
       (float)0.734802, (float)0.746216, (float)0.757477, 
       (float)0.768585, (float)0.779480, (float)0.790192, 
     
    
    

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -