cleanup: remove tabs

This commit is contained in:
bnnm 2021-09-04 22:19:36 +02:00
parent 333b7097c9
commit abb9acaf4f
19 changed files with 93 additions and 97 deletions

View File

@ -7,14 +7,12 @@
/* Based on Valery V. Anisimovsky's WS-AUD.txt */
static char WSTable2bit[4] = { -2,-1,0,1 };
static char WSTable4bit[16]={-9,-8,-6,-5,-4,-3,-2,-1,
0, 1, 2, 3, 4, 5 ,6, 8};
static char WSTable4bit[16] = { -9,-8,-6,-5,-4,-3,-2,-1, 0, 1, 2, 3, 4, 5 ,6, 8 };
/* We pass in the VGMSTREAM here, unlike in other codings, because
the decoder has to know about the block structure. */
void decode_ws(VGMSTREAM * vgmstream, int channel, sample * outbuf, int channelspacing, int32_t first_sample,
int32_t samples_to_do) {
VGMSTREAMCHANNEL * stream = &(vgmstream->ch[channel]);
int16_t hist = stream->adpcm_history1_16;
off_t offset = stream->offset;

View File

@ -2,49 +2,47 @@
#include "../coding/coding.h"
#include "../util.h"
/* .ADX - from Xenoblade 3D */
/* Xenoblade Chronicles 3D uses an adx extension as with
* the Wii version, but it's actually DSP ADPCM. */
VGMSTREAM * init_vgmstream_dsp_adx(STREAMFILE *streamFile) {
/* .ADX - from Xenoblade 3D (3DS) */
VGMSTREAM* init_vgmstream_dsp_adx(STREAMFILE *sf) {
VGMSTREAM* vgmstream = NULL;
int loop_flag, channel_count;
int loop_flag, channels;
int channel_header_spacing = 0x34;
/* check extension, case insensitive */
if (!check_extensions(streamFile,"adx")) goto fail;
/* checks */
if (!check_extensions(sf,"adx"))
goto fail;
/* check header */
if (read_32bitBE(0,streamFile)!=0x02000000) goto fail;
if (read_u32be(0x00,sf) != 0x02000000)
goto fail;
channel_count = read_32bitLE(0, streamFile);
loop_flag = read_16bitLE(0x6e, streamFile);
channels = read_32bitLE(0, sf);
loop_flag = read_16bitLE(0x6e, sf);
if (channel_count > 2 || channel_count < 0) goto fail;
if (channels > 2 || channels < 0) goto fail;
vgmstream = allocate_vgmstream(channel_count,loop_flag);
vgmstream = allocate_vgmstream(channels, loop_flag);
if (!vgmstream) goto fail;
vgmstream->coding_type = coding_NGC_DSP;
vgmstream->layout_type = layout_none;
vgmstream->meta_type = meta_XB3D_ADX;
vgmstream->sample_rate = read_32bitLE(0x70,streamFile);
vgmstream->num_samples = read_32bitLE(0x74, streamFile);
vgmstream->loop_start_sample = read_32bitLE(0x78, streamFile);
vgmstream->loop_end_sample = read_32bitLE(0x7c, streamFile);
dsp_read_coefs_le(vgmstream,streamFile, 0x4, channel_header_spacing);
vgmstream->sample_rate = read_32bitLE(0x70,sf);
vgmstream->num_samples = read_32bitLE(0x74, sf);
vgmstream->loop_start_sample = read_32bitLE(0x78, sf);
vgmstream->loop_end_sample = read_32bitLE(0x7c, sf);
dsp_read_coefs_le(vgmstream,sf, 0x4, channel_header_spacing);
/* semi-interleave: manually open streams at offset */
{
char filename[PATH_LIMIT];
int i;
streamFile->get_name(streamFile,filename,sizeof(filename));
for (i = 0; i<channel_count; i++) {
vgmstream->ch[i].streamfile = streamFile->open(streamFile, filename, STREAMFILE_DEFAULT_BUFFER_SIZE);
sf->get_name(sf,filename,sizeof(filename));
for (i = 0; i<channels; i++) {
vgmstream->ch[i].streamfile = sf->open(sf, filename, STREAMFILE_DEFAULT_BUFFER_SIZE);
vgmstream->ch[i].channel_start_offset =
vgmstream->ch[i].offset = read_32bitLE(0x34+i*channel_header_spacing, streamFile);
vgmstream->ch[i].offset = read_32bitLE(0x34+i*channel_header_spacing, sf);
if (!vgmstream->ch[i].streamfile) goto fail;
}
}

View File

@ -42,7 +42,7 @@ VGMSTREAM* init_vgmstream_xvag(STREAMFILE* sf) {
/* checks */
/* .xvag: standard
* (extensionless): The Last Of Us (PS3) speech files */
* (extensionless): The Last of Us (PS3) speech files */
if (!check_extensions(sf,"xvag,"))
goto fail;
if (!is_id32be(0x00,sf, "XVAG"))