Main Page | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

private/lpc10.h

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.1 2008/11/30 05:43:37 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     int error_correction;
00038 
00039     /* State used only by function high_pass_100hz */
00040     float z11;
00041     float z21;
00042     float z12;
00043     float z22;
00044     
00045     /* State used by function lpc10_analyse */
00046     float inbuf[LPC10_SAMPLES_PER_FRAME*3];
00047     float pebuf[LPC10_SAMPLES_PER_FRAME*3];
00048     float lpbuf[696];
00049     float ivbuf[312];
00050     float bias;
00051     int32_t osbuf[10];      /* No initial value necessary */
00052     int32_t osptr;          /* Initial value 1 */
00053     int32_t obound[3];
00054     int32_t vwin[3][2];     /* Initial value vwin[2][0] = 307; vwin[2][1] = 462; */
00055     int32_t awin[3][2];     /* Initial value awin[2][0] = 307; awin[2][1] = 462; */
00056     int32_t voibuf[4][2];
00057     float rmsbuf[3];
00058     float rcbuf[3][10];
00059     float zpre;
00060 
00061     /* State used by function onset */
00062     float n;
00063     float d__;          /* Initial value 1.0f */
00064     float fpc;          /* No initial value necessary */
00065     float l2buf[16];
00066     float l2sum1;
00067     int32_t l2ptr1;     /* Initial value 1 */
00068     int32_t l2ptr2;     /* Initial value 9 */
00069     int32_t lasti;      /* No initial value necessary */
00070     int hyst;           /* Initial value FALSE */
00071 
00072     /* State used by function lpc10_voicing */
00073     float dither;       /* Initial value 20.0f */
00074     float snr;
00075     float maxmin;
00076     float voice[3][2];  /* Initial value is probably unnecessary */
00077     int32_t lbve;
00078     int32_t lbue;
00079     int32_t fbve;
00080     int32_t fbue;
00081     int32_t ofbue;
00082     int32_t sfbue;
00083     int32_t olbue;
00084     int32_t slbue;
00085 
00086     /* State used by function dynamic_pitch_tracking */
00087     float s[60];
00088     int32_t p[2][60];
00089     int32_t ipoint;
00090     float alphax;
00091 
00092     /* State used by function lpc10_pack */
00093     int32_t isync;
00094 };
00095 
00096 /*!
00097     LPC10 codec decoder state descriptor. This defines the state of
00098     a single working instance of the LPC10 decoder.
00099 */
00100 struct lpc10_decode_state_s
00101 {
00102     int error_correction;
00103 
00104     /* State used by function decode */
00105     int32_t iptold;     /* Initial value 60 */
00106     int first;          /* Initial value TRUE */
00107     int32_t ivp2h;
00108     int32_t iovoic;
00109     int32_t iavgp;      /* Initial value 60 */
00110     int32_t erate;
00111     int32_t drc[10][3];
00112     int32_t dpit[3];
00113     int32_t drms[3];
00114 
00115     /* State used by function synths */
00116     float buf[LPC10_SAMPLES_PER_FRAME*2];
00117     int32_t buflen;     /* Initial value LPC10_SAMPLES_PER_FRAME */
00118 
00119     /* State used by function pitsyn */
00120     int32_t ivoico;     /* No initial value necessary as long as first_pitsyn is initially TRUE_ */
00121     int32_t ipito;      /* No initial value necessary as long as first_pitsyn is initially TRUE_ */
00122     float rmso;         /* Initial value 1.0f */
00123     float rco[10];      /* No initial value necessary as long as first_pitsyn is initially TRUE_ */
00124     int32_t jsamp;      /* Nno initial value necessary as long as first_pitsyn is initially TRUE_ */
00125     int first_pitsyn;   /* Initial value TRUE */
00126 
00127     /* State used by function bsynz */
00128     int32_t ipo;
00129     float exc[166];
00130     float exc2[166];
00131     float lpi[3];
00132     float hpi[3];
00133     float rmso_bsynz;
00134 
00135     /* State used by function random */
00136     int32_t j;
00137     int32_t k;
00138     int16_t y[5];
00139 
00140     /* State used by function deemp */
00141     float dei[2];
00142     float deo[3];
00143 };
00144 
00145 #endif
00146 /*- End of include ---------------------------------------------------------*/

Generated on Fri Aug 28 20:12:26 2009 for spandsp by  doxygen 1.3.9.1