spandsp: g726.h Source File

spandsp 0.0.6

private/g726.h
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
26#if !defined(_SPANDSP_PRIVATE_G726_H_)
27#define _SPANDSP_PRIVATE_G726_H_
28
29/*!
30 * The following is the definition of the state structure
31 * used by the G.726 encoder and decoder to preserve their internal
32 * state between successive calls. The meanings of the majority
33 * of the state structure fields are explained in detail in the
34 * ITU Recommendation G.726. The field names are essentially indentical
35 * to variable names in the bit level description of the coding algorithm
36 * included in this recommendation.
37 */
38 struct g726_state_s
39{
40 /*! The bit rate */
41 int rate;
42 /*! The external coding, for tandem operation */
43 int ext_coding;
44 /*! The number of bits per sample */
45 int bits_per_sample;
46 /*! One of the G.726_PACKING_xxx options */
47 int packing;
48
49 /*! Locked or steady state step size multiplier. */
50 int32_t yl;
51 /*! Unlocked or non-steady state step size multiplier. */
52 int16_t yu;
53 /*! int16_t term energy estimate. */
54 int16_t dms;
55 /*! Long term energy estimate. */
56 int16_t dml;
57 /*! Linear weighting coefficient of 'yl' and 'yu'. */
58 int16_t ap;
59
60 /*! Coefficients of pole portion of prediction filter. */
61 int16_t a[2];
62 /*! Coefficients of zero portion of prediction filter. */
63 int16_t b[6];
64 /*! Signs of previous two samples of a partially reconstructed signal. */
65 int16_t pk[2];
66 /*! Previous 6 samples of the quantized difference signal represented in
67 an internal floating point format. */
68 int16_t dq[6];
69 /*! Previous 2 samples of the quantized difference signal represented in an
70 internal floating point format. */
71 int16_t sr[2];
72 /*! Delayed tone detect */
73 int td;
74
75 /*! \brief The bit stream processing context. */
76 bitstream_state_t bs;
77
78 /*! \brief The current encoder function. */
79 g726_encoder_func_t enc_func;
80 /*! \brief The current decoder function. */
81 g726_decoder_func_t dec_func;
82};
83
84#endif
85/*- End of file ------------------------------------------------------------*/
bitstream_state_s
Definition private/bitstream.h:31
g726_state_s
Definition private/g726.h:39
g726_state_s::yu
int16_t yu
Definition private/g726.h:52
g726_state_s::dq
int16_t dq[6]
Definition private/g726.h:68
g726_state_s::dms
int16_t dms
Definition private/g726.h:54
g726_state_s::ext_coding
int ext_coding
Definition private/g726.h:43
g726_state_s::bs
bitstream_state_t bs
The bit stream processing context.
Definition private/g726.h:76
g726_state_s::rate
int rate
Definition private/g726.h:41
g726_state_s::td
int td
Definition private/g726.h:73
g726_state_s::ap
int16_t ap
Definition private/g726.h:58
g726_state_s::enc_func
g726_encoder_func_t enc_func
The current encoder function.
Definition private/g726.h:79
g726_state_s::pk
int16_t pk[2]
Definition private/g726.h:65
g726_state_s::packing
int packing
Definition private/g726.h:47
g726_state_s::b
int16_t b[6]
Definition private/g726.h:63
g726_state_s::yl
int32_t yl
Definition private/g726.h:50
g726_state_s::bits_per_sample
int bits_per_sample
Definition private/g726.h:45
g726_state_s::sr
int16_t sr[2]
Definition private/g726.h:71
g726_state_s::dml
int16_t dml
Definition private/g726.h:56
g726_state_s::dec_func
g726_decoder_func_t dec_func
The current decoder function.
Definition private/g726.h:81
g726_state_s::a
int16_t a[2]
Definition private/g726.h:61