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

sb_celp.h

Go to the documentation of this file.
00001 /* Copyright (C) 2002 Jean-Marc Valin */ 00006 /* 00007 Redistribution and use in source and binary forms, with or without 00008 modification, are permitted provided that the following conditions 00009 are met: 00010 00011 - Redistributions of source code must retain the above copyright 00012 notice, this list of conditions and the following disclaimer. 00013 00014 - Redistributions in binary form must reproduce the above copyright 00015 notice, this list of conditions and the following disclaimer in the 00016 documentation and/or other materials provided with the distribution. 00017 00018 - Neither the name of the Xiph.org Foundation nor the names of its 00019 contributors may be used to endorse or promote products derived from 00020 this software without specific prior written permission. 00021 00022 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00023 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00024 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00025 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 00026 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00027 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00028 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00029 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00030 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00031 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00032 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00033 00034 */ 00035 00036 #ifndef SB_CELP_H 00037 #define SB_CELP_H 00038 00039 #include "modes.h" 00040 #include <speex/speex_bits.h> 00041 #include "nb_celp.h" 00042 00044 typedef struct SBEncState { 00045 const SpeexMode *mode; 00046 void *st_low; 00047 int full_frame_size; 00048 int frame_size; 00049 int subframeSize; 00050 int nbSubframes; 00051 int windowSize; 00052 int lpcSize; 00053 int bufSize; 00054 int first; 00055 float lag_factor; 00056 float lpc_floor; 00057 spx_word16_t gamma1; 00058 spx_word16_t gamma2; 00060 char *stack; 00061 spx_sig_t *x0d, *x1d; 00062 spx_sig_t *high; 00063 spx_sig_t *y0, *y1; 00064 spx_word16_t *h0_mem, *h1_mem; 00065 spx_word32_t *g0_mem, *g1_mem; 00067 spx_sig_t *excBuf; 00068 spx_sig_t *exc; 00069 spx_sig_t *buf; 00070 spx_sig_t *res; 00071 spx_sig_t *sw; 00072 spx_sig_t *target; 00073 spx_word16_t *window; 00074 spx_word16_t *lagWindow; 00075 spx_word16_t *autocorr; 00076 spx_coef_t *lpc; 00077 spx_lsp_t *lsp; 00078 spx_lsp_t *qlsp; 00079 spx_lsp_t *old_lsp; 00080 spx_lsp_t *old_qlsp; 00081 spx_lsp_t *interp_lsp; 00082 spx_lsp_t *interp_qlsp; 00083 spx_coef_t *interp_lpc; 00084 spx_coef_t *interp_qlpc; 00085 spx_coef_t *bw_lpc1; 00086 spx_coef_t *bw_lpc2; 00088 spx_mem_t *mem_sp; 00089 spx_mem_t *mem_sp2; 00090 spx_mem_t *mem_sw; 00091 spx_word32_t *pi_gain; 00092 00093 float vbr_quality; 00094 int vbr_enabled; 00095 int abr_enabled; 00096 float abr_drift; 00097 float abr_drift2; 00098 float abr_count; 00099 int vad_enabled; 00100 float relative_quality; 00101 00102 int encode_submode; 00103 const SpeexSubmode * const *submodes; 00104 int submodeID; 00105 int submodeSelect; 00106 int complexity; 00107 int sampling_rate; 00108 00109 } SBEncState; 00110 00111 00113 typedef struct SBDecState { 00114 const SpeexMode *mode; 00115 void *st_low; 00116 int full_frame_size; 00117 int frame_size; 00118 int subframeSize; 00119 int nbSubframes; 00120 int lpcSize; 00121 int first; 00122 int sampling_rate; 00123 int lpc_enh_enabled; 00124 00125 char *stack; 00126 spx_sig_t *x0d, *x1d; 00127 spx_sig_t *high; 00128 spx_sig_t *y0, *y1; 00129 spx_word32_t *g0_mem, *g1_mem; 00130 00131 spx_sig_t *exc; 00132 spx_lsp_t *qlsp; 00133 spx_lsp_t *old_qlsp; 00134 spx_lsp_t *interp_qlsp; 00135 spx_coef_t *interp_qlpc; 00136 00137 spx_mem_t *mem_sp; 00138 spx_word32_t *pi_gain; 00139 00140 int encode_submode; 00141 const SpeexSubmode * const *submodes; 00142 int submodeID; 00143 } SBDecState; 00144 00145 00147 void *sb_encoder_init(const SpeexMode *m); 00148 00150 void sb_encoder_destroy(void *state); 00151 00153 int sb_encode(void *state, void *in, SpeexBits *bits); 00154 00155 00157 void *sb_decoder_init(const SpeexMode *m); 00158 00160 void sb_decoder_destroy(void *state); 00161 00163 int sb_decode(void *state, SpeexBits *bits, void *out); 00164 00165 int sb_encoder_ctl(void *state, int request, void *ptr); 00166 00167 int sb_decoder_ctl(void *state, int request, void *ptr); 00168 00169 #endif

Generated on Thu Aug 12 11:55:01 2004 for speex by doxygen 1.3.8