|
libg722_1
0.0.1
|
00001 /*****************************************************************************/ 00002 /* BroadVoice(R)16 (BV16) Floating-Point ANSI-C Source Code */ 00003 /* Revision Date: August 19, 2009 */ 00004 /* Version 1.0 */ 00005 /*****************************************************************************/ 00006 00007 /*****************************************************************************/ 00008 /* Copyright 2000-2009 Broadcom Corporation */ 00009 /* */ 00010 /* This software is provided under the GNU Lesser General Public License, */ 00011 /* version 2.1, as published by the Free Software Foundation ("LGPL"). */ 00012 /* This program is distributed in the hope that it will be useful, but */ 00013 /* WITHOUT ANY SUPPORT OR WARRANTY; without even the implied warranty of */ 00014 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the LGPL for */ 00015 /* more details. A copy of the LGPL is available at */ 00016 /* http://www.broadcom.com/licenses/LGPLv2.1.php, */ 00017 /* or by writing to the Free Software Foundation, Inc., */ 00018 /* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 00019 /*****************************************************************************/ 00020 00021 00022 /***************************************************************************** 00023 bv16externs.c : BV16 Fixed-Point externs 00024 00025 $Log: bv16externs.h,v $ 00026 Revision 1.1.1.1 2009/11/19 12:10:48 steveu 00027 Start from Broadcom's code 00028 00029 Revision 1.1.1.1 2009/11/17 14:06:02 steveu 00030 start 00031 00032 ******************************************************************************/ 00033 00034 #include "typedef.h" 00035 #include "bv16cnst.h" 00036 #include "bvcommon.h" 00037 00038 /* POINTERS */ 00039 extern const Float bv16_winl[WINSZ]; 00040 extern const Float bv16_sstwin[1 + LPCO]; 00041 extern const Float bv16_gfsz[]; 00042 extern const Float bv16_gfsp[]; 00043 extern const int bv16_idxord[]; 00044 extern const Float bv16_hpfa[]; 00045 extern const Float bv16_hpfb[]; 00046 extern const Float bv16_adf[]; 00047 extern const Float bv16_bdf[]; 00048 extern const Float bv16_x[]; 00049 extern const Float bv16_x2[]; 00050 extern const Float bv16_MPTH[]; 00051 00052 /* LSP Quantization */ 00053 extern const Float bv16_lspecb1[LSPECBSZ1*LPCO]; 00054 extern const Float bv16_lspecb2[LSPECBSZ2*LPCO]; 00055 extern const Float bv16_lspmean[LPCO]; 00056 extern const Float bv16_lspp[LSPPORDER*LPCO]; 00057 00058 /* Pitch Predictor Codebook */ 00059 extern const Float bv16_pp9cb[PPCBSZ*9]; 00060 00061 /* Log-Gain Quantization */ 00062 extern const Float bv16_lgpecb[LGPECBSZ]; 00063 extern const Float bv16_lgp[LGPORDER]; 00064 extern const Float bv16_lgmean; 00065 00066 /* Log-Gain Limitation */ 00067 extern const Float bv16_lgclimit[]; 00068 00069 /* Excitation Codebook */ 00070 extern const Float bv16_cccb[CBSZ*VDIM]; 00071 00072 extern const Float bv16_lgpecb_nh[]; 00073 00074 /* Function Prototypes */ 00075 extern Float estlevel(Float lg, 00076 Float *level, 00077 Float *lmax, 00078 Float *lmin, 00079 Float *lmean, 00080 Float *x1, 00081 int16_t ngfae, 00082 int16_t nggalgc, 00083 Float *estl_alpha_min); 00084 00085 extern void excdec_w_LT_synth( 00086 Float *ltsym, /* long-term synthesis filter memory at decoder*/ 00087 int16_t *idx, /* excitation codebook index array for current subframe */ 00088 Float gainq, /* quantized linear gains for sub-subframes */ 00089 Float *b, /* coefficient of 3-tap pitch predictor */ 00090 int16_t pp, /* pitch period */ 00091 const Float *cb, /* scalar quantizer codebook */ 00092 Float *EE); 00093 00094 extern Float gaindec(Float *lgq, 00095 int16_t gidx, 00096 Float *lgpm, 00097 Float *prevlg, /* previous log gains (last two frames) */ 00098 Float level, 00099 int16_t *nggalgc, 00100 Float *lg_el); 00101 00102 extern Float gaindec_fe(Float lgq_last, 00103 Float *lgpm); 00104 00105 void gainplc(Float E, 00106 Float *lgeqm, 00107 Float *lgqm); 00108 00109 extern void lspdec( 00110 Float *lspq, 00111 int16_t *lspidx, 00112 Float *lsppm, 00113 Float *lspq_last); 00114 00115 extern void lspplc( 00116 Float *lspq, 00117 Float *lsppm); 00118 00119 extern int coarsepitch( 00120 Float *xw, 00121 Float *xwd, 00122 Float *dfm, 00123 int cpplast); 00124 00125 extern int refinepitch( 00126 Float *x, 00127 int cpp, 00128 Float *ppt); 00129 00130 extern int pitchtapquan( 00131 Float *x, 00132 int pp, 00133 Float *b, 00134 Float *re); 00135 00136 extern void excquan( 00137 int16_t *idx, /* quantizer codebook index for uq[] vector */ 00138 Float *s, /* input speech signal vector */ 00139 Float *aq, /* short-term predictor coefficient array */ 00140 Float *fsz, /* short-term noise feedback filter - numerator */ 00141 Float *fsp, /* short-term noise feedback filter - denominator */ 00142 Float *b, /* coefficient of 3-tap pitch predictor */ 00143 Float beta, /* coefficient of 1-tap LT noise feedback filter */ 00144 Float *stsym, /* filter memory before filtering of current vector */ 00145 Float *ltsym, /* long-term synthesis filter memory */ 00146 Float *ltnfm, /* long-term noise feedback filter memory */ 00147 Float *stnfz, 00148 Float *stnfp, 00149 Float *cb, /* scalar quantizer codebook */ 00150 int pp); /* pitch period (# of 8 kHz samples) */ 00151 00152 extern int gainquan( 00153 Float *gainq, 00154 Float lg, 00155 Float *lgpm, 00156 Float *prevlg, 00157 Float level); 00158 00159 extern void lspquan( 00160 Float *lspq, 00161 int16_t *lspidx, 00162 Float *lsp, 00163 Float *lsppm); 00164 00165 extern void bv16_pp3dec(int16_t idx, Float *b);