Mercurial > hg > audiostuff
comparison spandsp-0.0.6pre17/src/spandsp/private/g726.h @ 4:26cd8f1ef0b1
import spandsp-0.0.6pre17
author | Peter Meerwald <pmeerw@cosy.sbg.ac.at> |
---|---|
date | Fri, 25 Jun 2010 15:50:58 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
3:c6c5a16ce2f2 | 4:26cd8f1ef0b1 |
---|---|
1 /* | |
2 * SpanDSP - a series of DSP components for telephony | |
3 * | |
4 * private/g726.h - ITU G.726 codec. | |
5 * | |
6 * Written by Steve Underwood <steveu@coppice.org> | |
7 * | |
8 * Copyright (C) 2006 Steve Underwood | |
9 * | |
10 * All rights reserved. | |
11 * | |
12 * This program is free software; you can redistribute it and/or modify | |
13 * it under the terms of the GNU Lesser General Public License version 2.1, | |
14 * as published by the Free Software Foundation. | |
15 * | |
16 * This program is distributed in the hope that it will be useful, | |
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 * GNU Lesser General Public License for more details. | |
20 * | |
21 * You should have received a copy of the GNU Lesser General Public | |
22 * License along with this program; if not, write to the Free Software | |
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
24 * | |
25 * $Id: g726.h,v 1.4 2009/04/12 09:12:11 steveu Exp $ | |
26 */ | |
27 | |
28 #if !defined(_SPANDSP_PRIVATE_G726_H_) | |
29 #define _SPANDSP_PRIVATE_G726_H_ | |
30 | |
31 /*! | |
32 * The following is the definition of the state structure | |
33 * used by the G.726 encoder and decoder to preserve their internal | |
34 * state between successive calls. The meanings of the majority | |
35 * of the state structure fields are explained in detail in the | |
36 * ITU Recommendation G.726. The field names are essentially indentical | |
37 * to variable names in the bit level description of the coding algorithm | |
38 * included in this recommendation. | |
39 */ | |
40 struct g726_state_s | |
41 { | |
42 /*! The bit rate */ | |
43 int rate; | |
44 /*! The external coding, for tandem operation */ | |
45 int ext_coding; | |
46 /*! The number of bits per sample */ | |
47 int bits_per_sample; | |
48 /*! One of the G.726_PACKING_xxx options */ | |
49 int packing; | |
50 | |
51 /*! Locked or steady state step size multiplier. */ | |
52 int32_t yl; | |
53 /*! Unlocked or non-steady state step size multiplier. */ | |
54 int16_t yu; | |
55 /*! int16_t term energy estimate. */ | |
56 int16_t dms; | |
57 /*! Long term energy estimate. */ | |
58 int16_t dml; | |
59 /*! Linear weighting coefficient of 'yl' and 'yu'. */ | |
60 int16_t ap; | |
61 | |
62 /*! Coefficients of pole portion of prediction filter. */ | |
63 int16_t a[2]; | |
64 /*! Coefficients of zero portion of prediction filter. */ | |
65 int16_t b[6]; | |
66 /*! Signs of previous two samples of a partially reconstructed signal. */ | |
67 int16_t pk[2]; | |
68 /*! Previous 6 samples of the quantized difference signal represented in | |
69 an internal floating point format. */ | |
70 int16_t dq[6]; | |
71 /*! Previous 2 samples of the quantized difference signal represented in an | |
72 internal floating point format. */ | |
73 int16_t sr[2]; | |
74 /*! Delayed tone detect */ | |
75 int td; | |
76 | |
77 /*! \brief The bit stream processing context. */ | |
78 bitstream_state_t bs; | |
79 | |
80 /*! \brief The current encoder function. */ | |
81 g726_encoder_func_t enc_func; | |
82 /*! \brief The current decoder function. */ | |
83 g726_decoder_func_t dec_func; | |
84 }; | |
85 | |
86 #endif | |
87 /*- End of file ------------------------------------------------------------*/ |