spandsp
0.0.6
|
00001 /* 00002 * SpanDSP - a series of DSP components for telephony 00003 * 00004 * private/ima_adpcm.c - Conversion routines between linear 16 bit PCM data 00005 * and IMA/DVI/Intel ADPCM format. 00006 * 00007 * Written by Steve Underwood <steveu@coppice.org> 00008 * 00009 * Copyright (C) 2004 Steve Underwood 00010 * 00011 * All rights reserved. 00012 * 00013 * This program is free software; you can redistribute it and/or modify 00014 * it under the terms of the GNU Lesser General Public License version 2.1, 00015 * as published by the Free Software Foundation. 00016 * 00017 * This program is distributed in the hope that it will be useful, 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 * GNU Lesser General Public License for more details. 00021 * 00022 * You should have received a copy of the GNU Lesser General Public 00023 * License along with this program; if not, write to the Free Software 00024 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00025 * 00026 * Based on a bit from here, a bit from there, eye of toad, 00027 * ear of bat, etc - plus, of course, my own 2 cents. 00028 */ 00029 00030 #if !defined(_SPANDSP_PRIVATE_IMA_ADPCM_H_) 00031 #define _SPANDSP_PRIVATE_IMA_ADPCM_H_ 00032 00033 /*! 00034 IMA (DVI/Intel) ADPCM conversion state descriptor. This defines the state of 00035 a single working instance of the IMA ADPCM converter. This is used for 00036 either linear to ADPCM or ADPCM to linear conversion. 00037 */ 00038 struct ima_adpcm_state_s 00039 { 00040 int variant; 00041 /*! \brief The size of a chunk, in samples. */ 00042 int chunk_size; 00043 /*! \brief The last state of the ADPCM algorithm. */ 00044 int last; 00045 /*! \brief Current index into the step size table. */ 00046 int step_index; 00047 /*! \brief The current IMA code byte in progress. */ 00048 uint16_t ima_byte; 00049 int bits; 00050 }; 00051 00052 #endif 00053 /*- End of file ------------------------------------------------------------*/