spandsp  0.0.6
private/ima_adpcm.h
1 /*
2  * SpanDSP - a series of DSP components for telephony
3  *
4  * private/ima_adpcm.c - Conversion routines between linear 16 bit PCM data
5  * and IMA/DVI/Intel ADPCM format.
6  *
7  * Written by Steve Underwood <steveu@coppice.org>
8  *
9  * Copyright (C) 2004 Steve Underwood
10  *
11  * All rights reserved.
12  *
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU Lesser General Public License version 2.1,
15  * as published by the Free Software Foundation.
16  *
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 Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public
23  * License along with this program; if not, write to the Free Software
24  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25  *
26  * Based on a bit from here, a bit from there, eye of toad,
27  * ear of bat, etc - plus, of course, my own 2 cents.
28  */
29 
30 #if !defined(_SPANDSP_PRIVATE_IMA_ADPCM_H_)
31 #define _SPANDSP_PRIVATE_IMA_ADPCM_H_
32 
33 /*!
34  IMA (DVI/Intel) ADPCM conversion state descriptor. This defines the state of
35  a single working instance of the IMA ADPCM converter. This is used for
36  either linear to ADPCM or ADPCM to linear conversion.
37 */
39 {
40  int variant;
41  /*! \brief The size of a chunk, in samples. */
43  /*! \brief The last state of the ADPCM algorithm. */
44  int last;
45  /*! \brief Current index into the step size table. */
47  /*! \brief The current IMA code byte in progress. */
48  uint16_t ima_byte;
49  int bits;
50 };
51 
52 #endif
53 /*- End of file ------------------------------------------------------------*/
int last
The last state of the ADPCM algorithm.
Definition: private/ima_adpcm.h:44
int chunk_size
The size of a chunk, in samples.
Definition: private/ima_adpcm.h:42
Definition: private/ima_adpcm.h:38
int step_index
Current index into the step size table.
Definition: private/ima_adpcm.h:46
uint16_t ima_byte
The current IMA code byte in progress.
Definition: private/ima_adpcm.h:48