mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-19 00:04:04 +01:00
Add dsp_read_coefs_le
This commit is contained in:
parent
9ae63e470b
commit
068284ff09
@ -30,8 +30,11 @@ void decode_otns_ima(VGMSTREAM * vgmstream, VGMSTREAMCHANNEL * stream, sample *
|
||||
/* ngc_dsp_decoder */
|
||||
void decode_ngc_dsp(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
|
||||
void decode_ngc_dsp_mem(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do, uint8_t * mem);
|
||||
|
||||
int32_t dsp_nibbles_to_samples(int32_t nibbles);
|
||||
void dsp_read_coefs_be(VGMSTREAM * vgmstream, STREAMFILE *streamFile, off_t offset, off_t spacing);
|
||||
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);
|
||||
|
||||
/* ngc_dtk_decoder */
|
||||
void decode_ngc_dtk(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do, int channel);
|
||||
|
@ -100,12 +100,19 @@ int32_t dsp_nibbles_to_samples(int32_t nibbles) {
|
||||
* reads DSP coefs built in the streamfile
|
||||
*/
|
||||
void dsp_read_coefs_be(VGMSTREAM * vgmstream, STREAMFILE *streamFile, off_t offset, off_t spacing) {
|
||||
dsp_read_coefs(vgmstream, streamFile, offset, spacing, 1);
|
||||
}
|
||||
void dsp_read_coefs_le(VGMSTREAM * vgmstream, STREAMFILE *streamFile, off_t offset, off_t spacing) {
|
||||
dsp_read_coefs(vgmstream, streamFile, offset, spacing, 0);
|
||||
}
|
||||
void dsp_read_coefs(VGMSTREAM * vgmstream, STREAMFILE *streamFile, off_t offset, off_t spacing, int be) {
|
||||
int ch, i;
|
||||
/* get ADPCM coefs */
|
||||
for (ch=0; ch < vgmstream->channels; ch++) {
|
||||
for (i=0; i < 16; i++) {
|
||||
vgmstream->ch[ch].adpcm_coef[i] =
|
||||
read_16bitBE(offset + ch*spacing + i*2, streamFile);
|
||||
vgmstream->ch[ch].adpcm_coef[i] = be ?
|
||||
read_16bitBE(offset + ch*spacing + i*2, streamFile) :
|
||||
read_16bitLE(offset + ch*spacing + i*2, streamFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user