* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
- * Remi Denis-Courmont <rem # videolan.org>
+ * Rémi Denis-Courmont <rem # videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Documentation: http://www.pcisys.net/~melanson/codecs/adpcm.txt
*****************************************************************************/
#include <vlc/vlc.h>
-#include <vlc/decoder.h>
+#include <vlc_aout.h>
+#include <vlc_codec.h>
/*****************************************************************************
* Module descriptor
static void DecodeAdpcmDk3 ( decoder_t *, int16_t *, uint8_t * );
static void DecodeAdpcmEA ( decoder_t *, int16_t *, uint8_t * );
-static int pi_channels_maps[6] =
+static const int pi_channels_maps[6] =
{
0,
AOUT_CHAN_CENTER,
};
/* Various table from http://www.pcisys.net/~melanson/codecs/adpcm.txt */
-static int i_index_table[16] =
+static const int i_index_table[16] =
{
-1, -1, -1, -1, 2, 4, 6, 8,
-1, -1, -1, -1, 2, 4, 6, 8
};
-static int i_step_table[89] =
+static const int i_step_table[89] =
{
7, 8, 9, 10, 11, 12, 13, 14, 16, 17,
19, 21, 23, 25, 28, 31, 34, 37, 41, 45,
15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767
};
-static int i_adaptation_table[16] =
+static const int i_adaptation_table[16] =
{
230, 230, 230, 230, 307, 409, 512, 614,
768, 614, 512, 409, 307, 230, 230, 230
};
-static int i_adaptation_coeff1[7] =
+static const int i_adaptation_coeff1[7] =
{
256, 512, 0, 192, 240, 460, 392
};
-static int i_adaptation_coeff2[7] =
+static const int i_adaptation_coeff2[7] =
{
0, -256, 0, 64, 0, -208, -232
};
if( p_dec->fmt_in.audio.i_channels <= 0 ||
p_dec->fmt_in.audio.i_channels > 5 )
{
- msg_Err( p_dec, "bad channels count(1-5)" );
+ msg_Err( p_dec, "invalid number of channel (not between 1 and 5): %i",
+ p_dec->fmt_in.audio.i_channels );
return VLC_EGENERIC;
}
p_dec->fmt_in.audio.i_channels;
}
- msg_Dbg( p_dec, "format: samplerate:%dHz channels:%d bits/sample:%d "
+ msg_Dbg( p_dec, "format: samplerate:%d Hz channels:%d bits/sample:%d "
"blockalign:%d samplesperblock:%d",
p_dec->fmt_in.audio.i_rate, p_dec->fmt_in.audio.i_channels,
p_dec->fmt_in.audio.i_bitspersample, p_sys->i_block,