mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-13 18:20:50 +01:00
cleanup
This commit is contained in:
parent
f601ed4ed6
commit
edaac2c289
@ -17,7 +17,7 @@ void g72x_init_state(struct g72x_state* state_ptr);
|
||||
|
||||
/* ima_decoder */
|
||||
void decode_standard_ima(VGMSTREAMCHANNEL* stream, sample_t* outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do, int channel, int is_stereo, int is_high_first);
|
||||
void decode_3ds_ima(VGMSTREAMCHANNEL* stream, sample_t* outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
||||
void decode_nw_ima(VGMSTREAMCHANNEL* stream, sample_t* outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
||||
void decode_snds_ima(VGMSTREAMCHANNEL* stream, sample_t* outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do, int channel);
|
||||
void decode_otns_ima(VGMSTREAM* vgmstream, VGMSTREAMCHANNEL* stream, sample_t* outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do, int channel);
|
||||
void decode_wv6_ima(VGMSTREAMCHANNEL* stream, sample_t* outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
||||
|
@ -108,8 +108,8 @@ static void std_ima_expand_nibble_mul(VGMSTREAMCHANNEL * stream, off_t byte_offs
|
||||
if (*step_index > 88) *step_index=88;
|
||||
}
|
||||
|
||||
/* 3DS IMA (Mario Golf, Mario Tennis; maybe other Camelot games) */
|
||||
static void n3ds_ima_expand_nibble(VGMSTREAMCHANNEL * stream, off_t byte_offset, int nibble_shift, int32_t * hist1, int32_t * step_index) {
|
||||
/* NintendoWare IMA (Mario Golf, Mario Tennis; maybe other Camelot games) */
|
||||
static void nw_ima_expand_nibble(VGMSTREAMCHANNEL * stream, off_t byte_offset, int nibble_shift, int32_t * hist1, int32_t * step_index) {
|
||||
int sample_nibble, sample_decoded, step, delta;
|
||||
|
||||
sample_nibble = (read_8bit(byte_offset,stream->streamfile) >> nibble_shift)&0xf;
|
||||
@ -402,7 +402,7 @@ void decode_mtf_ima(VGMSTREAMCHANNEL * stream, sample_t * outbuf, int channelspa
|
||||
stream->adpcm_step_index = step_index;
|
||||
}
|
||||
|
||||
void decode_3ds_ima(VGMSTREAMCHANNEL * stream, sample_t * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do) {
|
||||
void decode_nw_ima(VGMSTREAMCHANNEL * stream, sample_t * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do) {
|
||||
int i, sample_count;
|
||||
int32_t hist1 = stream->adpcm_history1_32;
|
||||
int step_index = stream->adpcm_step_index;
|
||||
@ -415,7 +415,7 @@ void decode_3ds_ima(VGMSTREAMCHANNEL * stream, sample_t * outbuf, int channelspa
|
||||
off_t byte_offset = stream->offset + i/2;
|
||||
int nibble_shift = (i&1?4:0); //low nibble order
|
||||
|
||||
n3ds_ima_expand_nibble(stream, byte_offset,nibble_shift, &hist1, &step_index);
|
||||
nw_ima_expand_nibble(stream, byte_offset,nibble_shift, &hist1, &step_index);
|
||||
outbuf[sample_count] = (short)(hist1);
|
||||
}
|
||||
|
||||
|
@ -425,7 +425,7 @@ int get_vgmstream_samples_per_frame(VGMSTREAM* vgmstream) {
|
||||
case coding_PCM4_U:
|
||||
case coding_IMA_int:
|
||||
case coding_DVI_IMA_int:
|
||||
case coding_3DS_IMA:
|
||||
case coding_NW_IMA:
|
||||
case coding_WV6_IMA:
|
||||
case coding_HV_IMA:
|
||||
case coding_FFTA2_IMA:
|
||||
@ -638,7 +638,7 @@ int get_vgmstream_frame_size(VGMSTREAM* vgmstream) {
|
||||
case coding_IMA_int:
|
||||
case coding_DVI_IMA:
|
||||
case coding_DVI_IMA_int:
|
||||
case coding_3DS_IMA:
|
||||
case coding_NW_IMA:
|
||||
case coding_WV6_IMA:
|
||||
case coding_HV_IMA:
|
||||
case coding_FFTA2_IMA:
|
||||
@ -1173,9 +1173,9 @@ void decode_vgmstream(VGMSTREAM* vgmstream, int samples_written, int samples_to_
|
||||
}
|
||||
break;
|
||||
}
|
||||
case coding_3DS_IMA:
|
||||
case coding_NW_IMA:
|
||||
for (ch = 0; ch < vgmstream->channels; ch++) {
|
||||
decode_3ds_ima(&vgmstream->ch[ch], buffer+ch,
|
||||
decode_nw_ima(&vgmstream->ch[ch], buffer+ch,
|
||||
vgmstream->channels, vgmstream->samples_into_block, samples_to_do);
|
||||
}
|
||||
break;
|
||||
|
@ -790,7 +790,7 @@ static const coding_info coding_info_list[] = {
|
||||
{coding_IMA_int, "IMA 4-bit ADPCM (mono/interleave)"},
|
||||
{coding_DVI_IMA, "Intel DVI 4-bit IMA ADPCM"},
|
||||
{coding_DVI_IMA_int, "Intel DVI 4-bit IMA ADPCM (mono/interleave)"},
|
||||
{coding_3DS_IMA, "3DS IMA 4-bit ADPCM"},
|
||||
{coding_NW_IMA, "NintendoWare IMA 4-bit ADPCM"},
|
||||
{coding_SNDS_IMA, "Heavy Iron .snds 4-bit IMA ADPCM"},
|
||||
{coding_QD_IMA, "Quantic Dream 4-bit IMA ADPCM"},
|
||||
{coding_WV6_IMA, "Gorilla Systems WV6 4-bit IMA ADPCM"},
|
||||
|
@ -104,7 +104,7 @@ VGMSTREAM * init_vgmstream_bcstm(STREAMFILE *streamFile) {
|
||||
vgmstream->coding_type = coding_NGC_DSP;
|
||||
|
||||
if (is_camelot_ima) {
|
||||
vgmstream->coding_type = coding_3DS_IMA;
|
||||
vgmstream->coding_type = coding_NW_IMA;
|
||||
}
|
||||
else {
|
||||
int i, c;
|
||||
|
@ -227,7 +227,7 @@ static VGMSTREAM* init_vgmstream_bxwav(STREAMFILE* sf, bxwav_type_t type) {
|
||||
break;
|
||||
|
||||
case 0x03:
|
||||
vgmstream->coding_type = coding_3DS_IMA;
|
||||
vgmstream->coding_type = coding_NW_IMA;
|
||||
/* hist is read below */
|
||||
break;
|
||||
|
||||
|
@ -108,7 +108,7 @@ typedef enum {
|
||||
coding_IMA_int, /* IMA ADPCM (mono/interleave, low nibble first) */
|
||||
coding_DVI_IMA, /* DVI IMA ADPCM (stereo or mono, high nibble first) */
|
||||
coding_DVI_IMA_int, /* DVI IMA ADPCM (mono/interleave, high nibble first) */
|
||||
coding_3DS_IMA, /* 3DS IMA ADPCM */
|
||||
coding_NW_IMA,
|
||||
coding_SNDS_IMA, /* Heavy Iron Studios .snds IMA ADPCM */
|
||||
coding_QD_IMA,
|
||||
coding_WV6_IMA, /* Gorilla Systems WV6 4-bit IMA ADPCM */
|
||||
|
Loading…
Reference in New Issue
Block a user