2008-05-06 05:35:37 +02:00
|
|
|
#ifndef _CODING_H
|
|
|
|
#define _CODING_H
|
|
|
|
|
|
|
|
#include "../vgmstream.h"
|
|
|
|
|
2017-01-08 01:09:20 +01:00
|
|
|
/* adx_decoder */
|
2008-05-06 05:35:37 +02:00
|
|
|
void decode_adx(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
2008-12-24 08:19:15 +01:00
|
|
|
void decode_adx_enc(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
|
|
|
void adx_next_key(VGMSTREAMCHANNEL * stream);
|
2008-05-06 05:35:37 +02:00
|
|
|
|
2017-01-08 01:09:20 +01:00
|
|
|
/* g721_decoder */
|
2008-05-06 05:35:37 +02:00
|
|
|
void decode_g721(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
|
|
|
void g72x_init_state(struct g72x_state *state_ptr);
|
|
|
|
|
2017-01-08 01:09:20 +01:00
|
|
|
/* ima_decoder */
|
2008-05-06 05:35:37 +02:00
|
|
|
void decode_nds_ima(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
2009-12-16 07:12:53 +01:00
|
|
|
void decode_dat4_ima(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
2008-09-21 16:58:50 +02:00
|
|
|
void decode_xbox_ima(VGMSTREAM * vgmstream,VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do,int channel);
|
2009-06-29 23:58:40 +02:00
|
|
|
void decode_int_xbox_ima(VGMSTREAM * vgmstream,VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do,int channel);
|
2008-07-02 03:41:20 +02:00
|
|
|
void decode_dvi_ima(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
2008-07-14 22:42:49 +02:00
|
|
|
void decode_eacs_ima(VGMSTREAM * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do, int channel);
|
2011-02-06 10:49:57 +01:00
|
|
|
void decode_snds_ima(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do, int channel);
|
2008-07-03 04:20:52 +02:00
|
|
|
void decode_ima(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
2009-09-12 06:51:39 +02:00
|
|
|
void decode_rad_ima(VGMSTREAM * vgmstream,VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do,int channel);
|
2010-04-10 14:06:25 +02:00
|
|
|
void decode_rad_ima_mono(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
2009-08-30 04:16:54 +02:00
|
|
|
void decode_apple_ima4(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
|
|
|
void decode_ms_ima(VGMSTREAM * vgmstream,VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do,int channel);
|
2017-01-25 20:25:39 +01:00
|
|
|
void decode_otns_ima(VGMSTREAM * vgmstream, VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do, int channel);
|
2017-02-04 23:17:56 +01:00
|
|
|
void decode_fsb_ima(VGMSTREAM * vgmstream, VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do, int channel);
|
2008-05-06 05:35:37 +02:00
|
|
|
|
2017-01-08 01:09:20 +01:00
|
|
|
/* ngc_dsp_decoder */
|
2008-05-06 05:35:37 +02:00
|
|
|
void decode_ngc_dsp(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
2008-07-14 15:30:26 +02:00
|
|
|
void decode_ngc_dsp_mem(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do, uint8_t * mem);
|
2017-04-07 16:23:43 +02:00
|
|
|
size_t dsp_bytes_to_samples(size_t bytes, int channels);
|
2008-05-06 05:35:37 +02:00
|
|
|
int32_t dsp_nibbles_to_samples(int32_t nibbles);
|
2017-01-13 23:56:48 +01:00
|
|
|
void dsp_read_coefs_be(VGMSTREAM * vgmstream, STREAMFILE *streamFile, off_t offset, off_t spacing);
|
2017-01-25 22:20:01 +01:00
|
|
|
void dsp_read_coefs_le(VGMSTREAM * vgmstream, STREAMFILE *streamFile, off_t offset, off_t spacing);
|
|
|
|
void dsp_read_coefs(VGMSTREAM * vgmstream, STREAMFILE *streamFile, off_t offset, off_t spacing, int be);
|
2008-05-06 05:35:37 +02:00
|
|
|
|
2017-01-08 01:09:20 +01:00
|
|
|
/* ngc_dtk_decoder */
|
2008-05-06 05:35:37 +02:00
|
|
|
void decode_ngc_dtk(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do, int channel);
|
|
|
|
|
2017-01-08 01:09:20 +01:00
|
|
|
/* ngc_afc_decoder */
|
|
|
|
void decode_ngc_afc(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
|
|
|
|
|
|
|
/* pcm_decoder */
|
2008-05-06 05:35:37 +02:00
|
|
|
void decode_pcm16LE(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
2008-07-14 22:42:49 +02:00
|
|
|
void decode_pcm16LE_int(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
2010-08-28 03:43:40 +02:00
|
|
|
void decode_pcm16LE_XOR_int(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
2008-05-06 05:35:37 +02:00
|
|
|
void decode_pcm16BE(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
|
|
|
void decode_pcm8(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
2008-07-14 22:42:49 +02:00
|
|
|
void decode_pcm8_int(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
2008-07-30 22:58:50 +02:00
|
|
|
void decode_pcm8_sb_int(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
2008-11-23 13:21:36 +01:00
|
|
|
void decode_pcm8_unsigned_int(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
2009-04-28 18:52:49 +02:00
|
|
|
void decode_pcm8_unsigned(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
2017-04-07 16:23:43 +02:00
|
|
|
size_t pcm_bytes_to_samples(size_t bytes, int channels, int bits_per_sample);
|
2008-05-06 05:35:37 +02:00
|
|
|
|
2017-01-08 01:09:20 +01:00
|
|
|
/* psx_decoder */
|
2008-05-06 05:35:37 +02:00
|
|
|
void decode_psx(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
2008-07-25 21:02:29 +02:00
|
|
|
void decode_psx_badflags(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
2017-01-08 01:09:20 +01:00
|
|
|
void decode_psx_bmdx(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
|
|
|
void decode_psx_configurable(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do, int frame_size);
|
|
|
|
void decode_hevag(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
2017-04-07 16:23:43 +02:00
|
|
|
size_t ps_bytes_to_samples(size_t bytes, int channels);
|
2008-07-25 21:02:29 +02:00
|
|
|
|
2017-01-08 01:09:20 +01:00
|
|
|
/* xa_decoder */
|
2008-07-14 22:42:49 +02:00
|
|
|
void decode_xa(VGMSTREAM * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do, int channel);
|
|
|
|
void init_get_high_nibble(VGMSTREAM * vgmstream);
|
2008-05-11 03:55:13 +02:00
|
|
|
|
2017-01-08 01:09:20 +01:00
|
|
|
/*eaxa_decoder */
|
|
|
|
void decode_ea_xa(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do,int channel);
|
2008-07-14 22:42:49 +02:00
|
|
|
void decode_ea_adpcm(VGMSTREAM * vgmstream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do, int channel);
|
2009-09-01 23:28:55 +02:00
|
|
|
void decode_maxis_adpcm(VGMSTREAM * vgmstream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do, int channel);
|
2008-06-02 19:58:08 +02:00
|
|
|
|
2017-01-08 01:09:20 +01:00
|
|
|
/* sdx2_decoder */
|
2008-07-01 05:23:44 +02:00
|
|
|
void decode_sdx2(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
2008-07-14 22:42:49 +02:00
|
|
|
void decode_sdx2_int(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
2017-01-08 01:09:20 +01:00
|
|
|
/* sdx2_decoder */
|
2010-07-27 14:24:03 +02:00
|
|
|
void decode_cbd2(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
|
|
|
void decode_cbd2_int(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
2008-07-01 05:23:44 +02:00
|
|
|
|
2017-01-08 01:09:20 +01:00
|
|
|
/* ws_decoder */
|
2008-07-04 02:06:51 +02:00
|
|
|
void decode_ws(VGMSTREAM * vgmstream, int channel, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
2008-07-03 23:21:01 +02:00
|
|
|
|
2017-01-08 01:09:20 +01:00
|
|
|
/* acm_decoder */
|
|
|
|
void decode_acm(ACMStream * acm, sample * outbuf, int32_t samples_to_do, int channelspacing);
|
|
|
|
|
|
|
|
/* nwa_decoder */
|
|
|
|
void decode_nwa(NWAData *nwa, sample *outbuf, int32_t samples_to_do);
|
|
|
|
|
|
|
|
/* msadpcm_decoder */
|
|
|
|
void decode_msadpcm_stereo(VGMSTREAM * vgmstream, sample * outbuf, int32_t first_sample, int32_t samples_to_do);
|
|
|
|
void decode_msadpcm_mono(VGMSTREAM * vgmstream, sample * outbuf, int32_t first_sample, int32_t samples_to_do);
|
2017-04-07 16:23:43 +02:00
|
|
|
long msadpcm_bytes_to_samples(long bytes, int block_size, int channels);
|
2017-01-08 01:09:20 +01:00
|
|
|
|
|
|
|
/* aica_decoder */
|
|
|
|
void decode_aica(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
|
|
|
|
|
|
|
/* nds_procyon_decoder */
|
|
|
|
void decode_nds_procyon(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
|
|
|
|
|
|
|
/* l5_555_decoder */
|
|
|
|
void decode_l5_555(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
|
|
|
|
|
|
|
/* SASSC_decoder */
|
|
|
|
void decode_SASSC(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
|
|
|
|
|
|
|
/* lsf_decode */
|
|
|
|
void decode_lsf(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
|
|
|
|
|
|
|
/* mtaf_decoder */
|
|
|
|
void decode_mtaf(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do, int channel, int channels);
|
|
|
|
|
|
|
|
/* hca_decoder */
|
|
|
|
void decode_hca(hca_codec_data * data, sample * outbuf, int32_t samples_to_do, int channels);
|
|
|
|
|
2017-03-25 14:57:44 +01:00
|
|
|
|
2017-01-08 01:09:20 +01:00
|
|
|
#ifdef VGM_USE_VORBIS
|
2017-03-25 14:57:44 +01:00
|
|
|
/* ogg_vorbis_decoder */
|
2017-01-08 01:09:20 +01:00
|
|
|
void decode_ogg_vorbis(ogg_vorbis_codec_data * data, sample * outbuf, int32_t samples_to_do, int channels);
|
2017-03-25 14:57:44 +01:00
|
|
|
|
|
|
|
/* fsb_vorbis_decoder */
|
|
|
|
vorbis_codec_data * init_fsb_vorbis_codec_data(STREAMFILE *streamfile, off_t start_offset, int channels, int sample_rate, uint32_t setup_id);
|
|
|
|
void decode_fsb_vorbis(VGMSTREAM * vgmstream, sample * outbuf, int32_t samples_to_do, int channels);
|
|
|
|
|
|
|
|
void free_fsb_vorbis(vorbis_codec_data *data);
|
|
|
|
void reset_fsb_vorbis(VGMSTREAM *vgmstream);
|
|
|
|
void seek_fsb_vorbis(VGMSTREAM *vgmstream, int32_t num_sample);
|
2017-01-08 01:09:20 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* mpeg_decoder */
|
2008-07-05 13:49:29 +02:00
|
|
|
#ifdef VGM_USE_MPEG
|
2017-02-19 21:16:09 +01:00
|
|
|
mpeg_codec_data *init_mpeg_codec_data(STREAMFILE *streamfile, off_t start_offset, coding_t *coding_type, int channels);
|
2017-02-19 20:20:13 +01:00
|
|
|
mpeg_codec_data *init_mpeg_codec_data_interleaved(STREAMFILE *streamfile, off_t start_offset, coding_t *coding_type, int channels, int fixed_frame_size, int fsb_padding);
|
2017-02-17 18:35:58 +01:00
|
|
|
mpeg_codec_data *init_mpeg_codec_data_ahx(STREAMFILE *streamFile, off_t start_offset, int channel_count);
|
2017-02-17 17:20:40 +01:00
|
|
|
|
2017-02-18 18:27:21 +01:00
|
|
|
void decode_mpeg(VGMSTREAM * vgmstream, sample * outbuf, int32_t samples_to_do, int channels);
|
2017-02-17 17:20:40 +01:00
|
|
|
void decode_fake_mpeg2_l2(VGMSTREAMCHANNEL * stream, mpeg_codec_data * data, sample * outbuf, int32_t samples_to_do);
|
|
|
|
|
|
|
|
void free_mpeg(mpeg_codec_data *data);
|
|
|
|
void reset_mpeg(VGMSTREAM *vgmstream);
|
|
|
|
void seek_mpeg(VGMSTREAM *vgmstream, int32_t num_sample);
|
|
|
|
|
2017-02-18 00:17:38 +01:00
|
|
|
long mpeg_bytes_to_samples(long bytes, const mpeg_codec_data *data);
|
2016-12-28 01:38:56 +01:00
|
|
|
void mpeg_set_error_logging(mpeg_codec_data * data, int enable);
|
2008-07-05 13:49:29 +02:00
|
|
|
#endif
|
|
|
|
|
2017-01-08 01:09:20 +01:00
|
|
|
/* g7221_decoder */
|
2010-03-21 05:23:18 +01:00
|
|
|
#ifdef VGM_USE_G7221
|
2017-01-08 01:09:20 +01:00
|
|
|
void decode_g7221(VGMSTREAM *vgmstream, sample * outbuf, int channelspacing, int32_t samples_to_do, int channel);
|
2010-03-21 05:23:18 +01:00
|
|
|
#endif
|
|
|
|
|
2017-01-08 01:09:20 +01:00
|
|
|
/* g719_decoder */
|
2015-01-25 06:08:25 +01:00
|
|
|
#ifdef VGM_USE_G719
|
2017-01-08 01:09:20 +01:00
|
|
|
void decode_g719(VGMSTREAM *vgmstream, sample * outbuf, int channelspacing, int32_t samples_to_do, int channel);
|
2015-01-25 06:08:25 +01:00
|
|
|
#endif
|
|
|
|
|
2017-01-08 01:09:20 +01:00
|
|
|
/* mp4_aac_decoder */
|
|
|
|
#if defined(VGM_USE_MP4V2) && defined(VGM_USE_FDKAAC)
|
|
|
|
void decode_mp4_aac(mp4_aac_codec_data * data, sample * outbuf, int32_t samples_to_do, int channels);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* at3_decoder */
|
2013-06-26 11:54:15 +02:00
|
|
|
#ifdef VGM_USE_MAIATRAC3PLUS
|
2017-01-08 01:09:20 +01:00
|
|
|
void decode_at3plus(VGMSTREAM *vgmstream, sample * outbuf, int channelspacing, int32_t samples_to_do, int channel);
|
2013-06-26 11:54:15 +02:00
|
|
|
#endif
|
|
|
|
|
2017-02-25 19:52:07 +01:00
|
|
|
|
2016-07-17 08:02:27 +02:00
|
|
|
#ifdef VGM_USE_FFMPEG
|
2017-02-25 19:52:07 +01:00
|
|
|
/* ffmpeg_decoder */
|
2016-12-01 19:58:51 +01:00
|
|
|
void decode_ffmpeg(VGMSTREAM *stream, sample * outbuf, int32_t samples_to_do, int channels);
|
|
|
|
void reset_ffmpeg(VGMSTREAM *vgmstream);
|
|
|
|
void seek_ffmpeg(VGMSTREAM *vgmstream, int32_t num_sample);
|
2017-01-13 23:47:52 +01:00
|
|
|
|
2017-02-12 13:17:01 +01:00
|
|
|
void ffmpeg_set_skip_samples(ffmpeg_codec_data * data, int skip_samples);
|
|
|
|
|
2017-02-25 19:52:07 +01:00
|
|
|
/* ffmpeg_decoder_utils */
|
2017-03-19 00:43:31 +01:00
|
|
|
int ffmpeg_fmt_chunk_swap_endian(uint8_t * chunk, size_t chunk_size, uint16_t codec);
|
2017-01-13 23:47:52 +01:00
|
|
|
int ffmpeg_make_riff_atrac3(uint8_t * buf, size_t buf_size, size_t sample_count, size_t data_size, int channels, int sample_rate, int block_align, int joint_stereo, int encoder_delay);
|
2017-03-09 19:13:05 +01:00
|
|
|
int ffmpeg_make_riff_atrac3plus(uint8_t * buf, size_t buf_size, size_t sample_count, size_t data_size, int channels, int sample_rate, int block_align, int encoder_delay);
|
2017-02-25 17:29:25 +01:00
|
|
|
int ffmpeg_make_riff_xma1(uint8_t * buf, size_t buf_size, size_t sample_count, size_t data_size, int channels, int sample_rate, int stream_mode);
|
2017-01-13 23:47:52 +01:00
|
|
|
int ffmpeg_make_riff_xma2(uint8_t * buf, size_t buf_size, size_t sample_count, size_t data_size, int channels, int sample_rate, int block_count, int block_size);
|
2017-03-19 00:43:31 +01:00
|
|
|
int ffmpeg_make_riff_xma_from_fmt(uint8_t * buf, size_t buf_size, off_t fmt_offset, size_t fmt_size, size_t data_size, STREAMFILE *streamFile, int big_endian);
|
2017-02-25 12:25:10 +01:00
|
|
|
int ffmpeg_make_riff_xwma(uint8_t * buf, size_t buf_size, int codec, size_t sample_count, size_t data_size, int channels, int sample_rate, int avg_bps, int block_align);
|
2017-02-25 19:52:07 +01:00
|
|
|
|
|
|
|
/* XMA sample parser info (struct to avoid passing so much stuff, separate for reusing) */
|
|
|
|
typedef struct {
|
|
|
|
int xma_version;
|
|
|
|
int channels;
|
|
|
|
int stream_mode;
|
|
|
|
off_t data_offset;
|
|
|
|
size_t data_size;
|
|
|
|
int loop_flag;
|
|
|
|
/* frame offsets */
|
|
|
|
uint32_t loop_start_b;
|
|
|
|
uint32_t loop_end_b;
|
|
|
|
uint32_t loop_start_subframe;
|
|
|
|
uint32_t loop_end_subframe;
|
|
|
|
|
|
|
|
/* output */
|
|
|
|
int32_t num_samples;
|
|
|
|
int32_t skip_samples;
|
|
|
|
int32_t loop_start_sample;
|
|
|
|
int32_t loop_end_sample;
|
|
|
|
} xma_sample_data;
|
|
|
|
void xma_get_samples(xma_sample_data * xma, STREAMFILE *streamFile);
|
|
|
|
|
2016-07-17 08:02:27 +02:00
|
|
|
#endif
|
|
|
|
|
2017-01-08 01:09:20 +01:00
|
|
|
#endif /*_CODING_H*/
|