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

📄 psych.c

📁 C写的MPEG4音频源代码(G.723/G.729)
💻 C
📖 第 1 页 / 共 2 页
字号:
      0.20, 0.20, 0.20, 0.20, 0.20, 0.20, 0.20, 0.25, 0.30, 0.30, 0.30, 0.40,      1.00     },     { /* fixed_ratio_short[NSFB_SHORT] */      0.04, 0.04, 0.04, 0.05, 0.07, 0.10, 0.12, 0.15, 0.15, 0.20, 0.25, 0.30, 0.40, 1.00     }  },  { -1 }};static SR_INFO sr_info_960[MAX_SAMPLING_RATES+1] ={  { 8000  ,40, 15,    sfb_8_960,    sfb_8_120,     { /* fixed_ratio_long[NSFB_LONG] */      0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04,       0.04, 0.04, 0.05, 0.05, 0.05, 0.05, 0.05, 0.06, 0.06, 0.06, 0.06, 0.09,       0.09, 0.09, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15,       0.20, 0.20, 0.20, 0.20, 0.20, 0.20, 0.20, 0.25, 0.30, 0.30, 0.30, 0.40,      1.00     },     { /* fixed_ratio_short[NSFB_SHORT] */      0.04, 0.04, 0.04, 0.05, 0.07, 0.10, 0.12, 0.15, 0.15, 0.20, 0.25, 0.30, 0.40, 1.00     }  },  { 11025 ,43, 15,    sfb_16_960,    sfb_16_120,     { /* fixed_ratio_long[NSFB_LONG] */      0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04,       0.04, 0.04, 0.05, 0.05, 0.05, 0.05, 0.05, 0.06, 0.06, 0.06, 0.06, 0.09,       0.09, 0.09, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15,       0.20, 0.20, 0.20, 0.20, 0.20, 0.20, 0.20, 0.25, 0.30, 0.30, 0.30, 0.40,      1.00     },     { /* fixed_ratio_short[NSFB_SHORT] */      0.04, 0.04, 0.04, 0.05, 0.07, 0.10, 0.12, 0.15, 0.15, 0.20, 0.25, 0.30, 0.40, 1.00     }  },  { 12000 ,43, 15,    sfb_16_960,    sfb_16_120,     { /* fixed_ratio_long[NSFB_LONG] */      0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04,       0.04, 0.04, 0.05, 0.05, 0.05, 0.05, 0.05, 0.06, 0.06, 0.06, 0.06, 0.09,       0.09, 0.09, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15,       0.20, 0.20, 0.20, 0.20, 0.20, 0.20, 0.20, 0.25, 0.30, 0.30, 0.30, 0.40,      1.00     },     { /* fixed_ratio_short[NSFB_SHORT] */      0.04, 0.04, 0.04, 0.05, 0.07, 0.10, 0.12, 0.15, 0.15, 0.20, 0.25, 0.30, 0.40, 1.00     }  },  { 16000 ,42, 15,    sfb_16_960,    sfb_16_120,     { /* fixed_ratio_long[NSFB_LONG] */      0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04,       0.04, 0.04, 0.05, 0.05, 0.05, 0.05, 0.05, 0.06, 0.06, 0.06, 0.06, 0.09,       0.09, 0.09, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15,       0.20, 0.20, 0.20, 0.20, 0.20, 0.20, 0.20, 0.25, 0.30, 0.30, 0.30, 0.40,      1.00     },     { /* fixed_ratio_short[NSFB_SHORT] */      0.04, 0.04, 0.04, 0.05, 0.07, 0.10, 0.12, 0.15, 0.15, 0.20, 0.25, 0.30, 0.40, 1.00     }  },  { 24000 ,46, 15,    sfb_24_960,    sfb_24_120,     { /* fixed_ratio_long[NSFB_LONG] */      0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04,       0.04, 0.04, 0.05, 0.05, 0.05, 0.05, 0.05, 0.06, 0.06, 0.06, 0.06, 0.09,       0.09, 0.09, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15,       0.20, 0.20, 0.20, 0.20, 0.20, 0.20, 0.20, 0.25, 0.30, 0.30, 0.30, 0.40,      1.00     },     { /* fixed_ratio_short[NSFB_SHORT] */      0.04, 0.04, 0.04, 0.05, 0.07, 0.10, 0.12, 0.15, 0.15, 0.20, 0.25, 0.30, 0.40, 1.00     }  },  { 32000 ,49, 14,    sfb_32_960,    sfb_48_120,     { /* fixed_ratio_long[NSFB_LONG] */      0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04,       0.04, 0.04, 0.05, 0.05, 0.05, 0.05, 0.05, 0.06, 0.06, 0.06, 0.06, 0.09,       0.09, 0.09, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15,       0.20, 0.20, 0.20, 0.20, 0.20, 0.20, 0.20, 0.25, 0.30, 0.30, 0.30, 0.40,      1.00     },     { /* fixed_ratio_short[NSFB_SHORT] */      0.04, 0.04, 0.04, 0.05, 0.07, 0.10, 0.12, 0.15, 0.15, 0.20, 0.25, 0.30, 0.40, 1.00     }  },  { 44100 ,49, 14,    sfb_48_960,    sfb_48_120,     { /* fixed_ratio_long[NSFB_LONG] */      0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04,       0.04, 0.04, 0.05, 0.05, 0.05, 0.05, 0.05, 0.06, 0.06, 0.06, 0.06, 0.09,       0.09, 0.09, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15,       0.20, 0.20, 0.20, 0.20, 0.20, 0.20, 0.20, 0.25, 0.30, 0.30, 0.30, 0.40,      1.00     },     { /* fixed_ratio_short[NSFB_SHORT] */      0.04, 0.04, 0.04, 0.05, 0.07, 0.10, 0.12, 0.15, 0.15, 0.20, 0.25, 0.30, 0.40, 1.00     }  },  { 48000, 49, 14,    sfb_48_960,    sfb_48_120,     { /* fixed_ratio_long[NSFB_LONG] */      0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04,       0.04, 0.04, 0.05, 0.05, 0.05, 0.05, 0.05, 0.06, 0.06, 0.06, 0.06, 0.09,       0.09, 0.09, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15,       0.20, 0.20, 0.20, 0.20, 0.20, 0.20, 0.20, 0.25, 0.30, 0.30, 0.30, 0.40,      1.00     },     { /* fixed_ratio_short[NSFB_SHORT] */      0.04, 0.04, 0.04, 0.05, 0.07, 0.10, 0.12, 0.15, 0.15, 0.20, 0.25, 0.30, 0.40, 1.00     }  },  { -1 }};static SR_INFO sr_info_NOT_aac[MAX_SAMPLING_RATES+1] ={  { 8000  },  { 11025 },  { 12000 },  { 16000 },  { 22050 },  { 24000 },  { 32000 },  { 44100 },  { 48000, 37, 13,#if 0    { /*  cb_width_long[NSFB_LONG] */      4,  4,  4,  4,  4,  4,  4,  4,  4,  6,  6,  6,       6,  8,  8,  8, 10, 10, 12, 12, 14, 16, 18, 20,       22, 24, 26, 28, 32, 36, 40, 44, 48, 54, 62, 70, 342    },    { /* cb_width_short[NSFB_SHORT] */      4,  4,  4,  4,  4,  6,  6,  8,  8, 10, 12, 16, 42    },#else    NULL,    NULL,#endif    { /* fixed_ratio_long[NSFB_LONG] */      0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.05, 0.05,      0.05, 0.06, 0.06, 0.06, 0.09, 0.09, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15,      0.15, 0.15, 0.20, 0.20, 0.20, 0.20, 0.20, 0.25, 0.30, 0.30, 0.30, 0.40,       1.00    },    { /* fixed_ratio_short[NSFB_SHORT] */      0.04, 0.04, 0.04, 0.05, 0.07, 0.10, 0.12, 0.15, 0.15, 0.20, 0.25, 0.30,       0.40, 1.00    }  },  { 96000 },  { -1 }};void EncTf_psycho_acoustic_init( void ){}void EncTf_psycho_acoustic ( double          sampling_rate,                              int             no_of_chan,         /* no of audio channels */                             QC_MOD_SELECT   qcSelect,                             int             frameLength,                                      CH_PSYCH_OUTPUT p_chpo_long[],                             CH_PSYCH_OUTPUT p_chpo_short[][MAX_SHORT_WINDOWS] ){   int             ch,i,j,k;  SR_INFO*        p_sri = NULL;  /* YB : 971106 */ /* SH : 971121 */  if ((qcSelect==AAC_QC) ||      (qcSelect==AAC_SYS) ||       (qcSelect==AAC_SCALABLE) ||       (qcSelect==AAC_BSAC) ||       (qcSelect==AAC_SCA_BSAC) ||       (qcSelect== AAC_SYS_BSAC) ||      (qcSelect==NTT_VQ) ||      (qcSelect==NTT_VQ_SYS)      ){ /* AAC */    switch (frameLength)       {      case 960:	p_sri = &sr_info_960[0];	break;      case 1024:	p_sri = &sr_info_aac[0];	break;      default:	CommonExit(-1,"\n illegal frameLength in EncTf_psycho_acoustic %d,frameLength");      }  }        else{    CommonExit(-1,"\nthis qc_mode is not supported");    p_sri = &sr_info_NOT_aac[0];  }  /* find correct sampling rate depending parameters */  while( p_sri->sampling_rate != (long)sampling_rate ) {    if( p_sri->sampling_rate == -1 ) {      CommonExit( 1, "Encode: unknown sampling rate in psychoacoustic module %f", sampling_rate );    }    p_sri++;  }  j=0;  for (i=0;i<p_sri->num_cb_long; i++) {    k = p_sri->cb_offset_long[i];    p_sri->cb_width_long[i] = k - j;    j = k;  }  j=0;  for (i=0;i<p_sri->num_cb_short; i++) {    k = p_sri->cb_offset_short[i];    p_sri->cb_width_short[i] = k - j;    j = k;  }    for( ch=0; ch<no_of_chan; ch++ ) {    int i;    p_chpo_long[ch].p_ratio   = p_sri->fixed_ratio_long;    p_chpo_long[ch].cb_width  = p_sri->cb_width_long;    p_chpo_long[ch].no_of_cb  = p_sri->num_cb_long;    for( i=0; i<MAX_SHORT_WINDOWS; i++ ) {      p_chpo_short[ch][i].p_ratio  = p_sri->fixed_ratio_short;      p_chpo_short[ch][i].cb_width = p_sri->cb_width_short;      p_chpo_short[ch][i].no_of_cb = p_sri->num_cb_short;    }  }}

⌨️ 快捷键说明

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