cleanup: misc

This commit is contained in:
bnnm 2021-07-29 22:46:34 +02:00
parent 93374f3019
commit bfd1d28745
5 changed files with 16 additions and 15 deletions

View File

@ -90,7 +90,7 @@ void decode_circus_adpcm(VGMSTREAMCHANNEL* stream, sample_t* outbuf, int channel
for (i = first_sample; i < first_sample + samples_to_do; i++) {
int8_t code = read_8bit(frame_offset+i,stream->streamfile);
int8_t code = read_u8(frame_offset+i,stream->streamfile);
hist += code << scale;
if (code == 0) {
@ -102,6 +102,7 @@ void decode_circus_adpcm(VGMSTREAMCHANNEL* stream, sample_t* outbuf, int channel
scale++;
}
outbuf[sample_pos] = hist;
sample_pos += channelspacing;
}
stream->adpcm_history1_32 = hist;

View File

@ -67,7 +67,7 @@ static int init_ffmpeg_config(ffmpeg_codec_data* data, int target_subsong, int r
/* ******************************************** */
/* Global FFmpeg init */
static void g_init_ffmpeg() {
static void g_init_ffmpeg(void) {
if (g_ffmpeg_initialized == 1) {
while (g_ffmpeg_initialized < 2); /* active wait for lack of a better way */
}

View File

@ -309,7 +309,7 @@ fail:
/* **************************************** */
static void decode_vima1(STREAMFILE* sf, sbuf_t* sbuf, uint8_t* buf, size_t data_left, int block_num, uint16_t* adpcm_table) {
static void decode_vima1(sbuf_t* sbuf, uint8_t* buf, size_t data_left, int block_num, uint16_t* adpcm_table) {
int ch, i, j, s;
int bitpos;
int adpcm_history[MAX_CHANNELS] = {0};
@ -426,7 +426,7 @@ static int decode_block1(STREAMFILE* sf, imuse_codec_data* data, uint8_t* block,
switch(data->block_table[block_num].flags) {
case 0x0D:
case 0x0F:
decode_vima1(sf, &data->sbuf, block, data_left, block_num, data->adpcm_table);
decode_vima1(&data->sbuf, block, data_left, block_num, data->adpcm_table);
break;
default:
return 0;
@ -434,7 +434,7 @@ static int decode_block1(STREAMFILE* sf, imuse_codec_data* data, uint8_t* block,
return 1;
}
static void decode_data2(STREAMFILE* sf, sbuf_t* sbuf, uint8_t* buf, size_t data_left, int block_num) {
static void decode_data2(sbuf_t* sbuf, uint8_t* buf, size_t data_left, int block_num) {
int i, j;
int channels = sbuf->channels;
@ -453,7 +453,7 @@ static void decode_data2(STREAMFILE* sf, sbuf_t* sbuf, uint8_t* buf, size_t data
}
}
static void decode_vima2(STREAMFILE* sf, sbuf_t* sbuf, uint8_t* buf, size_t data_left, uint16_t* adpcm_table) {
static void decode_vima2(sbuf_t* sbuf, uint8_t* buf, size_t data_left, uint16_t* adpcm_table) {
int ch, i, s;
int bitpos;
int adpcm_history[MAX_CHANNELS] = {0};
@ -559,11 +559,11 @@ static int decode_block2(STREAMFILE* sf, imuse_codec_data* data, uint8_t* block,
switch(data->block_table[block_num].flags) {
case 0x00:
decode_data2(sf, &data->sbuf, block, data_left, block_num);
decode_data2(&data->sbuf, block, data_left, block_num);
break;
case 0x01:
decode_vima2(sf, &data->sbuf, block, data_left, data->adpcm_table);
decode_vima2(&data->sbuf, block, data_left, data->adpcm_table);
break;
default:
return 0;

View File

@ -294,7 +294,7 @@ fail:
return 0;
}
static int is_ue4_msadpcm(VGMSTREAM* vgmstream, STREAMFILE* sf, riff_fmt_chunk* fmt, int fact_sample_count, off_t start_offset);
static int is_ue4_msadpcm(STREAMFILE* sf, riff_fmt_chunk* fmt, int fact_sample_count, off_t start_offset);
static size_t get_ue4_msadpcm_interleave(STREAMFILE* sf, riff_fmt_chunk* fmt, off_t start, size_t size);
@ -795,7 +795,7 @@ VGMSTREAM* init_vgmstream_riff(STREAMFILE* sf) {
}
/* UE4 uses interleaved mono MSADPCM, try to autodetect without breaking normal MSADPCM */
if (fmt.coding_type == coding_MSADPCM && is_ue4_msadpcm(vgmstream, sf, &fmt, fact_sample_count, start_offset)) {
if (fmt.coding_type == coding_MSADPCM && is_ue4_msadpcm(sf, &fmt, fact_sample_count, start_offset)) {
vgmstream->coding_type = coding_MSADPCM_int;
vgmstream->codec_config = 1; /* mark as UE4 MSADPCM */
vgmstream->frame_size = fmt.block_size;
@ -870,7 +870,7 @@ fail:
}
/* UE4 MSADPCM is quite normal but has a few minor quirks we can use to detect it */
static int is_ue4_msadpcm(VGMSTREAM* vgmstream, STREAMFILE* sf, riff_fmt_chunk* fmt, int fact_sample_count, off_t start) {
static int is_ue4_msadpcm(STREAMFILE* sf, riff_fmt_chunk* fmt, int fact_sample_count, off_t start) {
/* multichannel ok */
if (fmt->channel_count < 2)

View File

@ -599,7 +599,7 @@ fail:
}
static VGMSTREAM* init_vgmstream_ubi_bao_silence(ubi_bao_header* bao, STREAMFILE* sf) {
static VGMSTREAM* init_vgmstream_ubi_bao_silence(ubi_bao_header* bao) {
VGMSTREAM* vgmstream = NULL;
int channels, sample_rate;
int32_t num_samples;
@ -660,7 +660,7 @@ static VGMSTREAM* init_vgmstream_ubi_bao_header(ubi_bao_header* bao, STREAMFILE*
break;
case UBI_SILENCE:
vgmstream = init_vgmstream_ubi_bao_silence(bao, sf);
vgmstream = init_vgmstream_ubi_bao_silence(bao);
break;
default:
@ -990,7 +990,7 @@ fail:
}
/* adjust some common values */
static int parse_values(ubi_bao_header* bao, STREAMFILE* sf) {
static int parse_values(ubi_bao_header* bao) {
if (bao->type == UBI_SEQUENCE || bao->type == UBI_SILENCE)
return 1;
@ -1228,7 +1228,7 @@ static int parse_header(ubi_bao_header* bao, STREAMFILE* sf, off_t offset) {
goto fail;
}
if (!parse_values(bao, sf))
if (!parse_values(bao))
goto fail;
if (!parse_offsets(bao, sf))