some code cleaning

git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@96 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
fastelbja 2008-05-10 19:58:03 +00:00
parent c21d6f0220
commit f39503701a

View File

@ -10,8 +10,8 @@ double VAG_f[5][2] = { { 0.0 , 0.0 },
void decode_psx(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do) {
int predict_nr, shift_factor, sample;
int16_t hist1=stream->adpcm_history1_16;
int16_t hist2=stream->adpcm_history2_16;
int32_t hist1=stream->adpcm_history1_32;
int32_t hist2=stream->adpcm_history2_32;
short scale;
int i;
@ -22,7 +22,7 @@ void decode_psx(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing,
predict_nr = read_8bit(stream->offset+framesin*16,stream->streamfile) >> 4;
shift_factor = read_8bit(stream->offset+framesin*16,stream->streamfile) & 0xf;
first_sample=first_sample % 28;
first_sample = first_sample % 28;
for (i=first_sample,sample_count=0; i<first_sample+samples_to_do; i++,sample_count+=channelspacing) {
short sample_byte = (short)read_8bit(stream->offset+(framesin*16)+2+i/2,stream->streamfile);
@ -35,8 +35,8 @@ void decode_psx(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing,
outbuf[sample_count] = clamp16(sample);
hist2=hist1;
hist1=clamp16(sample);
hist1=sample;
}
stream->adpcm_history1_16=hist1;
stream->adpcm_history2_16=hist2;
stream->adpcm_history1_32=hist1;
stream->adpcm_history2_32=hist2;
}