Main Page | Class List | File List | Class Members | File Members

ltp.h

Go to the documentation of this file.
00001 /* Copyright (C) 2002 Jean-Marc Valin 00002 File: ltp.h 00003 Long-Term Prediction functions 00004 00005 Redistribution and use in source and binary forms, with or without 00006 modification, are permitted provided that the following conditions 00007 are met: 00008 00009 - Redistributions of source code must retain the above copyright 00010 notice, this list of conditions and the following disclaimer. 00011 00012 - Redistributions in binary form must reproduce the above copyright 00013 notice, this list of conditions and the following disclaimer in the 00014 documentation and/or other materials provided with the distribution. 00015 00016 - Neither the name of the Xiph.org Foundation nor the names of its 00017 contributors may be used to endorse or promote products derived from 00018 this software without specific prior written permission. 00019 00020 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00021 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00022 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00023 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 00024 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00025 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00026 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00027 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00028 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00029 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00030 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00031 */ 00032 00033 #include <speex/speex_bits.h> 00034 00035 00036 typedef struct ltp_params { 00037 signed char *gain_cdbk; 00038 int gain_bits; 00039 int pitch_bits; 00040 } ltp_params; 00041 00042 00043 void open_loop_nbest_pitch(float *sw, int start, int end, int len, int *pitch, float *gain, int N, char *stack); 00044 00045 00047 int pitch_search_3tap( 00048 float target[], /* Target vector */ 00049 float *sw, 00050 float ak[], /* LPCs for this subframe */ 00051 float awk1[], /* Weighted LPCs #1 for this subframe */ 00052 float awk2[], /* Weighted LPCs #2 for this subframe */ 00053 float exc[], /* Overlapping codebook */ 00054 void *par, 00055 int start, /* Smallest pitch value allowed */ 00056 int end, /* Largest pitch value allowed */ 00057 float pitch_coef, /* Voicing (pitch) coefficient */ 00058 int p, /* Number of LPC coeffs */ 00059 int nsf, /* Number of samples in subframe */ 00060 SpeexBits *bits, 00061 char *stack, 00062 float *exc2, 00063 float *r, 00064 int complexity 00065 ); 00066 00067 /*Unquantize adaptive codebook and update pitch contribution*/ 00068 void pitch_unquant_3tap( 00069 float exc[], /* Excitation */ 00070 int start, /* Smallest pitch value allowed */ 00071 int end, /* Largest pitch value allowed */ 00072 float pitch_coef, /* Voicing (pitch) coefficient */ 00073 void *par, 00074 int nsf, /* Number of samples in subframe */ 00075 int *pitch_val, 00076 float *gain_val, 00077 SpeexBits *bits, 00078 char *stack, 00079 int lost, 00080 int subframe_offset, 00081 float last_pitch_gain 00082 ); 00083 00084 float pitch_gain_search_3tap( 00085 float target[], /* Target vector */ 00086 float ak[], /* LPCs for this subframe */ 00087 float awk1[], /* Weighted LPCs #1 for this subframe */ 00088 float awk2[], /* Weighted LPCs #2 for this subframe */ 00089 float exc[], /* Excitation */ 00090 void *par, 00091 int pitch, /* Pitch value */ 00092 int p, /* Number of LPC coeffs */ 00093 int nsf, /* Number of samples in subframe */ 00094 SpeexBits *bits, 00095 char *stack, 00096 float *exc2, 00097 float *r, 00098 int *cdbk_index 00099 ); 00100 00101 00103 int forced_pitch_quant( 00104 float target[], /* Target vector */ 00105 float *sw, 00106 float ak[], /* LPCs for this subframe */ 00107 float awk1[], /* Weighted LPCs #1 for this subframe */ 00108 float awk2[], /* Weighted LPCs #2 for this subframe */ 00109 float exc[], /* Excitation */ 00110 void *par, 00111 int start, /* Smallest pitch value allowed */ 00112 int end, /* Largest pitch value allowed */ 00113 float pitch_coef, /* Voicing (pitch) coefficient */ 00114 int p, /* Number of LPC coeffs */ 00115 int nsf, /* Number of samples in subframe */ 00116 SpeexBits *bits, 00117 char *stack, 00118 float *exc2, 00119 float *r, 00120 int complexity 00121 ); 00122 00124 void forced_pitch_unquant( 00125 float exc[], /* Excitation */ 00126 int start, /* Smallest pitch value allowed */ 00127 int end, /* Largest pitch value allowed */ 00128 float pitch_coef, /* Voicing (pitch) coefficient */ 00129 void *par, 00130 int nsf, /* Number of samples in subframe */ 00131 int *pitch_val, 00132 float *gain_val, 00133 SpeexBits *bits, 00134 char *stack, 00135 int lost, 00136 int subframe_offset, 00137 float last_pitch_gain 00138 );

Generated on Thu Aug 12 11:24:53 2004 for speex by doxygen 1.3.8