consolidate headers

git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@89 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
halleyscometsw 2008-05-06 03:35:37 +00:00
parent 6c4e802e9a
commit 2a686eeea2
66 changed files with 163 additions and 367 deletions

View File

@ -1,4 +1,4 @@
#include "adx_decoder.h"
#include "coding.h"
#include "../util.h"
void decode_adx(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do) {

View File

@ -1,12 +0,0 @@
/*
* adx.h - ADX reading and decoding
*/
#include "../vgmstream.h"
#ifndef _ADX_DECODER_H
#define _ADX_DECODER_H
void decode_adx(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
#endif

27
src/coding/coding.h Normal file
View File

@ -0,0 +1,27 @@
#ifndef _CODING_H
#define _CODING_H
#include "../vgmstream.h"
void decode_adx(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
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);
void decode_nds_ima(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
void decode_ngc_afc(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
void decode_ngc_dsp(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
int32_t dsp_nibbles_to_samples(int32_t nibbles);
void decode_ngc_dtk(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do, int channel);
void decode_pcm16LE(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
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);
void decode_psx(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
#endif

View File

@ -29,7 +29,7 @@
*
*/
#include "g721_decoder.h"
#include "coding.h"
#include "../util.h"
static short power2[15] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80,

View File

@ -1,10 +0,0 @@
#ifndef _G721_decoder_H
#define _G721_decoder_H
#include "../vgmstream.h"
#include "../streamtypes.h"
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);
#endif

35
src/coding/g72x_state.h Normal file
View File

@ -0,0 +1,35 @@
/*
* streamtypes.h - widely used type definitions
*/
#ifndef _G72X_STATE_H
#define _G72X_STATE_H
struct g72x_state {
long yl; /* Locked or steady state step size multiplier. */
short yu; /* Unlocked or non-steady state step size multiplier. */
short dms; /* Short term energy estimate. */
short dml; /* Long term energy estimate. */
short ap; /* Linear weighting coefficient of 'yl' and 'yu'. */
short a[2]; /* Coefficients of pole portion of prediction filter. */
short b[6]; /* Coefficients of zero portion of prediction filter. */
short pk[2]; /*
* Signs of previous two samples of a partially
* reconstructed signal.
*/
short dq[6]; /*
* Previous 6 samples of the quantized difference
* signal represented in an internal floating point
* format.
*/
short sr[2]; /*
* Previous 2 samples of the quantized difference
* signal represented in an internal floating point
* format.
*/
char td; /* delayed tone detect, new in 1988 version */
};
#endif

View File

@ -1,5 +1,5 @@
#include "../util.h"
#include "ima_decoder.h"
#include "coding.h"
const int32_t ADPCMTable[89] =

View File

@ -1,8 +0,0 @@
#include "../vgmstream.h"
#ifndef _IMA_DECODER_H
#define _IMA_DECODER_H
void decode_nds_ima(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
#endif

View File

@ -1,4 +1,4 @@
#include "ngc_afc_decoder.h"
#include "coding.h"
#include "../util.h"
const short afc_coef[16][2] =

View File

@ -1,8 +0,0 @@
#include "../vgmstream.h"
#ifndef _NGC_AFC_H
#define _NGC_AFC_H
void decode_ngc_afc(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
#endif

View File

@ -1,4 +1,4 @@
#include "ngc_dsp_decoder.h"
#include "coding.h"
#include "../util.h"
void decode_ngc_dsp(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do) {

View File

@ -1,10 +0,0 @@
#include "../vgmstream.h"
#ifndef _NGC_DSP_H
#define _NGC_DSP_H
void decode_ngc_dsp(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
int32_t dsp_nibbles_to_samples(int32_t nibbles);
#endif

View File

@ -1,4 +1,4 @@
#include "ngc_dtk_decoder.h"
#include "coding.h"
#include "../util.h"
void decode_ngc_dtk(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do, int channel) {

View File

@ -1,8 +0,0 @@
#include "../vgmstream.h"
#ifndef _NGC_DTK_DECODER_H
#define _NGC_DTK_DECODER_H
void decode_ngc_dtk(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do, int channel);
#endif

View File

@ -1,4 +1,4 @@
#include "pcm_decoder.h"
#include "coding.h"
#include "../util.h"
void decode_pcm16LE(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do) {

View File

@ -1,10 +0,0 @@
#include "../vgmstream.h"
#ifndef _DECODE_PCM_H
#define _DECODE_PCM_H
void decode_pcm16LE(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
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);
#endif

View File

@ -1,4 +1,4 @@
#include "psx_decoder.h"
#include "coding.h"
#include "../util.h"
double VAG_f[5][2] = { { 0.0 , 0.0 },
@ -39,4 +39,4 @@ void decode_psx(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing,
}
stream->adpcm_history1_16=hist1;
stream->adpcm_history2_16=hist2;
}
}

View File

@ -1,9 +0,0 @@
#include "../vgmstream.h"
#ifndef _PSX_DECODER_H
#define _PSX_DECODER_H
void decode_psx(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
#endif

View File

@ -1,4 +1,4 @@
#include "ast_blocked.h"
#include "layout.h"
#include "../vgmstream.h"
/* set up for the block at the given offset */

View File

@ -1,12 +0,0 @@
/*
* ast_blocked.h - AST blocking
*/
#include "../streamtypes.h"
#include "../vgmstream.h"
#ifndef _AST_BLOCKED_H
#define _AST_BLOCKED_H
void ast_block_update(off_t block_ofset, VGMSTREAM * vgmstream);
#endif

View File

@ -1,5 +1,4 @@
#include "ast_blocked.h"
#include "halpst_blocked.h"
#include "layout.h"
#include "../vgmstream.h"
void render_vgmstream_blocked(sample * buffer, int32_t sample_count, VGMSTREAM * vgmstream) {

View File

@ -1,12 +0,0 @@
/*
* blocked.h - blocking
*/
#include "../streamtypes.h"
#include "../vgmstream.h"
#ifndef _BLOCKED_H
#define _BLOCKED_H
void render_vgmstream_blocked(sample * buffer, int32_t sample_count, VGMSTREAM * vgmstream);
#endif

View File

@ -1,4 +1,4 @@
#include "halpst_blocked.h"
#include "layout.h"
#include "../vgmstream.h"
/* set up for the block at the given offset */

View File

@ -1,12 +0,0 @@
/*
* halpst_blocked.h - HALPST blocking
*/
#include "../streamtypes.h"
#include "../vgmstream.h"
#ifndef _HALPST_BLOCKED_H
#define _HALPST_BLOCKED_H
void halpst_block_update(off_t block_ofset, VGMSTREAM * vgmstream);
#endif

View File

@ -1,4 +1,4 @@
#include "interleave.h"
#include "layout.h"
#include "../vgmstream.h"
void render_vgmstream_interleave(sample * buffer, int32_t sample_count, VGMSTREAM * vgmstream) {

View File

@ -1,12 +0,0 @@
/*
* interleave.h - interleaved layouts
*/
#include "../streamtypes.h"
#include "../vgmstream.h"
#ifndef _INTERLEAVE_H
#define _INTERLEAVE_H
void render_vgmstream_interleave(sample * buffer, int32_t sample_count, VGMSTREAM * vgmstream);
#endif

17
src/layout/layout.h Normal file
View File

@ -0,0 +1,17 @@
#ifndef _LAYOUT_H
#define _LAYOUT_H
#include "../streamtypes.h"
#include "../vgmstream.h"
void ast_block_update(off_t block_ofset, VGMSTREAM * vgmstream);
void render_vgmstream_blocked(sample * buffer, int32_t sample_count, VGMSTREAM * vgmstream);
void halpst_block_update(off_t block_ofset, VGMSTREAM * vgmstream);
void render_vgmstream_interleave(sample * buffer, int32_t sample_count, VGMSTREAM * vgmstream);
void render_vgmstream_nolayout(sample * buffer, int32_t sample_count, VGMSTREAM * vgmstream);
#endif

View File

@ -1,4 +1,4 @@
#include "nolayout.h"
#include "layout.h"
#include "../vgmstream.h"
void render_vgmstream_nolayout(sample * buffer, int32_t sample_count, VGMSTREAM * vgmstream) {

View File

@ -1,11 +0,0 @@
/*
*/
#include "../streamtypes.h"
#include "../vgmstream.h"
#ifndef _NOLAYOUT_H
#define _NOLAYOUT_H
void render_vgmstream_nolayout(sample * buffer, int32_t sample_count, VGMSTREAM * vgmstream);
#endif

View File

@ -1,5 +1,5 @@
#include "Cstr.h"
#include "../coding/ngc_dsp_decoder.h"
#include "meta.h"
#include "../coding/coding.h"
#include "../util.h"
/* .dsp w/ Cstr header, seen in Star Fox Assault and Donkey Konga */

View File

@ -1,8 +0,0 @@
#include "../vgmstream.h"
#ifndef _CSTR_H
#define _CSTR_H
VGMSTREAM * init_vgmstream_Cstr(const char * const filename);
#endif

View File

@ -2,7 +2,7 @@
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#include "adx_header.h"
#include "meta.h"
#include "../util.h"
VGMSTREAM * init_vgmstream_adx(const char * const filename) {

View File

@ -1,12 +0,0 @@
/*
* adx.h - ADX reading and decoding
*/
#include "../vgmstream.h"
#ifndef _ADX_HEADER_H
#define _ADX_HEADER_H
VGMSTREAM * init_vgmstream_adx(const char * const filename);
#endif

View File

@ -1,4 +1,4 @@
#include "afc_header.h"
#include "meta.h"
#include "../util.h"
VGMSTREAM * init_vgmstream_afc(const char * const filename) {

View File

@ -1,8 +0,0 @@
#include "../vgmstream.h"
#ifndef _AFC_HEADER_H
#define _AFC_HEADER_H
VGMSTREAM * init_vgmstream_afc(const char * const filename);
#endif

View File

@ -1,4 +1,4 @@
#include "agsc.h"
#include "meta.h"
#include "../util.h"
/* .agsc - from Metroid Prime 2 */

View File

@ -1,8 +0,0 @@
#include "../vgmstream.h"
#ifndef _AGSC_H
#define _AGSC_H
VGMSTREAM * init_vgmstream_agsc(const char * const filename);
#endif

View File

@ -1,5 +1,5 @@
#include "ast.h"
#include "../layout/ast_blocked.h"
#include "meta.h"
#include "../layout/layout.h"
#include "../util.h"
VGMSTREAM * init_vgmstream_ast(const char * const filename) {

View File

@ -1,8 +0,0 @@
#include "../vgmstream.h"
#ifndef _AST_H
#define _AST_H
VGMSTREAM * init_vgmstream_ast(const char * const filename);
#endif

View File

@ -1,4 +1,4 @@
#include "brstm.h"
#include "meta.h"
#include "../util.h"
VGMSTREAM * init_vgmstream_brstm(const char * const filename) {

View File

@ -1,8 +0,0 @@
#include "../vgmstream.h"
#ifndef _BRSTM_H
#define _BRSTM_H
VGMSTREAM * init_vgmstream_brstm(const char * const filename);
#endif

View File

@ -1,4 +1,4 @@
#include "gcsw.h"
#include "meta.h"
#include "../util.h"
VGMSTREAM * init_vgmstream_gcsw(const char * const filename) {

View File

@ -1,8 +0,0 @@
#include "../vgmstream.h"
#ifndef _GCSW_H
#define _GCSW_H
VGMSTREAM * init_vgmstream_gcsw(const char * const filename);
#endif

View File

@ -1,6 +1,6 @@
#include "halpst.h"
#include "../coding/ngc_dsp_decoder.h"
#include "../layout/halpst_blocked.h"
#include "meta.h"
#include "../coding/coding.h"
#include "../layout/layout.h"
#include "../util.h"
VGMSTREAM * init_vgmstream_halpst(const char * const filename) {

View File

@ -1,8 +0,0 @@
#include "../vgmstream.h"
#ifndef _HALPST_H
#define _HALPST_H
VGMSTREAM * init_vgmstream_halpst(const char * const filename);
#endif

38
src/meta/meta.h Normal file
View File

@ -0,0 +1,38 @@
#ifndef _META_H
#define _META_H
#include "../vgmstream.h"
VGMSTREAM * init_vgmstream_adx(const char * const filename);
VGMSTREAM * init_vgmstream_afc(const char * const filename);
VGMSTREAM * init_vgmstream_agsc(const char * const filename);
VGMSTREAM * init_vgmstream_ast(const char * const filename);
VGMSTREAM * init_vgmstream_brstm(const char * const filename);
VGMSTREAM * init_vgmstream_Cstr(const char * const filename);
VGMSTREAM * init_vgmstream_gcsw(const char * const filename);
VGMSTREAM * init_vgmstream_halpst(const char * const filename);
VGMSTREAM * init_vgmstream_nds_strm(const char * const filename);
VGMSTREAM * init_vgmstream_ngc_adpdtk(const char * const filename);
VGMSTREAM * init_vgmstream_ngc_dsp_std(const char * const filename);
VGMSTREAM * init_vgmstream_ps2_ads(const char * const filename);
VGMSTREAM * init_vgmstream_ps2_npsf(const char * const filename);
VGMSTREAM * init_vgmstream_rs03(const char * const filename);
VGMSTREAM * init_vgmstream_rsf(const char * const filename);
VGMSTREAM * init_vgmstream_rwsd(const char * const filename);
#endif

View File

@ -1,4 +1,4 @@
#include "nds_strm.h"
#include "meta.h"
#include "../util.h"
VGMSTREAM * init_vgmstream_nds_strm(const char * const filename) {

View File

@ -1,8 +0,0 @@
#include "../vgmstream.h"
#ifndef _NDS_STRM_H
#define _NDS_STRM_H
VGMSTREAM * init_vgmstream_nds_strm(const char * const filename);
#endif

View File

@ -1,5 +1,5 @@
#include <math.h>
#include "ngc_adpdtk.h"
#include "meta.h"
#include "../util.h"
VGMSTREAM * init_vgmstream_ngc_adpdtk(const char * const filename) {

View File

@ -1,12 +0,0 @@
/*
* ngc_adpdtk.h - GC "DTK" ADPCM
*/
#include "../vgmstream.h"
#ifndef _NGC_ADPDTK_H
#define _NGC_ADPDTK_H
VGMSTREAM * init_vgmstream_ngc_adpdtk(const char * const filename);
#endif

View File

@ -1,5 +1,5 @@
#include "ngc_dsp_std.h"
#include "../coding/ngc_dsp_decoder.h"
#include "meta.h"
#include "../coding/coding.h"
#include "../util.h"
/* The standard .dsp */

View File

@ -1,8 +0,0 @@
#include "../vgmstream.h"
#ifndef _NGC_DSP_STD_H
#define _NGC_DSP_STD_H
VGMSTREAM * init_vgmstream_ngc_dsp_std(const char * const filename);
#endif

View File

@ -1,4 +1,4 @@
#include "ps2_ads.h"
#include "meta.h"
#include "../util.h"
/* Sony .ADS with SShd & SSbd Headers */

View File

@ -1,8 +0,0 @@
#include "../vgmstream.h"
#ifndef _PS2_ADS_H
#define _PS2_ADS_H
VGMSTREAM * init_vgmstream_ps2_ads(const char * const filename);
#endif

View File

@ -1,4 +1,4 @@
#include "ps2_npsf.h"
#include "meta.h"
#include "../util.h"
/* Sony .ADS with SShd & SSbd Headers */

View File

@ -1,8 +0,0 @@
#include "../vgmstream.h"
#ifndef _PS2_NPSF_H
#define _PS2_NPSF_H
VGMSTREAM * init_vgmstream_ps2_npsf(const char * const filename);
#endif

View File

@ -1,5 +1,5 @@
#include "rs03.h"
#include "../coding/ngc_dsp_decoder.h"
#include "meta.h"
#include "../coding/coding.h"
#include "../util.h"
/* .dsp w/ RS03 header - from Metroid Prime 2 */

View File

@ -1,8 +0,0 @@
#include "../vgmstream.h"
#ifndef _RS03_H
#define _RS03_H
VGMSTREAM * init_vgmstream_rs03(const char * const filename);
#endif

View File

@ -1,6 +1,6 @@
#include "rsf.h"
#include "meta.h"
#include "../util.h"
#include "../coding/g721_decoder.h"
#include "../coding/coding.h"
/* .rsf - from Metroid Prime */

View File

@ -1,8 +0,0 @@
#include "../vgmstream.h"
#ifndef _RSF_H
#define _RSF_H
VGMSTREAM * init_vgmstream_rsf(const char * const filename);
#endif

View File

@ -1,4 +1,4 @@
#include "rwsd.h"
#include "meta.h"
#include "../util.h"
/* RWSD is quite similar to BRSTM, but can contain several streams.

View File

@ -1,8 +0,0 @@
#include "../vgmstream.h"
#ifndef _RWSD_H
#define _RWSD_H
VGMSTREAM * init_vgmstream_rwsd(const char * const filename);
#endif

View File

@ -2,6 +2,9 @@
* streamfile.h - definitions for buffered file reading with STREAMFILE
*/
#ifndef _STREAMFILE_H
#define _STREAMFILE_H
#ifdef _MSC_VER
#define _CRT_SECURE_NO_DEPRECATE
#endif
@ -13,9 +16,6 @@
#include "streamtypes.h"
#include "util.h"
#ifndef _STREAMFILE_H
#define _STREAMFILE_H
#if defined(__MSVCRT__) || defined(_MSC_VER)
#define fseeko fseek
#define ftello ftell

View File

@ -17,30 +17,4 @@
typedef int16_t sample;
struct g72x_state {
long yl; /* Locked or steady state step size multiplier. */
short yu; /* Unlocked or non-steady state step size multiplier. */
short dms; /* Short term energy estimate. */
short dml; /* Long term energy estimate. */
short ap; /* Linear weighting coefficient of 'yl' and 'yu'. */
short a[2]; /* Coefficients of pole portion of prediction filter. */
short b[6]; /* Coefficients of zero portion of prediction filter. */
short pk[2]; /*
* Signs of previous two samples of a partially
* reconstructed signal.
*/
short dq[6]; /*
* Previous 6 samples of the quantized difference
* signal represented in an internal floating point
* format.
*/
short sr[2]; /*
* Previous 2 samples of the quantized difference
* signal represented in an internal floating point
* format.
*/
char td; /* delayed tone detect, new in 1988 version */
};
#endif

View File

@ -6,33 +6,9 @@
#include <string.h>
#include <math.h>
#include "vgmstream.h"
#include "meta/adx_header.h"
#include "meta/brstm.h"
#include "meta/nds_strm.h"
#include "meta/agsc.h"
#include "meta/ngc_adpdtk.h"
#include "meta/rsf.h"
#include "meta/afc_header.h"
#include "meta/ast.h"
#include "meta/halpst.h"
#include "meta/rs03.h"
#include "meta/ngc_dsp_std.h"
#include "meta/Cstr.h"
#include "meta/gcsw.h"
#include "meta/ps2_ads.h"
#include "meta/ps2_npsf.h"
#include "meta/rwsd.h"
#include "layout/interleave.h"
#include "layout/nolayout.h"
#include "layout/blocked.h"
#include "coding/adx_decoder.h"
#include "coding/ngc_dsp_decoder.h"
#include "coding/pcm_decoder.h"
#include "coding/ima_decoder.h"
#include "coding/ngc_dtk_decoder.h"
#include "coding/g721_decoder.h"
#include "coding/ngc_afc_decoder.h"
#include "coding/psx_decoder.h"
#include "meta/meta.h"
#include "layout/layout.h"
#include "coding/coding.h"
/*

View File

@ -2,12 +2,12 @@
* vgmstream.h - definitions for VGMSTREAM, encapsulating a multi-channel, looped audio stream
*/
#include "streamfile.h"
#include "coding/g721_decoder.h"
#ifndef _VGMSTREAM_H
#define _VGMSTREAM_H
#include "streamfile.h"
#include "coding/g72x_state.h"
/* The encoding type specifies the format the sound data itself takes */
typedef enum {
/* 16-bit PCM */