mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-17 23:36:41 +01:00
Add DSP hist utils
This commit is contained in:
parent
d219804b99
commit
272b55cb3e
@ -42,6 +42,9 @@ 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);
|
||||
void dsp_read_hist_be(VGMSTREAM * vgmstream, STREAMFILE *streamFile, off_t offset, off_t spacing);
|
||||
void dsp_read_hist_le(VGMSTREAM * vgmstream, STREAMFILE *streamFile, off_t offset, off_t spacing);
|
||||
void dsp_read_hist(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,9 +100,7 @@ size_t dsp_bytes_to_samples(size_t bytes, int channels) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* reads DSP coefs built in the streamfile
|
||||
*/
|
||||
/* 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);
|
||||
}
|
||||
@ -121,3 +119,23 @@ void dsp_read_coefs(VGMSTREAM * vgmstream, STREAMFILE *streamFile, off_t offset,
|
||||
}
|
||||
}
|
||||
|
||||
/* reads DSP initial hist built in the streamfile */
|
||||
void dsp_read_hist_be(VGMSTREAM * vgmstream, STREAMFILE *streamFile, off_t offset, off_t spacing) {
|
||||
dsp_read_hist(vgmstream, streamFile, offset, spacing, 1);
|
||||
}
|
||||
void dsp_read_hist_le(VGMSTREAM * vgmstream, STREAMFILE *streamFile, off_t offset, off_t spacing) {
|
||||
dsp_read_hist(vgmstream, streamFile, offset, spacing, 0);
|
||||
}
|
||||
void dsp_read_hist(VGMSTREAM * vgmstream, STREAMFILE *streamFile, off_t offset, off_t spacing, int be) {
|
||||
int ch;
|
||||
/* get ADPCM hist */
|
||||
for (ch=0; ch < vgmstream->channels; ch++) {
|
||||
vgmstream->ch[ch].adpcm_history1_16 = be ?
|
||||
read_16bitBE(offset + ch*spacing + 0*2, streamFile) :
|
||||
read_16bitLE(offset + ch*spacing + 0*2, streamFile);;
|
||||
vgmstream->ch[ch].adpcm_history2_16 = be ?
|
||||
read_16bitBE(offset + ch*spacing + 1*2, streamFile) :
|
||||
read_16bitLE(offset + ch*spacing + 1*2, streamFile);;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user