2
* SpanDSP - a series of DSP components for telephony
4
* lpc10.h - LPC10 low bit rate speech codec.
6
* Written by Steve Underwood <steveu@coppice.org>
8
* Copyright (C) 2006 Steve Underwood
10
* All rights reserved.
12
* This program is free software; you can redistribute it and/or modify
13
* it under the terms of the GNU General Public License as published by
14
* the Free Software Foundation; either version 2 of the License, or
15
* (at your option) any later version.
17
* This program is distributed in the hope that it will be useful,
18
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
* GNU General Public License for more details.
22
* You should have received a copy of the GNU General Public License
23
* along with this program; if not, write to the Free Software
24
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26
* $Id: lpc10.h,v 1.2 2006/09/14 12:16:41 steveu Exp $
29
#if !defined(_LPC10_H_)
32
/*! \page lpc10_page LPC10 encoding and decoding
33
\section lpc10_page_sec_1 What does it do?
35
\section lpc10_page_sec_2 How does it work?
39
#define LPC10_SAMPLES_PER_FRAME 180
40
#define LPC10_BITS_IN_COMPRESSED_FRAME 54
43
LPC10 codec encoder state descriptor. This defines the state of
44
a single working instance of the LPC10 encoder.
50
/* State used only by function hp100 */
56
/* State used by function analys */
57
float inbuf[LPC10_SAMPLES_PER_FRAME*3];
58
float pebuf[LPC10_SAMPLES_PER_FRAME*3];
62
int32_t osbuf[10]; /* no initial value necessary */
63
int32_t osptr; /* initial value 1 */
65
int32_t vwin[6]; /* was [2][3] */ /* initial value vwin[4] = 307; vwin[5] = 462; */
66
int32_t awin[6]; /* was [2][3] */ /* initial value awin[4] = 307; awin[5] = 462; */
67
int32_t voibuf[8]; /* was [2][4] */
69
float rcbuf[30]; /* was [10][3] */
73
/* State used by function onset */
75
float d__; /* initial value 1.0f */
76
float fpc; /* no initial value necessary */
79
int32_t l2ptr1; /* initial value 1 */
80
int32_t l2ptr2; /* initial value 9 */
81
int32_t lasti; /* no initial value necessary */
82
int hyst; /* initial value FALSE */
84
/* State used by function voicin */
85
float dither; /* initial value 20.0f */
88
float voice[6] /* was [2][3] */; /* initial value is probably unnecessary */
98
/* State used by function dyptrk */
100
int32_t p[120] /* was [60][2] */;
104
/* State used by function chanwr */
106
} lpc10_encode_state_t;
109
LPC10 codec deocder state descriptor. This defines the state of
110
a single working instance of the LPC10 decoder.
114
int error_correction;
116
/* State used by function decode */
117
int32_t iptold; /* initial value 60 */
118
int first; /* initial value TRUE */
121
int32_t iavgp; /* initial value 60 */
127
/* State used by function synths */
128
float buf[LPC10_SAMPLES_PER_FRAME*2];
129
int32_t buflen; /* initial value LPC10_SAMPLES_PER_FRAME */
131
/* State used by function pitsyn */
132
int32_t ivoico; /* no initial value necessary as long as first_pitsyn is initially TRUE_ */
133
int32_t ipito; /* no initial value necessary as long as first_pitsyn is initially TRUE_ */
134
float rmso; /* initial value 1.0f */
135
float rco[10]; /* no initial value necessary as long as first_pitsyn is initially TRUE_ */
136
int32_t jsamp; /* no initial value necessary as long as first_pitsyn is initially TRUE_ */
137
int first_pitsyn; /* initial value TRUE_ */
139
/* State used by function bsynz */
147
/* State used by function random */
152
/* State used by function deemp */
155
} lpc10_decode_state_t;
161
lpc10_encode_state_t *lpc10_encode_init(lpc10_encode_state_t *s, int error_correction);
162
int lpc10_encode_release(lpc10_encode_state_t *s);
163
int lpc10_encode(lpc10_encode_state_t *s, uint8_t code[], const int16_t amp[], int quant);
165
lpc10_decode_state_t *lpc10_decode_init(lpc10_decode_state_t *st, int error_correction);
166
int lpc10_decode_release(lpc10_decode_state_t *s);
167
int lpc10_decode(lpc10_decode_state_t *s, int16_t amp[], const uint8_t code[], int quant);
175
/*- End of include ---------------------------------------------------------*/