summaryrefslogtreecommitdiffstats
path: root/thirdparties/android/common/include/ilbc
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparties/android/common/include/ilbc')
-rw-r--r--thirdparties/android/common/include/ilbc/FrameClassify.h28
-rw-r--r--thirdparties/android/common/include/ilbc/LPCdecode.h53
-rw-r--r--thirdparties/android/common/include/ilbc/LPCencode.h28
-rw-r--r--thirdparties/android/common/include/ilbc/StateConstructW.h32
-rw-r--r--thirdparties/android/common/include/ilbc/StateSearchW.h53
-rw-r--r--thirdparties/android/common/include/ilbc/anaFilter.h31
-rw-r--r--thirdparties/android/common/include/ilbc/config.h60
-rw-r--r--thirdparties/android/common/include/ilbc/constants.h82
-rw-r--r--thirdparties/android/common/include/ilbc/createCB.h59
-rw-r--r--thirdparties/android/common/include/ilbc/doCPLC.h29
-rw-r--r--thirdparties/android/common/include/ilbc/enhancer.h37
-rw-r--r--thirdparties/android/common/include/ilbc/filter.h82
-rw-r--r--thirdparties/android/common/include/ilbc/gainquant.h30
-rw-r--r--thirdparties/android/common/include/ilbc/getCBvec.h25
-rw-r--r--thirdparties/android/common/include/ilbc/helpfun.h108
-rw-r--r--thirdparties/android/common/include/ilbc/hpInput.h24
-rw-r--r--thirdparties/android/common/include/ilbc/hpOutput.h24
-rw-r--r--thirdparties/android/common/include/ilbc/iCBConstruct.h41
-rw-r--r--thirdparties/android/common/include/ilbc/iCBSearch.h38
-rw-r--r--thirdparties/android/common/include/ilbc/iLBC_decode.h43
-rw-r--r--thirdparties/android/common/include/ilbc/iLBC_define.h221
-rw-r--r--thirdparties/android/common/include/ilbc/iLBC_encode.h40
-rw-r--r--thirdparties/android/common/include/ilbc/lsf.h27
-rw-r--r--thirdparties/android/common/include/ilbc/packing.h69
-rw-r--r--thirdparties/android/common/include/ilbc/syntFilter.h24
25 files changed, 1288 insertions, 0 deletions
diff --git a/thirdparties/android/common/include/ilbc/FrameClassify.h b/thirdparties/android/common/include/ilbc/FrameClassify.h
new file mode 100644
index 0000000..8d30cda
--- /dev/null
+++ b/thirdparties/android/common/include/ilbc/FrameClassify.h
@@ -0,0 +1,28 @@
+
+ /******************************************************************
+
+ iLBC Speech Coder ANSI-C Source Code
+
+ FrameClassify.h
+
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
+
+ ******************************************************************/
+
+ #ifndef __iLBC_FRAMECLASSIFY_H
+ #define __iLBC_FRAMECLASSIFY_H
+
+ int FrameClassify( /* index to the max-energy sub-frame */
+ iLBC_Enc_Inst_t *iLBCenc_inst,
+ /* (i/o) the encoder state structure */
+ float *residual /* (i) lpc residual signal */
+ );
+
+
+
+
+
+
+ #endif
+
diff --git a/thirdparties/android/common/include/ilbc/LPCdecode.h b/thirdparties/android/common/include/ilbc/LPCdecode.h
new file mode 100644
index 0000000..d2aae9b
--- /dev/null
+++ b/thirdparties/android/common/include/ilbc/LPCdecode.h
@@ -0,0 +1,53 @@
+
+ /******************************************************************
+
+ iLBC Speech Coder ANSI-C Source Code
+
+ LPC_decode.h
+
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
+
+ ******************************************************************/
+
+ #ifndef __iLBC_LPC_DECODE_H
+ #define __iLBC_LPC_DECODE_H
+
+ void LSFinterpolate2a_dec(
+ float *a, /* (o) lpc coefficients for a sub-frame */
+ float *lsf1, /* (i) first lsf coefficient vector */
+ float *lsf2, /* (i) second lsf coefficient vector */
+ float coef, /* (i) interpolation weight */
+ int length /* (i) length of lsf vectors */
+ );
+
+ void SimplelsfDEQ(
+ float *lsfdeq, /* (o) dequantized lsf coefficients */
+ int *index, /* (i) quantization index */
+ int lpc_n /* (i) number of LPCs */
+ );
+
+ void DecoderInterpolateLSF(
+ float *syntdenum, /* (o) synthesis filter coefficients */
+ float *weightdenum, /* (o) weighting denumerator
+ coefficients */
+ float *lsfdeq, /* (i) dequantized lsf coefficients */
+ int length, /* (i) length of lsf coefficient vector */
+ iLBC_Dec_Inst_t *iLBCdec_inst
+ /* (i) the decoder state structure */
+ );
+
+ #endif
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/thirdparties/android/common/include/ilbc/LPCencode.h b/thirdparties/android/common/include/ilbc/LPCencode.h
new file mode 100644
index 0000000..39a9b04
--- /dev/null
+++ b/thirdparties/android/common/include/ilbc/LPCencode.h
@@ -0,0 +1,28 @@
+
+ /******************************************************************
+
+ iLBC Speech Coder ANSI-C Source Code
+
+ LPCencode.h
+
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
+
+ ******************************************************************/
+
+ #ifndef __iLBC_LPCENCOD_H
+ #define __iLBC_LPCENCOD_H
+
+ void LPCencode(
+ float *syntdenum, /* (i/o) synthesis filter coefficients
+ before/after encoding */
+ float *weightdenum, /* (i/o) weighting denumerator coefficients
+ before/after encoding */
+ int *lsf_index, /* (o) lsf quantization index */
+ float *data, /* (i) lsf coefficients to quantize */
+ iLBC_Enc_Inst_t *iLBCenc_inst
+ /* (i/o) the encoder state structure */
+ );
+
+ #endif
+
diff --git a/thirdparties/android/common/include/ilbc/StateConstructW.h b/thirdparties/android/common/include/ilbc/StateConstructW.h
new file mode 100644
index 0000000..a066b3d
--- /dev/null
+++ b/thirdparties/android/common/include/ilbc/StateConstructW.h
@@ -0,0 +1,32 @@
+
+ /******************************************************************
+
+ iLBC Speech Coder ANSI-C Source Code
+
+ StateConstructW.h
+
+
+
+
+
+
+
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
+
+ ******************************************************************/
+
+ #ifndef __iLBC_STATECONSTRUCTW_H
+ #define __iLBC_STATECONSTRUCTW_H
+
+ void StateConstructW(
+ int idxForMax, /* (i) 6-bit index for the quantization of
+ max amplitude */
+ int *idxVec, /* (i) vector of quantization indexes */
+ float *syntDenum, /* (i) synthesis filter denumerator */
+ float *out, /* (o) the decoded state vector */
+ int len /* (i) length of a state vector */
+ );
+
+ #endif
+
diff --git a/thirdparties/android/common/include/ilbc/StateSearchW.h b/thirdparties/android/common/include/ilbc/StateSearchW.h
new file mode 100644
index 0000000..8809ac7
--- /dev/null
+++ b/thirdparties/android/common/include/ilbc/StateSearchW.h
@@ -0,0 +1,53 @@
+
+ /******************************************************************
+
+ iLBC Speech Coder ANSI-C Source Code
+
+ StateSearchW.h
+
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
+
+ ******************************************************************/
+
+ #ifndef __iLBC_STATESEARCHW_H
+ #define __iLBC_STATESEARCHW_H
+
+ void AbsQuantW(
+ iLBC_Enc_Inst_t *iLBCenc_inst,
+ /* (i) Encoder instance */
+ float *in, /* (i) vector to encode */
+ float *syntDenum, /* (i) denominator of synthesis filter */
+ float *weightDenum, /* (i) denominator of weighting filter */
+ int *out, /* (o) vector of quantizer indexes */
+ int len, /* (i) length of vector to encode and
+ vector of quantizer indexes */
+ int state_first /* (i) position of start state in the
+ 80 vec */
+ );
+
+ void StateSearchW(
+ iLBC_Enc_Inst_t *iLBCenc_inst,
+ /* (i) Encoder instance */
+ float *residual,/* (i) target residual vector */
+ float *syntDenum, /* (i) lpc synthesis filter */
+ float *weightDenum, /* (i) weighting filter denuminator */
+ int *idxForMax, /* (o) quantizer index for maximum
+ amplitude */
+ int *idxVec, /* (o) vector of quantization indexes */
+ int len, /* (i) length of all vectors */
+ int state_first /* (i) position of start state in the
+ 80 vec */
+ );
+
+
+ #endif
+
+
+
+
+
+
+
+
+
diff --git a/thirdparties/android/common/include/ilbc/anaFilter.h b/thirdparties/android/common/include/ilbc/anaFilter.h
new file mode 100644
index 0000000..5a347e8
--- /dev/null
+++ b/thirdparties/android/common/include/ilbc/anaFilter.h
@@ -0,0 +1,31 @@
+
+ /******************************************************************
+
+ iLBC Speech Coder ANSI-C Source Code
+
+ anaFilter.h
+
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
+
+ ******************************************************************/
+
+ #ifndef __iLBC_ANAFILTER_H
+ #define __iLBC_ANAFILTER_H
+
+ void anaFilter(
+
+
+
+
+
+
+ float *In, /* (i) Signal to be filtered */
+ float *a, /* (i) LP parameters */
+ int len,/* (i) Length of signal */
+ float *Out, /* (o) Filtered signal */
+ float *mem /* (i/o) Filter state */
+ );
+
+ #endif
+
diff --git a/thirdparties/android/common/include/ilbc/config.h b/thirdparties/android/common/include/ilbc/config.h
new file mode 100644
index 0000000..9e3672e
--- /dev/null
+++ b/thirdparties/android/common/include/ilbc/config.h
@@ -0,0 +1,60 @@
+/* config.h. Generated from config.h.in by configure. */
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#define LT_OBJDIR ".libs/"
+
+/* Name of package */
+#define PACKAGE "libilbc"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "diopmamadou(at)doubango(DOT)org"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "libiLBC"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "libiLBC 0.1"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "libilbc"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "0.1"
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Version number of package */
+#define VERSION "0.1"
diff --git a/thirdparties/android/common/include/ilbc/constants.h b/thirdparties/android/common/include/ilbc/constants.h
new file mode 100644
index 0000000..d2adb8a
--- /dev/null
+++ b/thirdparties/android/common/include/ilbc/constants.h
@@ -0,0 +1,82 @@
+
+ /******************************************************************
+
+ iLBC Speech Coder ANSI-C Source Code
+
+ constants.h
+
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
+
+ ******************************************************************/
+
+ #ifndef __iLBC_CONSTANTS_H
+ #define __iLBC_CONSTANTS_H
+
+ #include "iLBC_define.h"
+
+
+ /* ULP bit allocation */
+
+
+
+
+
+
+
+ extern const iLBC_ULP_Inst_t ULP_20msTbl;
+ extern const iLBC_ULP_Inst_t ULP_30msTbl;
+
+ /* high pass filters */
+
+ extern float hpi_zero_coefsTbl[];
+ extern float hpi_pole_coefsTbl[];
+ extern float hpo_zero_coefsTbl[];
+ extern float hpo_pole_coefsTbl[];
+
+ /* low pass filters */
+ extern float lpFilt_coefsTbl[];
+
+ /* LPC analysis and quantization */
+
+ extern float lpc_winTbl[];
+ extern float lpc_asymwinTbl[];
+ extern float lpc_lagwinTbl[];
+ extern float lsfCbTbl[];
+ extern float lsfmeanTbl[];
+ extern int dim_lsfCbTbl[];
+ extern int size_lsfCbTbl[];
+ extern float lsf_weightTbl_30ms[];
+ extern float lsf_weightTbl_20ms[];
+
+ /* state quantization tables */
+
+ extern float state_sq3Tbl[];
+ extern float state_frgqTbl[];
+
+ /* gain quantization tables */
+
+ extern float gain_sq3Tbl[];
+ extern float gain_sq4Tbl[];
+ extern float gain_sq5Tbl[];
+
+ /* adaptive codebook definitions */
+
+ extern int search_rangeTbl[5][CB_NSTAGES];
+ extern int memLfTbl[];
+ extern int stMemLTbl;
+ extern float cbfiltersTbl[CB_FILTERLEN];
+
+ /* enhancer definitions */
+
+ extern float polyphaserTbl[];
+ extern float enh_plocsTbl[];
+
+
+
+
+
+
+
+ #endif
+
diff --git a/thirdparties/android/common/include/ilbc/createCB.h b/thirdparties/android/common/include/ilbc/createCB.h
new file mode 100644
index 0000000..7331dc8
--- /dev/null
+++ b/thirdparties/android/common/include/ilbc/createCB.h
@@ -0,0 +1,59 @@
+
+ /******************************************************************
+
+ iLBC Speech Coder ANSI-C Source Code
+
+ createCB.h
+
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
+
+ ******************************************************************/
+
+ #ifndef __iLBC_CREATECB_H
+ #define __iLBC_CREATECB_H
+
+ void filteredCBvecs(
+ float *cbvectors, /* (o) Codebook vector for the
+ higher section */
+
+
+
+
+
+
+ float *mem, /* (i) Buffer to create codebook
+ vectors from */
+ int lMem /* (i) Length of buffer */
+ );
+
+ void searchAugmentedCB(
+ int low, /* (i) Start index for the search */
+ int high, /* (i) End index for the search */
+ int stage, /* (i) Current stage */
+ int startIndex, /* (i) CB index for the first
+ augmented vector */
+ float *target, /* (i) Target vector for encoding */
+ float *buffer, /* (i) Pointer to the end of the
+ buffer for augmented codebook
+ construction */
+ float *max_measure, /* (i/o) Currently maximum measure */
+ int *best_index,/* (o) Currently the best index */
+ float *gain, /* (o) Currently the best gain */
+ float *energy, /* (o) Energy of augmented
+ codebook vectors */
+ float *invenergy/* (o) Inv energy of aug codebook
+ vectors */
+ );
+
+ void createAugmentedVec(
+ int index, /* (i) Index for the aug vector
+ to be created */
+ float *buffer, /* (i) Pointer to the end of the
+ buffer for augmented codebook
+ construction */
+ float *cbVec /* (o) The construced codebook vector */
+ );
+
+ #endif
+
diff --git a/thirdparties/android/common/include/ilbc/doCPLC.h b/thirdparties/android/common/include/ilbc/doCPLC.h
new file mode 100644
index 0000000..2bda7a1
--- /dev/null
+++ b/thirdparties/android/common/include/ilbc/doCPLC.h
@@ -0,0 +1,29 @@
+
+ /******************************************************************
+
+ iLBC Speech Coder ANSI-C Source Code
+
+ doCPLC.h
+
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
+
+ ******************************************************************/
+
+ #ifndef __iLBC_DOLPC_H
+ #define __iLBC_DOLPC_H
+
+ void doThePLC(
+ float *PLCresidual, /* (o) concealed residual */
+ float *PLClpc, /* (o) concealed LP parameters */
+ int PLI, /* (i) packet loss indicator
+ 0 - no PL, 1 = PL */
+ float *decresidual, /* (i) decoded residual */
+ float *lpc, /* (i) decoded LPC (only used for no PL) */
+ int inlag, /* (i) pitch lag */
+ iLBC_Dec_Inst_t *iLBCdec_inst
+ /* (i/o) decoder instance */
+ );
+
+ #endif
+
diff --git a/thirdparties/android/common/include/ilbc/enhancer.h b/thirdparties/android/common/include/ilbc/enhancer.h
new file mode 100644
index 0000000..bc5152a
--- /dev/null
+++ b/thirdparties/android/common/include/ilbc/enhancer.h
@@ -0,0 +1,37 @@
+
+ /******************************************************************
+
+ iLBC Speech Coder ANSI-C Source Code
+
+ enhancer.h
+
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
+
+
+
+
+
+
+ ******************************************************************/
+
+ #ifndef __ENHANCER_H
+ #define __ENHANCER_H
+
+ #include "iLBC_define.h"
+
+ float xCorrCoef(
+ float *target, /* (i) first array */
+ float *regressor, /* (i) second array */
+ int subl /* (i) dimension arrays */
+ );
+
+ int enhancerInterface(
+ float *out, /* (o) the enhanced recidual signal */
+ float *in, /* (i) the recidual signal to enhance */
+ iLBC_Dec_Inst_t *iLBCdec_inst
+ /* (i/o) the decoder state structure */
+ );
+
+ #endif
+
diff --git a/thirdparties/android/common/include/ilbc/filter.h b/thirdparties/android/common/include/ilbc/filter.h
new file mode 100644
index 0000000..63f5af7
--- /dev/null
+++ b/thirdparties/android/common/include/ilbc/filter.h
@@ -0,0 +1,82 @@
+
+ /******************************************************************
+
+ iLBC Speech Coder ANSI-C Source Code
+
+ filter.h
+
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
+
+ ******************************************************************/
+
+
+
+
+
+
+
+ #ifndef __iLBC_FILTER_H
+ #define __iLBC_FILTER_H
+
+ void AllPoleFilter(
+ float *InOut, /* (i/o) on entrance InOut[-orderCoef] to
+ InOut[-1] contain the state of the
+ filter (delayed samples). InOut[0] to
+ InOut[lengthInOut-1] contain the filter
+ input, on en exit InOut[-orderCoef] to
+ InOut[-1] is unchanged and InOut[0] to
+ InOut[lengthInOut-1] contain filtered
+ samples */
+ float *Coef,/* (i) filter coefficients, Coef[0] is assumed
+ to be 1.0 */
+ int lengthInOut,/* (i) number of input/output samples */
+ int orderCoef /* (i) number of filter coefficients */
+ );
+
+ void AllZeroFilter(
+ float *In, /* (i) In[0] to In[lengthInOut-1] contain
+ filter input samples */
+ float *Coef,/* (i) filter coefficients (Coef[0] is assumed
+ to be 1.0) */
+ int lengthInOut,/* (i) number of input/output samples */
+ int orderCoef, /* (i) number of filter coefficients */
+ float *Out /* (i/o) on entrance Out[-orderCoef] to Out[-1]
+ contain the filter state, on exit Out[0]
+ to Out[lengthInOut-1] contain filtered
+ samples */
+ );
+
+ void ZeroPoleFilter(
+ float *In, /* (i) In[0] to In[lengthInOut-1] contain filter
+ input samples In[-orderCoef] to In[-1]
+ contain state of all-zero section */
+ float *ZeroCoef,/* (i) filter coefficients for all-zero
+ section (ZeroCoef[0] is assumed to
+ be 1.0) */
+ float *PoleCoef,/* (i) filter coefficients for all-pole section
+ (ZeroCoef[0] is assumed to be 1.0) */
+ int lengthInOut,/* (i) number of input/output samples */
+ int orderCoef, /* (i) number of filter coefficients */
+ float *Out /* (i/o) on entrance Out[-orderCoef] to Out[-1]
+ contain state of all-pole section. On
+ exit Out[0] to Out[lengthInOut-1]
+ contain filtered samples */
+ );
+
+
+
+
+
+
+
+ void DownSample (
+ float *In, /* (i) input samples */
+ float *Coef, /* (i) filter coefficients */
+ int lengthIn, /* (i) number of input samples */
+ float *state, /* (i) filter state */
+ float *Out /* (o) downsampled output */
+ );
+
+ #endif
+
diff --git a/thirdparties/android/common/include/ilbc/gainquant.h b/thirdparties/android/common/include/ilbc/gainquant.h
new file mode 100644
index 0000000..0d02424
--- /dev/null
+++ b/thirdparties/android/common/include/ilbc/gainquant.h
@@ -0,0 +1,30 @@
+
+ /******************************************************************
+
+ iLBC Speech Coder ANSI-C Source Code
+
+ gainquant.h
+
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
+
+ ******************************************************************/
+
+ #ifndef __iLBC_GAINQUANT_H
+ #define __iLBC_GAINQUANT_H
+
+ float gainquant(/* (o) quantized gain value */
+ float in, /* (i) gain value */
+ float maxIn,/* (i) maximum of gain value */
+ int cblen, /* (i) number of quantization indices */
+ int *index /* (o) quantization index */
+ );
+
+ float gaindequant( /* (o) quantized gain value */
+ int index, /* (i) quantization index */
+ float maxIn,/* (i) maximum of unquantized gain */
+ int cblen /* (i) number of quantization indices */
+ );
+
+ #endif
+
diff --git a/thirdparties/android/common/include/ilbc/getCBvec.h b/thirdparties/android/common/include/ilbc/getCBvec.h
new file mode 100644
index 0000000..0080907
--- /dev/null
+++ b/thirdparties/android/common/include/ilbc/getCBvec.h
@@ -0,0 +1,25 @@
+
+ /******************************************************************
+
+ iLBC Speech Coder ANSI-C Source Code
+
+ getCBvec.h
+
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
+
+ ******************************************************************/
+
+ #ifndef __iLBC_GETCBVEC_H
+ #define __iLBC_GETCBVEC_H
+
+ void getCBvec(
+ float *cbvec, /* (o) Constructed codebook vector */
+ float *mem, /* (i) Codebook buffer */
+ int index, /* (i) Codebook index */
+ int lMem, /* (i) Length of codebook buffer */
+ int cbveclen/* (i) Codebook vector length */
+ );
+
+ #endif
+
diff --git a/thirdparties/android/common/include/ilbc/helpfun.h b/thirdparties/android/common/include/ilbc/helpfun.h
new file mode 100644
index 0000000..6e80c80
--- /dev/null
+++ b/thirdparties/android/common/include/ilbc/helpfun.h
@@ -0,0 +1,108 @@
+
+ /******************************************************************
+
+ iLBC Speech Coder ANSI-C Source Code
+
+ helpfun.h
+
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
+
+ ******************************************************************/
+
+ #ifndef __iLBC_HELPFUN_H
+ #define __iLBC_HELPFUN_H
+
+ void autocorr(
+ float *r, /* (o) autocorrelation vector */
+ const float *x, /* (i) data vector */
+ int N, /* (i) length of data vector */
+ int order /* largest lag for calculated
+ autocorrelations */
+ );
+
+ void window(
+ float *z, /* (o) the windowed data */
+ const float *x, /* (i) the original data vector */
+ const float *y, /* (i) the window */
+ int N /* (i) length of all vectors */
+ );
+
+ void levdurb(
+ float *a, /* (o) lpc coefficient vector starting
+ with 1.0 */
+ float *k, /* (o) reflection coefficients */
+ float *r, /* (i) autocorrelation vector */
+ int order /* (i) order of lpc filter */
+ );
+
+ void interpolate(
+
+
+
+
+
+
+ float *out, /* (o) the interpolated vector */
+ float *in1, /* (i) the first vector for the
+ interpolation */
+ float *in2, /* (i) the second vector for the
+ interpolation */
+ float coef, /* (i) interpolation weights */
+ int length /* (i) length of all vectors */
+ );
+
+ void bwexpand(
+ float *out, /* (o) the bandwidth expanded lpc
+ coefficients */
+ float *in, /* (i) the lpc coefficients before bandwidth
+ expansion */
+ float coef, /* (i) the bandwidth expansion factor */
+ int length /* (i) the length of lpc coefficient vectors */
+ );
+
+ void vq(
+ float *Xq, /* (o) the quantized vector */
+ int *index, /* (o) the quantization index */
+ const float *CB,/* (i) the vector quantization codebook */
+ float *X, /* (i) the vector to quantize */
+ int n_cb, /* (i) the number of vectors in the codebook */
+ int dim /* (i) the dimension of all vectors */
+ );
+
+ void SplitVQ(
+ float *qX, /* (o) the quantized vector */
+ int *index, /* (o) a vector of indexes for all vector
+ codebooks in the split */
+ float *X, /* (i) the vector to quantize */
+ const float *CB,/* (i) the quantizer codebook */
+ int nsplit, /* the number of vector splits */
+ const int *dim, /* the dimension of X and qX */
+ const int *cbsize /* the number of vectors in the codebook */
+ );
+
+
+ void sort_sq(
+ float *xq, /* (o) the quantized value */
+ int *index, /* (o) the quantization index */
+ float x, /* (i) the value to quantize */
+ const float *cb,/* (i) the quantization codebook */
+ int cb_size /* (i) the size of the quantization codebook */
+ );
+
+ int LSF_check( /* (o) 1 for stable lsf vectors and 0 for
+
+
+
+
+
+
+ nonstable ones */
+ float *lsf, /* (i) a table of lsf vectors */
+ int dim, /* (i) the dimension of each lsf vector */
+ int NoAn /* (i) the number of lsf vectors in the
+ table */
+ );
+
+ #endif
+
diff --git a/thirdparties/android/common/include/ilbc/hpInput.h b/thirdparties/android/common/include/ilbc/hpInput.h
new file mode 100644
index 0000000..3b020d1
--- /dev/null
+++ b/thirdparties/android/common/include/ilbc/hpInput.h
@@ -0,0 +1,24 @@
+
+ /******************************************************************
+
+ iLBC Speech Coder ANSI-C Source Code
+
+ hpInput.h
+
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
+
+ ******************************************************************/
+
+ #ifndef __iLBC_HPINPUT_H
+ #define __iLBC_HPINPUT_H
+
+ void hpInput(
+ float *In, /* (i) vector to filter */
+ int len, /* (i) length of vector to filter */
+ float *Out, /* (o) the resulting filtered vector */
+ float *mem /* (i/o) the filter state */
+ );
+
+ #endif
+
diff --git a/thirdparties/android/common/include/ilbc/hpOutput.h b/thirdparties/android/common/include/ilbc/hpOutput.h
new file mode 100644
index 0000000..b213a19
--- /dev/null
+++ b/thirdparties/android/common/include/ilbc/hpOutput.h
@@ -0,0 +1,24 @@
+
+ /******************************************************************
+
+ iLBC Speech Coder ANSI-C Source Code
+
+ hpOutput.h
+
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
+
+ ******************************************************************/
+
+ #ifndef __iLBC_HPOUTPUT_H
+ #define __iLBC_HPOUTPUT_H
+
+ void hpOutput(
+ float *In, /* (i) vector to filter */
+ int len,/* (i) length of vector to filter */
+ float *Out, /* (o) the resulting filtered vector */
+ float *mem /* (i/o) the filter state */
+ );
+
+ #endif
+
diff --git a/thirdparties/android/common/include/ilbc/iCBConstruct.h b/thirdparties/android/common/include/ilbc/iCBConstruct.h
new file mode 100644
index 0000000..373f66e
--- /dev/null
+++ b/thirdparties/android/common/include/ilbc/iCBConstruct.h
@@ -0,0 +1,41 @@
+
+ /******************************************************************
+
+ iLBC Speech Coder ANSI-C Source Code
+
+ iCBConstruct.h
+
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
+
+
+
+
+
+
+
+ ******************************************************************/
+
+ #ifndef __iLBC_ICBCONSTRUCT_H
+ #define __iLBC_ICBCONSTRUCT_H
+
+ void index_conv_enc(
+ int *index /* (i/o) Codebook indexes */
+ );
+
+ void index_conv_dec(
+ int *index /* (i/o) Codebook indexes */
+ );
+
+ void iCBConstruct(
+ float *decvector, /* (o) Decoded vector */
+ int *index, /* (i) Codebook indices */
+ int *gain_index,/* (i) Gain quantization indices */
+ float *mem, /* (i) Buffer for codevector construction */
+ int lMem, /* (i) Length of buffer */
+ int veclen, /* (i) Length of vector */
+ int nStages /* (i) Number of codebook stages */
+ );
+
+ #endif
+
diff --git a/thirdparties/android/common/include/ilbc/iCBSearch.h b/thirdparties/android/common/include/ilbc/iCBSearch.h
new file mode 100644
index 0000000..39695b5
--- /dev/null
+++ b/thirdparties/android/common/include/ilbc/iCBSearch.h
@@ -0,0 +1,38 @@
+
+ /******************************************************************
+
+ iLBC Speech Coder ANSI-C Source Code
+
+ iCBSearch.h
+
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
+
+ ******************************************************************/
+
+ #ifndef __iLBC_ICBSEARCH_H
+ #define __iLBC_ICBSEARCH_H
+
+
+
+
+
+
+
+ void iCBSearch(
+ iLBC_Enc_Inst_t *iLBCenc_inst,
+ /* (i) the encoder state structure */
+ int *index, /* (o) Codebook indices */
+ int *gain_index,/* (o) Gain quantization indices */
+ float *intarget,/* (i) Target vector for encoding */
+ float *mem, /* (i) Buffer for codebook construction */
+ int lMem, /* (i) Length of buffer */
+ int lTarget, /* (i) Length of vector */
+ int nStages, /* (i) Number of codebook stages */
+ float *weightDenum, /* (i) weighting filter coefficients */
+ float *weightState, /* (i) weighting filter state */
+ int block /* (i) the sub-block number */
+ );
+
+ #endif
+
diff --git a/thirdparties/android/common/include/ilbc/iLBC_decode.h b/thirdparties/android/common/include/ilbc/iLBC_decode.h
new file mode 100644
index 0000000..bfd5223
--- /dev/null
+++ b/thirdparties/android/common/include/ilbc/iLBC_decode.h
@@ -0,0 +1,43 @@
+
+ /******************************************************************
+
+ iLBC Speech Coder ANSI-C Source Code
+
+ iLBC_decode.h
+
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
+
+ ******************************************************************/
+
+ #ifndef __iLBC_ILBCDECODE_H
+ #define __iLBC_ILBCDECODE_H
+
+ #include "iLBC_define.h"
+
+ short initDecode( /* (o) Number of decoded
+ samples */
+ iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) Decoder instance */
+ int mode, /* (i) frame size mode */
+ int use_enhancer /* (i) 1 to use enhancer
+ 0 to run without
+ enhancer */
+ );
+
+ void iLBC_decode(
+ float *decblock, /* (o) decoded signal block */
+ unsigned char *bytes, /* (i) encoded signal bits */
+ iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) the decoder state
+ structure */
+ int mode /* (i) 0: bad packet, PLC,
+ 1: normal */
+
+
+
+
+
+
+ );
+
+ #endif
+
diff --git a/thirdparties/android/common/include/ilbc/iLBC_define.h b/thirdparties/android/common/include/ilbc/iLBC_define.h
new file mode 100644
index 0000000..e704f77
--- /dev/null
+++ b/thirdparties/android/common/include/ilbc/iLBC_define.h
@@ -0,0 +1,221 @@
+
+ /******************************************************************
+
+ iLBC Speech Coder ANSI-C Source Code
+
+ iLBC_define.h
+
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
+
+ ******************************************************************/
+ #include <string.h>
+
+ #ifndef __iLBC_ILBCDEFINE_H
+ #define __iLBC_ILBCDEFINE_H
+
+ /* general codec settings */
+
+ #define FS (float)8000.0
+ #define BLOCKL_20MS 160
+ #define BLOCKL_30MS 240
+ #define BLOCKL_MAX 240
+ #define NSUB_20MS 4
+ #define NSUB_30MS 6
+ #define NSUB_MAX 6
+ #define NASUB_20MS 2
+
+
+
+
+
+
+ #define NASUB_30MS 4
+ #define NASUB_MAX 4
+ #define SUBL 40
+ #define STATE_LEN 80
+ #define STATE_SHORT_LEN_30MS 58
+ #define STATE_SHORT_LEN_20MS 57
+
+ /* LPC settings */
+
+ #define LPC_FILTERORDER 10
+ #define LPC_CHIRP_SYNTDENUM (float)0.9025
+ #define LPC_CHIRP_WEIGHTDENUM (float)0.4222
+ #define LPC_LOOKBACK 60
+ #define LPC_N_20MS 1
+ #define LPC_N_30MS 2
+ #define LPC_N_MAX 2
+ #define LPC_ASYMDIFF 20
+ #define LPC_BW (float)60.0
+ #define LPC_WN (float)1.0001
+ #define LSF_NSPLIT 3
+ #define LSF_NUMBER_OF_STEPS 4
+ #define LPC_HALFORDER (LPC_FILTERORDER/2)
+
+ /* cb settings */
+
+ #define CB_NSTAGES 3
+ #define CB_EXPAND 2
+ #define CB_MEML 147
+ #define CB_FILTERLEN 2*4
+ #define CB_HALFFILTERLEN 4
+ #define CB_RESRANGE 34
+ #define CB_MAXGAIN (float)1.3
+
+ /* enhancer */
+
+ #define ENH_BLOCKL 80 /* block length */
+ #define ENH_BLOCKL_HALF (ENH_BLOCKL/2)
+ #define ENH_HL 3 /* 2*ENH_HL+1 is number blocks
+ in said second sequence */
+ #define ENH_SLOP 2 /* max difference estimated and
+ correct pitch period */
+ #define ENH_PLOCSL 20 /* pitch-estimates and pitch-
+ locations buffer length */
+ #define ENH_OVERHANG 2
+ #define ENH_UPS0 4 /* upsampling rate */
+ #define ENH_FL0 3 /* 2*FLO+1 is the length of
+ each filter */
+ #define ENH_VECTL (ENH_BLOCKL+2*ENH_FL0)
+
+
+
+
+
+
+ #define ENH_CORRDIM (2*ENH_SLOP+1)
+ #define ENH_NBLOCKS (BLOCKL_MAX/ENH_BLOCKL)
+ #define ENH_NBLOCKS_EXTRA 5
+ #define ENH_NBLOCKS_TOT 8 /* ENH_NBLOCKS +
+ ENH_NBLOCKS_EXTRA */
+ #define ENH_BUFL (ENH_NBLOCKS_TOT)*ENH_BLOCKL
+ #define ENH_ALPHA0 (float)0.05
+
+ /* Down sampling */
+
+ #define FILTERORDER_DS 7
+ #define DELAY_DS 3
+ #define FACTOR_DS 2
+
+ /* bit stream defs */
+
+ #define NO_OF_BYTES_20MS 38
+ #define NO_OF_BYTES_30MS 50
+ #define NO_OF_WORDS_20MS 19
+ #define NO_OF_WORDS_30MS 25
+ #define STATE_BITS 3
+ #define BYTE_LEN 8
+ #define ULP_CLASSES 3
+
+ /* help parameters */
+
+ #define FLOAT_MAX (float)1.0e37
+ #define EPS (float)2.220446049250313e-016
+ #define PI (float)3.14159265358979323846
+ #define MIN_SAMPLE -32768
+ #define MAX_SAMPLE 32767
+ #define TWO_PI (float)6.283185307
+ #define PI2 (float)0.159154943
+
+ /* type definition encoder instance */
+ typedef struct iLBC_ULP_Inst_t_ {
+ int lsf_bits[6][ULP_CLASSES+2];
+ int start_bits[ULP_CLASSES+2];
+ int startfirst_bits[ULP_CLASSES+2];
+ int scale_bits[ULP_CLASSES+2];
+ int state_bits[ULP_CLASSES+2];
+ int extra_cb_index[CB_NSTAGES][ULP_CLASSES+2];
+ int extra_cb_gain[CB_NSTAGES][ULP_CLASSES+2];
+ int cb_index[NSUB_MAX][CB_NSTAGES][ULP_CLASSES+2];
+ int cb_gain[NSUB_MAX][CB_NSTAGES][ULP_CLASSES+2];
+ } iLBC_ULP_Inst_t;
+
+ /* type definition encoder instance */
+
+
+
+
+
+
+ typedef struct iLBC_Enc_Inst_t_ {
+
+ /* flag for frame size mode */
+ int mode;
+
+ /* basic parameters for different frame sizes */
+ int blockl;
+ int nsub;
+ int nasub;
+ int no_of_bytes, no_of_words;
+ int lpc_n;
+ int state_short_len;
+ const iLBC_ULP_Inst_t *ULP_inst;
+
+ /* analysis filter state */
+ float anaMem[LPC_FILTERORDER];
+
+ /* old lsf parameters for interpolation */
+ float lsfold[LPC_FILTERORDER];
+ float lsfdeqold[LPC_FILTERORDER];
+
+ /* signal buffer for LP analysis */
+ float lpc_buffer[LPC_LOOKBACK + BLOCKL_MAX];
+
+ /* state of input HP filter */
+ float hpimem[4];
+
+ } iLBC_Enc_Inst_t;
+
+ /* type definition decoder instance */
+ typedef struct iLBC_Dec_Inst_t_ {
+
+ /* flag for frame size mode */
+ int mode;
+
+ /* basic parameters for different frame sizes */
+ int blockl;
+ int nsub;
+ int nasub;
+ int no_of_bytes, no_of_words;
+ int lpc_n;
+ int state_short_len;
+ const iLBC_ULP_Inst_t *ULP_inst;
+
+ /* synthesis filter state */
+ float syntMem[LPC_FILTERORDER];
+
+ /* old LSF for interpolation */
+
+
+
+
+
+
+ float lsfdeqold[LPC_FILTERORDER];
+
+ /* pitch lag estimated in enhancer and used in PLC */
+ int last_lag;
+
+ /* PLC state information */
+ int prevLag, consPLICount, prevPLI, prev_enh_pl;
+ float prevLpc[LPC_FILTERORDER+1];
+ float prevResidual[NSUB_MAX*SUBL];
+ float per;
+ unsigned long seed;
+
+ /* previous synthesis filter parameters */
+ float old_syntdenum[(LPC_FILTERORDER + 1)*NSUB_MAX];
+
+ /* state of output HP filter */
+ float hpomem[4];
+
+ /* enhancer state information */
+ int use_enhancer;
+ float enh_buf[ENH_BUFL];
+ float enh_period[ENH_NBLOCKS_TOT];
+
+ } iLBC_Dec_Inst_t;
+
+ #endif
+
diff --git a/thirdparties/android/common/include/ilbc/iLBC_encode.h b/thirdparties/android/common/include/ilbc/iLBC_encode.h
new file mode 100644
index 0000000..bc49359
--- /dev/null
+++ b/thirdparties/android/common/include/ilbc/iLBC_encode.h
@@ -0,0 +1,40 @@
+
+ /******************************************************************
+
+ iLBC Speech Coder ANSI-C Source Code
+
+ iLBC_encode.h
+
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
+
+ ******************************************************************/
+
+ #ifndef __iLBC_ILBCENCODE_H
+ #define __iLBC_ILBCENCODE_H
+
+ #include "iLBC_define.h"
+
+ short initEncode( /* (o) Number of bytes
+ encoded */
+ iLBC_Enc_Inst_t *iLBCenc_inst, /* (i/o) Encoder instance */
+ int mode /* (i) frame size mode */
+ );
+
+ void iLBC_encode(
+
+ unsigned char *bytes, /* (o) encoded data bits iLBC */
+ float *block, /* (o) speech vector to
+ encode */
+ iLBC_Enc_Inst_t *iLBCenc_inst /* (i/o) the general encoder
+ state */
+ );
+
+ #endif
+
+
+
+
+
+
+
diff --git a/thirdparties/android/common/include/ilbc/lsf.h b/thirdparties/android/common/include/ilbc/lsf.h
new file mode 100644
index 0000000..caff77e
--- /dev/null
+++ b/thirdparties/android/common/include/ilbc/lsf.h
@@ -0,0 +1,27 @@
+
+ /******************************************************************
+
+ iLBC Speech Coder ANSI-C Source Code
+
+ lsf.h
+
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
+
+ ******************************************************************/
+
+ #ifndef __iLBC_LSF_H
+ #define __iLBC_LSF_H
+
+ void a2lsf(
+ float *freq,/* (o) lsf coefficients */
+ float *a /* (i) lpc coefficients */
+ );
+
+ void lsf2a(
+ float *a_coef, /* (o) lpc coefficients */
+ float *freq /* (i) lsf coefficients */
+ );
+
+ #endif
+
diff --git a/thirdparties/android/common/include/ilbc/packing.h b/thirdparties/android/common/include/ilbc/packing.h
new file mode 100644
index 0000000..762cfb1
--- /dev/null
+++ b/thirdparties/android/common/include/ilbc/packing.h
@@ -0,0 +1,69 @@
+
+ /******************************************************************
+
+ iLBC Speech Coder ANSI-C Source Code
+
+ packing.h
+
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
+
+ ******************************************************************/
+
+ #ifndef __PACKING_H
+ #define __PACKING_H
+
+ void packsplit(
+ int *index, /* (i) the value to split */
+ int *firstpart, /* (o) the value specified by most
+ significant bits */
+ int *rest, /* (o) the value specified by least
+ significant bits */
+ int bitno_firstpart, /* (i) number of bits in most
+ significant part */
+ int bitno_total /* (i) number of bits in full range
+ of value */
+ );
+
+ void packcombine(
+ int *index, /* (i/o) the msb value in the
+ combined value out */
+ int rest, /* (i) the lsb value */
+ int bitno_rest /* (i) the number of bits in the
+ lsb part */
+ );
+
+ void dopack(
+ unsigned char **bitstream, /* (i/o) on entrance pointer to
+ place in bitstream to pack
+ new data, on exit pointer
+ to place in bitstream to
+ pack future data */
+ int index, /* (i) the value to pack */
+ int bitno, /* (i) the number of bits that the
+ value will fit within */
+ int *pos /* (i/o) write position in the
+ current byte */
+ );
+
+
+
+
+
+
+ void unpack(
+ unsigned char **bitstream, /* (i/o) on entrance pointer to
+ place in bitstream to
+ unpack new data from, on
+ exit pointer to place in
+ bitstream to unpack future
+ data from */
+ int *index, /* (o) resulting value */
+ int bitno, /* (i) number of bits used to
+ represent the value */
+ int *pos /* (i/o) read position in the
+ current byte */
+ );
+
+ #endif
+
diff --git a/thirdparties/android/common/include/ilbc/syntFilter.h b/thirdparties/android/common/include/ilbc/syntFilter.h
new file mode 100644
index 0000000..8865b89
--- /dev/null
+++ b/thirdparties/android/common/include/ilbc/syntFilter.h
@@ -0,0 +1,24 @@
+
+ /******************************************************************
+
+ iLBC Speech Coder ANSI-C Source Code
+
+ syntFilter.h
+
+ Copyright (C) The Internet Society (2004).
+ All Rights Reserved.
+
+ ******************************************************************/
+
+ #ifndef __iLBC_SYNTFILTER_H
+ #define __iLBC_SYNTFILTER_H
+
+ void syntFilter(
+ float *Out, /* (i/o) Signal to be filtered */
+ float *a, /* (i) LP parameters */
+ int len, /* (i) Length of signal */
+ float *mem /* (i/o) Filter state */
+ );
+
+ #endif
+
OpenPOWER on IntegriCloud