cleanup: rename IMA_int to IMA_mono

This commit is contained in:
bnnm 2025-02-02 23:13:20 +01:00
parent a2aa7f1f18
commit c7d9b68103
26 changed files with 101 additions and 100 deletions

View File

@ -467,8 +467,8 @@ int decode_get_samples_per_frame(VGMSTREAM* vgmstream) {
return 1;
case coding_PCM4:
case coding_PCM4_U:
case coding_IMA_int:
case coding_DVI_IMA_int:
case coding_IMA_mono:
case coding_DVI_IMA_mono:
case coding_CAMELOT_IMA:
case coding_WV6_IMA:
case coding_HV_IMA:
@ -682,9 +682,9 @@ int decode_get_frame_size(VGMSTREAM* vgmstream) {
case coding_PCM4:
case coding_PCM4_U:
case coding_IMA:
case coding_IMA_int:
case coding_IMA_mono:
case coding_DVI_IMA:
case coding_DVI_IMA_int:
case coding_DVI_IMA_mono:
case coding_CAMELOT_IMA:
case coding_WV6_IMA:
case coding_HV_IMA:
@ -1314,13 +1314,13 @@ void decode_vgmstream(sbuf_t* sdst, VGMSTREAM* vgmstream, int samples_to_do) {
break;
case coding_IMA:
case coding_IMA_int:
case coding_IMA_mono:
case coding_DVI_IMA:
case coding_DVI_IMA_int: {
case coding_DVI_IMA_mono: {
int is_stereo = (vgmstream->channels > 1 && vgmstream->coding_type == coding_IMA)
|| (vgmstream->channels > 1 && vgmstream->coding_type == coding_DVI_IMA);
int is_high_first = vgmstream->coding_type == coding_DVI_IMA
|| vgmstream->coding_type == coding_DVI_IMA_int;
|| vgmstream->coding_type == coding_DVI_IMA_mono;
for (ch = 0; ch < vgmstream->channels; ch++) {
decode_standard_ima(&vgmstream->ch[ch], buffer+ch,
vgmstream->channels, vgmstream->samples_into_block, samples_to_do, ch,

View File

@ -836,9 +836,9 @@ static const coding_info coding_info_list[] = {
{coding_EA_XAS_V1, "Electronic Arts EA-XAS 4-bit ADPCM v1"},
{coding_IMA, "IMA 4-bit ADPCM"},
{coding_IMA_int, "IMA 4-bit ADPCM (mono/interleave)"},
{coding_IMA_mono, "IMA 4-bit ADPCM (mono)"},
{coding_DVI_IMA, "Intel DVI 4-bit IMA ADPCM"},
{coding_DVI_IMA_int, "Intel DVI 4-bit IMA ADPCM (mono/interleave)"},
{coding_DVI_IMA_mono, "Intel DVI 4-bit IMA ADPCM (mono)"},
{coding_CAMELOT_IMA, "Camelot IMA 4-bit ADPCM"},
{coding_SNDS_IMA, "Heavy Iron .snds 4-bit IMA ADPCM"},
{coding_QD_IMA, "Quantic Dream 4-bit IMA ADPCM"},

View File

@ -1,6 +1,6 @@
#include "meta.h"
/* ADP - from Wildfire Studios games [Balls of Steel (PC)] */
/* ADP! - from Wildfire Studios games [Balls of Steel (PC)] */
VGMSTREAM* init_vgmstream_adp_wildfire(STREAMFILE* sf) {
VGMSTREAM* vgmstream = NULL;
uint32_t start_offset;
@ -28,7 +28,7 @@ VGMSTREAM* init_vgmstream_adp_wildfire(STREAMFILE* sf) {
vgmstream->loop_start_sample = read_s32le(0x08,sf);
vgmstream->loop_end_sample = vgmstream->num_samples;
vgmstream->coding_type = coding_DVI_IMA_int;
vgmstream->coding_type = coding_DVI_IMA_mono;
vgmstream->layout_type = layout_none;
vgmstream->meta_type = meta_ADP_WILDFIRE;

View File

@ -15,7 +15,7 @@ VGMSTREAM* init_vgmstream_ads(STREAMFILE* sf) {
/* checks */
if (!is_id32be(0x00,sf,"SShd"))
goto fail;
return NULL;
/* .ads: actual extension
* .ss2: demuxed videos (fake?)
@ -25,15 +25,15 @@ VGMSTREAM* init_vgmstream_ads(STREAMFILE* sf) {
* .800: Mobile Suit Gundam: The One Year War (PS2)
* .sdl: Innocent Life: A Futuristic Harvest Moon (Special Edition) (PS2) */
if (!check_extensions(sf, "ads,ss2,pcm,adx,,800,sdl"))
goto fail;
return NULL;
if (read_u32le(0x04,sf) != 0x18 && /* standard header size */
read_u32le(0x04,sf) != 0x20 && /* True Fortune (PS2) */
read_u32le(0x04,sf) != get_streamfile_size(sf) - 0x08) /* Katamari Damacy videos */
goto fail;
return NULL;
if (!is_id32be(0x20,sf,"SSbd"))
goto fail;
return NULL;
/* base values (a bit unorderly since devs hack ADS too much and detection is messy) */
{
@ -52,7 +52,7 @@ VGMSTREAM* init_vgmstream_ads(STREAMFILE* sf) {
if (sample_rate == 12000 && interleave == 0x200) {
sample_rate = 48000;
interleave = 0x40;
coding_type = coding_DVI_IMA_int;
coding_type = coding_DVI_IMA_mono;
/* should try to detect IMA data but it's not so easy, this works ok since
* no known games use these settings, videos normally are 48000/24000hz */
}
@ -281,7 +281,7 @@ VGMSTREAM* init_vgmstream_ads(STREAMFILE* sf) {
case coding_PSX:
vgmstream->num_samples = ps_bytes_to_samples(stream_size, channels);
break;
case coding_DVI_IMA_int:
case coding_DVI_IMA_mono:
vgmstream->num_samples = ima_bytes_to_samples(stream_size, channels);
break;
default:

View File

@ -206,7 +206,7 @@ VGMSTREAM* init_vgmstream_aifc(STREAMFILE* sf) {
break;
case 0x41445034: /* "ADP4" */
coding_type = coding_DVI_IMA_int;
coding_type = coding_DVI_IMA_mono;
if (channels != 1) break; /* don't know how stereo DVI is laid out */
break;

View File

@ -227,7 +227,7 @@ static VGMSTREAM* init_vgmstream_bxwav(STREAMFILE* sf, bxwav_type_t type) {
break;
case 0x03:
vgmstream->coding_type = coding_IMA_int; // 3DS eShop applet (3DS)
vgmstream->coding_type = coding_IMA_mono; // 3DS eShop applet (3DS)
/* hist is read below */
break;

View File

@ -34,7 +34,7 @@ VGMSTREAM * init_vgmstream_dc_idvi(STREAMFILE *streamFile) {
vgmstream->loop_end_sample = vgmstream->num_samples;
vgmstream->meta_type = meta_DC_IDVI;
vgmstream->coding_type = coding_DVI_IMA_int;
vgmstream->coding_type = coding_DVI_IMA_mono;
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = 0x400;
if (vgmstream->interleave_block_size)

View File

@ -169,9 +169,9 @@ VGMSTREAM* init_vgmstream_genh(STREAMFILE *sf) {
else {
vgmstream->layout_type = layout_interleave;
if (coding == coding_DVI_IMA)
coding = coding_DVI_IMA_int;
coding = coding_DVI_IMA_mono;
if (coding == coding_IMA)
coding = coding_IMA_int;
coding = coding_IMA_mono;
if (coding == coding_AICA)
coding = coding_AICA_int;
}
@ -180,8 +180,8 @@ VGMSTREAM* init_vgmstream_genh(STREAMFILE *sf) {
if (!genh.interleave && (
coding == coding_PSX ||
coding == coding_PSX_badflags ||
coding == coding_IMA_int ||
coding == coding_DVI_IMA_int ||
coding == coding_IMA_mono ||
coding == coding_DVI_IMA_mono ||
coding == coding_SDX2_int) ) {
goto fail;
}

View File

@ -91,7 +91,7 @@ VGMSTREAM* init_vgmstream_musx(STREAMFILE* sf) {
vgmstream->loop_start_sample = musx.loop_start / 4; /* weird but needed */
vgmstream->loop_end_sample = musx.loop_end / 4;
vgmstream->coding_type = coding_DVI_IMA_int;
vgmstream->coding_type = coding_DVI_IMA_mono;
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = 0x01;
break;

View File

@ -29,7 +29,7 @@ VGMSTREAM* init_vgmstream_myspd(STREAMFILE* sf) {
vgmstream->sample_rate = read_s32be(0x04,sf);
vgmstream->meta_type = meta_MYSPD;
vgmstream->coding_type = coding_IMA_int;
vgmstream->coding_type = coding_IMA_mono;
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = channel_size;

View File

@ -31,7 +31,7 @@ VGMSTREAM * init_vgmstream_nds_hwas(STREAMFILE *streamFile) {
vgmstream->loop_start_sample = ima_bytes_to_samples(read_32bitLE(0x10,streamFile), channel_count); //assumed, always 0
vgmstream->loop_end_sample = ima_bytes_to_samples(read_32bitLE(0x18,streamFile), channel_count);
vgmstream->coding_type = coding_IMA_int;
vgmstream->coding_type = coding_IMA_mono;
vgmstream->layout_type = layout_blocked_hwas;
vgmstream->full_block_size = read_32bitLE(0x04,streamFile); /* usually 0x2000, 0x4000 or 0x8000 */

View File

@ -32,7 +32,7 @@ VGMSTREAM * init_vgmstream_nds_rrds(STREAMFILE *streamFile) {
}
vgmstream->meta_type = meta_NDS_RRDS;
vgmstream->coding_type = coding_IMA_int;
vgmstream->coding_type = coding_IMA_mono;
vgmstream->layout_type = layout_none;
{

View File

@ -1,53 +1,53 @@
#include "meta.h"
#include "../util.h"
/* SND - Might and Magic games [Warriors of M&M (PS2), Heroes of M&M: Quest for the DragonBone Staff (PS2)] */
VGMSTREAM * init_vgmstream_ps2_snd(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
off_t start_offset;
size_t data_size;
int loop_flag, channel_count;
/* checks */
if (!check_extensions(streamFile, "snd"))
goto fail;
if (read_32bitBE(0x00,streamFile) != 0x53534E44) /* "SSND" */
goto fail;
start_offset = read_32bitLE(0x04,streamFile)+0x08;
data_size = get_streamfile_size(streamFile) - start_offset;
loop_flag = 1; /* force full Loop */
channel_count = read_16bitLE(0x0a,streamFile);
/* build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count,loop_flag);
if (!vgmstream) goto fail;
vgmstream->sample_rate = (uint16_t)read_16bitLE(0x0e,streamFile);
vgmstream->num_samples = read_32bitLE(0x16,streamFile);
vgmstream->loop_start_sample = 0;
vgmstream->loop_end_sample = vgmstream->num_samples;
vgmstream->meta_type = meta_PS2_SND;
if (read_8bit(0x08,streamFile)==1) {
vgmstream->coding_type = coding_DVI_IMA_int; /* Warriors of M&M DragonBone */
}
else {
vgmstream->coding_type = coding_PCM16LE; /* Heroes of M&M */
}
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = (uint16_t)read_16bitLE(0x12,streamFile);
if (vgmstream->interleave_block_size)
vgmstream->interleave_last_block_size = (data_size % (vgmstream->interleave_block_size*vgmstream->channels)) / vgmstream->channels;
if (!vgmstream_open_stream(vgmstream,streamFile,start_offset))
goto fail;
return vgmstream;
fail:
close_vgmstream(vgmstream);
return NULL;
}
#include "meta.h"
#include "../util.h"
/* SND - Might and Magic games [Warriors of M&M (PS2), Heroes of M&M: Quest for the DragonBone Staff (PS2)] */
VGMSTREAM * init_vgmstream_ps2_snd(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
off_t start_offset;
size_t data_size;
int loop_flag, channel_count;
/* checks */
if (!check_extensions(streamFile, "snd"))
goto fail;
if (read_32bitBE(0x00,streamFile) != 0x53534E44) /* "SSND" */
goto fail;
start_offset = read_32bitLE(0x04,streamFile)+0x08;
data_size = get_streamfile_size(streamFile) - start_offset;
loop_flag = 1; /* force full Loop */
channel_count = read_16bitLE(0x0a,streamFile);
/* build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count,loop_flag);
if (!vgmstream) goto fail;
vgmstream->sample_rate = (uint16_t)read_16bitLE(0x0e,streamFile);
vgmstream->num_samples = read_32bitLE(0x16,streamFile);
vgmstream->loop_start_sample = 0;
vgmstream->loop_end_sample = vgmstream->num_samples;
vgmstream->meta_type = meta_PS2_SND;
if (read_8bit(0x08,streamFile)==1) {
vgmstream->coding_type = coding_DVI_IMA_mono; /* Warriors of M&M DragonBone */
}
else {
vgmstream->coding_type = coding_PCM16LE; /* Heroes of M&M */
}
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = (uint16_t)read_16bitLE(0x12,streamFile);
if (vgmstream->interleave_block_size)
vgmstream->interleave_last_block_size = (data_size % (vgmstream->interleave_block_size*vgmstream->channels)) / vgmstream->channels;
if (!vgmstream_open_stream(vgmstream,streamFile,start_offset))
goto fail;
return vgmstream;
fail:
close_vgmstream(vgmstream);
return NULL;
}

View File

@ -110,7 +110,7 @@ VGMSTREAM* init_vgmstream_rage_aud(STREAMFILE* sf) {
#endif
case 0x0400: /* PC */
vgmstream->coding_type = coding_IMA_int;
vgmstream->coding_type = coding_IMA_mono;
vgmstream->layout_type = aud.is_streamed ? layout_blocked_rage_aud : layout_none;
vgmstream->full_block_size = aud.block_chunk;
break;

View File

@ -66,7 +66,7 @@ VGMSTREAM* init_vgmstream_sadl(STREAMFILE* sf) {
switch(flags & 0xf0) { /* possibly >> 6? (0/1/2) */
case 0x00: /* Luminous Arc (DS) (non-int IMA? all files are mono though) */
case 0x70: /* Ni no Kuni (DS), Professor Layton and the Curious Village (DS), Soma Bringer (DS) */
vgmstream->coding_type = coding_IMA_int;
vgmstream->coding_type = coding_IMA_mono;
vgmstream->num_samples = ima_bytes_to_samples(data_size, channels);
vgmstream->loop_start_sample = ima_bytes_to_samples(loop_start, channels);

View File

@ -29,7 +29,7 @@ VGMSTREAM* init_vgmstream_sat_dvi(STREAMFILE* sf) {
vgmstream->loop_start_sample = read_s32be(0x0C,sf);
vgmstream->loop_end_sample = read_s32be(0x08,sf);
vgmstream->coding_type = coding_DVI_IMA_int;
vgmstream->coding_type = coding_DVI_IMA_mono;
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = 0x4;
vgmstream->meta_type = meta_SAT_DVI;

View File

@ -82,7 +82,7 @@ VGMSTREAM* init_vgmstream_stma(STREAMFILE* sf) {
dsp_read_hist_be(vgmstream, sf, 0x60, 0x60);
}
else { /* DVI IMA ADPCM (Red Dead Revolver, Midnight Club 2) */
vgmstream->coding_type = coding_DVI_IMA_int;
vgmstream->coding_type = coding_DVI_IMA_mono;
/* 'interleave not' reliable, strange values and rarely needs 0x80 */
vgmstream->interleave_block_size = (interleave == 0xc000) ? 0x80 : 0x40;

View File

@ -60,7 +60,7 @@ VGMSTREAM* init_vgmstream_swav(STREAMFILE* sf) {
bits_per_sample = 16;
break;
case 2:
coding_type = coding_IMA_int;
coding_type = coding_IMA_mono;
bits_per_sample = 4;
break;
default:
@ -79,7 +79,7 @@ VGMSTREAM* init_vgmstream_swav(STREAMFILE* sf) {
vgmstream->loop_end_sample = loop_end * 32 / bits_per_sample + vgmstream->loop_start_sample;
}
if (coding_type == coding_IMA_int) {
if (coding_type == coding_IMA_mono) {
/* handle IMA frame header */
vgmstream->loop_start_sample -= 32 / bits_per_sample;
vgmstream->loop_end_sample -= 32 / bits_per_sample;

View File

@ -371,9 +371,9 @@ VGMSTREAM* init_vgmstream_txth(STREAMFILE* sf) {
else {
vgmstream->layout_type = layout_interleave;
if (coding == coding_DVI_IMA)
coding = coding_DVI_IMA_int;
coding = coding_DVI_IMA_mono;
if (coding == coding_IMA)
coding = coding_IMA_int;
coding = coding_IMA_mono;
if (coding == coding_AICA)
coding = coding_AICA_int;
}
@ -383,8 +383,8 @@ VGMSTREAM* init_vgmstream_txth(STREAMFILE* sf) {
coding == coding_PSX ||
coding == coding_PSX_badflags ||
coding == coding_HEVAG ||
coding == coding_IMA_int ||
coding == coding_DVI_IMA_int ||
coding == coding_IMA_mono ||
coding == coding_DVI_IMA_mono ||
coding == coding_SDX2_int ||
coding == coding_AICA_int) ) {
goto fail;

View File

@ -60,7 +60,7 @@ VGMSTREAM* init_vgmstream_ubi_apm(STREAMFILE* sf) {
if (!vgmstream) goto fail;
vgmstream->meta_type = meta_UBI_APM;
vgmstream->coding_type = coding_DVI_IMA_int;
vgmstream->coding_type = coding_DVI_IMA_mono;
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = 0x01;
vgmstream->sample_rate = sample_rate;

View File

@ -1198,7 +1198,7 @@ static VGMSTREAM* init_vgmstream_ubi_sb_base(ubi_sb_header* sb, STREAMFILE* sf_h
/* APM is a full format though most fields are repeated from .bnm
* see ubi_apm.c for documentation */
vgmstream->coding_type = coding_DVI_IMA_int;
vgmstream->coding_type = coding_DVI_IMA_mono;
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = 0x01;

View File

@ -34,7 +34,7 @@ VGMSTREAM* init_vgmstream_wav2(STREAMFILE* sf) {
vgmstream->sample_rate = sample_rate;
vgmstream->num_samples = ima_bytes_to_samples(data_size, channels); /* also 0x18 */
vgmstream->coding_type = coding_DVI_IMA_int;
vgmstream->coding_type = coding_DVI_IMA_mono;
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = 0xFA;
vgmstream->interleave_last_block_size = (data_size % (vgmstream->interleave_block_size * channels)) / channels;

View File

@ -118,7 +118,7 @@ VGMSTREAM* init_vgmstream_wave(STREAMFILE* sf) {
}
case 0x03: //IMA (DS uses codec 02 for IMA, common; 3DS: uses 03 but not seen)
vgmstream->coding_type = coding_IMA_int;
vgmstream->coding_type = coding_IMA_mono;
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = interleave;

View File

@ -85,7 +85,7 @@ VGMSTREAM * init_vgmstream_wave_segmented(STREAMFILE *sf) {
data->segments[i]->sample_rate = sample_rate;
data->segments[i]->meta_type = meta_WAVE;
data->segments[i]->coding_type = coding_IMA_int;
data->segments[i]->coding_type = coding_IMA_mono;
data->segments[i]->layout_type = layout_none;
data->segments[i]->num_samples = segment_samples;

View File

@ -76,7 +76,7 @@ VGMSTREAM* init_vgmstream_ws_aud(STREAMFILE* sf) {
break;
case 0x63: /* IMA ADPCM [Blade Runner (PC)] */
vgmstream->coding_type = coding_IMA_int;
vgmstream->coding_type = coding_IMA_mono;
break;
default:
goto fail;

View File

@ -60,9 +60,9 @@ typedef enum {
coding_EA_XAS_V1, /* Electronic Arts EA-XAS ADPCM v1 */
coding_IMA, /* IMA ADPCM (stereo or mono, low nibble first) */
coding_IMA_int, /* IMA ADPCM (mono/interleave, low nibble first) */
coding_IMA_mono, /* IMA ADPCM (mono, low nibble first) */
coding_DVI_IMA, /* DVI IMA ADPCM (stereo or mono, high nibble first) */
coding_DVI_IMA_int, /* DVI IMA ADPCM (mono/interleave, high nibble first) */
coding_DVI_IMA_mono, /* DVI IMA ADPCM (mono, high nibble first) */
coding_CAMELOT_IMA,
coding_SNDS_IMA, /* Heavy Iron Studios .snds IMA ADPCM */
coding_QD_IMA,
@ -608,7 +608,7 @@ typedef enum {
meta_AIF_ASOBO, /* Ratatouille (PC) */
meta_AO, /* Cloudphobia (PC) */
meta_APC, /* MegaRace 3 (PC) */
meta_WV2, /* Slave Zero (PC) */
meta_WAV2,
meta_XAU_KONAMI, /* Yu-Gi-Oh - The Dawn of Destiny (Xbox) */
meta_DERF, /* Stupid Invaders (PC) */
meta_SADF,
@ -716,6 +716,7 @@ typedef enum {
meta_PPHD,
meta_XABP,
meta_I3DS,
meta_AXHD,
} meta_t;