2
** Copyright (c) 2007 <robs@users.sourceforge.net>
3
** Copyright (C) 2007-2009 Erik de Castro Lopo <erikd@mega-nerd.com>
5
** This library is free software; you can redistribute it and/or modify it
6
** under the terms of the GNU Lesser General Public License as published by
7
** the Free Software Foundation; either version 2 of the License, or (at
8
** your option) any later version.
10
** This library is distributed in the hope that it will be useful, but
11
** WITHOUT ANY WARRANTY; without even the implied warranty of
12
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
13
** General Public License for more details.
15
** You should have received a copy of the GNU Lesser General Public License
16
** along with this library. If not, write to the Free Software Foundation,
17
** Fifth Floor, 51 Franklin Street, Boston, MA 02111-1301, USA.
20
/* ADPCM: IMA, OKI <==> 16-bit PCM. */
23
#define IMA_OKI_ADPCM_CODE_LEN 256
24
#define IMA_OKI_ADPCM_PCM_LEN (IMA_OKI_ADPCM_CODE_LEN *2)
37
int code_count, pcm_count ;
39
unsigned char codes [IMA_OKI_ADPCM_CODE_LEN] ;
40
short pcm [IMA_OKI_ADPCM_PCM_LEN] ;
44
{ IMA_OKI_ADPCM_TYPE_IMA,
45
IMA_OKI_ADPCM_TYPE_OKI
46
} IMA_OKI_ADPCM_TYPE ;
48
void ima_oki_adpcm_init (IMA_OKI_ADPCM * state, IMA_OKI_ADPCM_TYPE type) ;
50
int adpcm_decode (IMA_OKI_ADPCM * state, int /* 0..15 */ code) ;
51
int adpcm_encode (IMA_OKI_ADPCM * state, int /* -32768..32767 */ sample) ;
53
void ima_oki_adpcm_decode_block (IMA_OKI_ADPCM * state) ;
54
void ima_oki_adpcm_encode_block (IMA_OKI_ADPCM * state) ;