00001 /* 00002 * SpanDSP - a series of DSP components for telephony 00003 * 00004 * private/lpc10.h - LPC10 low bit rate speech codec. 00005 * 00006 * Written by Steve Underwood <steveu@coppice.org> 00007 * 00008 * Copyright (C) 2006 Steve Underwood 00009 * 00010 * All rights reserved. 00011 * 00012 * This program is free software; you can redistribute it and/or modify 00013 * it under the terms of the GNU Lesser General Public License version 2.1, 00014 * as published by the Free Software Foundation. 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU Lesser General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU Lesser General Public 00022 * License along with this program; if not, write to the Free Software 00023 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00024 * 00025 * $Id: lpc10.h,v 1.3 2009/04/12 09:12:11 steveu Exp $ 00026 */ 00027 00028 #if !defined(_SPANDSP_PRIVATE_LPC10_H_) 00029 #define _SPANDSP_PRIVATE_LPC10_H_ 00030 00031 /*! 00032 LPC10 codec encoder state descriptor. This defines the state of 00033 a single working instance of the LPC10 encoder. 00034 */ 00035 struct lpc10_encode_state_s 00036 { 00037 /*! \brief ??? */ 00038 int error_correction; 00039 00040 /* State used only by function high_pass_100hz */ 00041 /*! \brief ??? */ 00042 float z11; 00043 /*! \brief ??? */ 00044 float z21; 00045 /*! \brief ??? */ 00046 float z12; 00047 /*! \brief ??? */ 00048 float z22; 00049 00050 /* State used by function lpc10_analyse */ 00051 /*! \brief ??? */ 00052 float inbuf[LPC10_SAMPLES_PER_FRAME*3]; 00053 /*! \brief ??? */ 00054 float pebuf[LPC10_SAMPLES_PER_FRAME*3]; 00055 /*! \brief ??? */ 00056 float lpbuf[696]; 00057 /*! \brief ??? */ 00058 float ivbuf[312]; 00059 /*! \brief ??? */ 00060 float bias; 00061 /*! \brief No initial value necessary */ 00062 int32_t osbuf[10]; 00063 /*! \brief Initial value 1 */ 00064 int32_t osptr; 00065 /*! \brief ??? */ 00066 int32_t obound[3]; 00067 /*! \brief Initial value vwin[2][0] = 307; vwin[2][1] = 462; */ 00068 int32_t vwin[3][2]; 00069 /*! \brief Initial value awin[2][0] = 307; awin[2][1] = 462; */ 00070 int32_t awin[3][2]; 00071 /*! \brief ??? */ 00072 int32_t voibuf[4][2]; 00073 /*! \brief ??? */ 00074 float rmsbuf[3]; 00075 /*! \brief ??? */ 00076 float rcbuf[3][10]; 00077 /*! \brief ??? */ 00078 float zpre; 00079 00080 /* State used by function onset */ 00081 /*! \brief ??? */ 00082 float n; 00083 /*! \brief Initial value 1.0f */ 00084 float d__; 00085 /*! \brief No initial value necessary */ 00086 float fpc; 00087 /*! \brief ??? */ 00088 float l2buf[16]; 00089 /*! \brief ??? */ 00090 float l2sum1; 00091 /*! \brief Initial value 1 */ 00092 int32_t l2ptr1; 00093 /*! \brief Initial value 9 */ 00094 int32_t l2ptr2; 00095 /*! \brief No initial value necessary */ 00096 int32_t lasti; 00097 /*! \brief Initial value FALSE */ 00098 int hyst; 00099 00100 /* State used by function lpc10_voicing */ 00101 /*! \brief Initial value 20.0f */ 00102 float dither; 00103 /*! \brief ??? */ 00104 float snr; 00105 /*! \brief ??? */ 00106 float maxmin; 00107 /*! \brief Initial value is probably unnecessary */ 00108 float voice[3][2]; 00109 /*! \brief ??? */ 00110 int32_t lbve; 00111 /*! \brief ??? */ 00112 int32_t lbue; 00113 /*! \brief ??? */ 00114 int32_t fbve; 00115 /*! \brief ??? */ 00116 int32_t fbue; 00117 /*! \brief ??? */ 00118 int32_t ofbue; 00119 /*! \brief ??? */ 00120 int32_t sfbue; 00121 /*! \brief ??? */ 00122 int32_t olbue; 00123 /*! \brief ??? */ 00124 int32_t slbue; 00125 00126 /* State used by function dynamic_pitch_tracking */ 00127 /*! \brief ??? */ 00128 float s[60]; 00129 /*! \brief ??? */ 00130 int32_t p[2][60]; 00131 /*! \brief ??? */ 00132 int32_t ipoint; 00133 /*! \brief ??? */ 00134 float alphax; 00135 00136 /* State used by function lpc10_pack */ 00137 /*! \brief ??? */ 00138 int32_t isync; 00139 }; 00140 00141 /*! 00142 LPC10 codec decoder state descriptor. This defines the state of 00143 a single working instance of the LPC10 decoder. 00144 */ 00145 struct lpc10_decode_state_s 00146 { 00147 /*! \brief ??? */ 00148 int error_correction; 00149 00150 /* State used by function decode */ 00151 /*! \brief Initial value 60 */ 00152 int32_t iptold; 00153 /*! \brief Initial value TRUE */ 00154 int first; 00155 /*! \brief ??? */ 00156 int32_t ivp2h; 00157 /*! \brief ??? */ 00158 int32_t iovoic; 00159 /*! \brief Initial value 60. */ 00160 int32_t iavgp; 00161 /*! \brief ??? */ 00162 int32_t erate; 00163 /*! \brief ??? */ 00164 int32_t drc[10][3]; 00165 /*! \brief ??? */ 00166 int32_t dpit[3]; 00167 /*! \brief ??? */ 00168 int32_t drms[3]; 00169 00170 /* State used by function synths */ 00171 /*! \brief ??? */ 00172 float buf[LPC10_SAMPLES_PER_FRAME*2]; 00173 /*! \brief Initial value LPC10_SAMPLES_PER_FRAME */ 00174 int32_t buflen; 00175 00176 /* State used by function pitsyn */ 00177 /*! \brief No initial value necessary as long as first_pitsyn is initially TRUE */ 00178 int32_t ivoico; 00179 /*! \brief No initial value necessary as long as first_pitsyn is initially TRUE */ 00180 int32_t ipito; 00181 /*! \brief Initial value 1.0f */ 00182 float rmso; 00183 /*! \brief No initial value necessary as long as first_pitsyn is initially TRUE */ 00184 float rco[10]; 00185 /*! \brief No initial value necessary as long as first_pitsyn is initially TRUE */ 00186 int32_t jsamp; 00187 /*! \brief Initial value TRUE */ 00188 int first_pitsyn; 00189 00190 /* State used by function bsynz */ 00191 /*! \brief ??? */ 00192 int32_t ipo; 00193 /*! \brief ??? */ 00194 float exc[166]; 00195 /*! \brief ??? */ 00196 float exc2[166]; 00197 /*! \brief ??? */ 00198 float lpi[3]; 00199 /*! \brief ??? */ 00200 float hpi[3]; 00201 /*! \brief ??? */ 00202 float rmso_bsynz; 00203 00204 /* State used by function random */ 00205 /*! \brief ??? */ 00206 int32_t j; 00207 /*! \brief ??? */ 00208 int32_t k; 00209 /*! \brief ??? */ 00210 int16_t y[5]; 00211 00212 /* State used by function deemp */ 00213 /*! \brief ??? */ 00214 float dei[2]; 00215 /*! \brief ??? */ 00216 float deo[3]; 00217 }; 00218 00219 #endif 00220 /*- End of include ---------------------------------------------------------*/