cleanup: minor codec renames

This commit is contained in:
bnnm 2024-06-11 00:36:54 +02:00
parent 1fc156badc
commit 9b90a7a260
13 changed files with 31 additions and 29 deletions

View File

@ -416,7 +416,7 @@ int decode_get_samples_per_frame(VGMSTREAM* vgmstream) {
return 2;
case coding_XBOX_IMA:
case coding_XBOX_IMA_mch:
case coding_XBOX_IMA_int:
case coding_XBOX_IMA_mono:
case coding_FSB_IMA:
case coding_WWISE_IMA:
case coding_CD_IMA: /* (0x24 - 0x04) * 2 */
@ -467,7 +467,7 @@ int decode_get_samples_per_frame(VGMSTREAM* vgmstream) {
case coding_MSADPCM:
return (vgmstream->frame_size - 0x07*vgmstream->channels)*2 / vgmstream->channels + 2;
case coding_MSADPCM_int:
case coding_MSADPCM_mono:
case coding_MSADPCM_ck:
return (vgmstream->frame_size - 0x07)*2 + 2;
case coding_WS: /* only works if output sample size is 8 bit, which always is for WS ADPCM */
@ -653,7 +653,7 @@ int decode_get_frame_size(VGMSTREAM* vgmstream) {
case coding_XBOX_IMA:
//todo should be 0x48 when stereo, but blocked/interleave layout don't understand stereo codecs
return 0x24; //vgmstream->channels==1 ? 0x24 : 0x48;
case coding_XBOX_IMA_int:
case coding_XBOX_IMA_mono:
case coding_WWISE_IMA:
case coding_CD_IMA:
return 0x24;
@ -693,7 +693,7 @@ int decode_get_frame_size(VGMSTREAM* vgmstream) {
return 0x4c*vgmstream->channels;
case coding_MSADPCM:
case coding_MSADPCM_int:
case coding_MSADPCM_mono:
case coding_MSADPCM_ck:
return vgmstream->frame_size;
case coding_WS:
@ -934,7 +934,7 @@ void decode_vgmstream(VGMSTREAM* vgmstream, int samples_written, int samples_to_
}
break;
case coding_XBOX_IMA:
case coding_XBOX_IMA_int: {
case coding_XBOX_IMA_mono: {
int is_stereo = (vgmstream->channels > 1 && vgmstream->coding_type == coding_XBOX_IMA);
for (ch = 0; ch < vgmstream->channels; ch++) {
decode_xbox_ima(&vgmstream->ch[ch], buffer+ch,
@ -1334,8 +1334,8 @@ void decode_vgmstream(VGMSTREAM* vgmstream, int samples_written, int samples_to_
decode_nwa(vgmstream->codec_data, buffer, samples_to_do);
break;
case coding_MSADPCM:
case coding_MSADPCM_int:
if (vgmstream->channels == 1 || vgmstream->coding_type == coding_MSADPCM_int) {
case coding_MSADPCM_mono:
if (vgmstream->channels == 1 || vgmstream->coding_type == coding_MSADPCM_mono) {
for (ch = 0; ch < vgmstream->channels; ch++) {
decode_msadpcm_mono(vgmstream,buffer+ch,
vgmstream->channels,vgmstream->samples_into_block, samples_to_do, ch,

View File

@ -128,9 +128,10 @@ void describe_vgmstream(VGMSTREAM* vgmstream, char* desc, int length) {
int32_t frame_size = vgmstream->frame_size > 0 ? vgmstream->frame_size : vgmstream->interleave_block_size;
switch (vgmstream->coding_type) {
case coding_MSADPCM:
case coding_MSADPCM_int:
case coding_MSADPCM_mono:
case coding_MSADPCM_ck:
case coding_MS_IMA:
case coding_MS_IMA_mono:
case coding_MC3:
case coding_WWISE_IMA:
case coding_REF_IMA:
@ -232,9 +233,10 @@ void describe_vgmstream_info(VGMSTREAM* vgmstream, vgmstream_info* info) {
int32_t frame_size = vgmstream->frame_size > 0 ? vgmstream->frame_size : vgmstream->interleave_block_size;
switch (vgmstream->coding_type) {
case coding_MSADPCM:
case coding_MSADPCM_int:
case coding_MSADPCM_mono:
case coding_MSADPCM_ck:
case coding_MS_IMA:
case coding_MS_IMA_mono:
case coding_MC3:
case coding_WWISE_IMA:
case coding_REF_IMA:

View File

@ -827,14 +827,14 @@ static const coding_info coding_info_list[] = {
{coding_MTF_IMA, "MT Framework 4-bit IMA ADPCM"},
{coding_MS_IMA, "Microsoft 4-bit IMA ADPCM"},
{coding_MS_IMA_mono, "Microsoft 4-bit IMA ADPCM (mono/interleave)"},
{coding_MS_IMA_mono, "Microsoft 4-bit IMA ADPCM (mono)"},
{coding_XBOX_IMA, "XBOX 4-bit IMA ADPCM"},
{coding_XBOX_IMA_mch, "XBOX 4-bit IMA ADPCM (multichannel)"},
{coding_XBOX_IMA_int, "XBOX 4-bit IMA ADPCM (mono/interleave)"},
{coding_XBOX_IMA_mono, "XBOX 4-bit IMA ADPCM (mono)"},
{coding_NDS_IMA, "NDS-style 4-bit IMA ADPCM"},
{coding_DAT4_IMA, "Eurocom DAT4 4-bit IMA ADPCM"},
{coding_RAD_IMA, "Radical 4-bit IMA ADPCM"},
{coding_RAD_IMA_mono, "Radical 4-bit IMA ADPCM (mono/interleave)"},
{coding_RAD_IMA_mono, "Radical 4-bit IMA ADPCM (mono)"},
{coding_APPLE_IMA4, "Apple Quicktime 4-bit IMA ADPCM"},
{coding_FSB_IMA, "FSB 4-bit IMA ADPCM"},
{coding_WWISE_IMA, "Audiokinetic Wwise 4-bit IMA ADPCM"},
@ -847,7 +847,7 @@ static const coding_info coding_info_list[] = {
{coding_CRANKCASE_IMA, "CrankcaseAudio REV 4-bit IMA ADPCM"},
{coding_MSADPCM, "Microsoft 4-bit ADPCM"},
{coding_MSADPCM_int, "Microsoft 4-bit ADPCM (mono/interleave)"},
{coding_MSADPCM_mono, "Microsoft 4-bit ADPCM (mono)"},
{coding_MSADPCM_ck, "Microsoft 4-bit ADPCM (Cricket Audio)"},
{coding_WS, "Westwood Studios VBR ADPCM"},
{coding_AICA, "Yamaha AICA 4-bit ADPCM"},

View File

@ -238,7 +238,7 @@ void blocked_count_samples(VGMSTREAM* vgmstream, STREAMFILE* sf, off_t offset) {
case coding_PCM16_int: block_samples = pcm16_bytes_to_samples(vgmstream->current_block_size, 1); break;
case coding_PCM8_int:
case coding_PCM8_U_int: block_samples = pcm8_bytes_to_samples(vgmstream->current_block_size, 1); break;
case coding_XBOX_IMA_int:
case coding_XBOX_IMA_mono:
case coding_XBOX_IMA: block_samples = xbox_ima_bytes_to_samples(vgmstream->current_block_size, 1); break;
case coding_NGC_DSP: block_samples = dsp_bytes_to_samples(vgmstream->current_block_size, 1); break;
case coding_PSX: block_samples = ps_bytes_to_samples(vgmstream->current_block_size,1); break;

View File

@ -54,7 +54,7 @@ VGMSTREAM* init_vgmstream_ads_midway(STREAMFILE* sf) {
case 0x00000021: /* Xbox */
start_offset = 0x28;
vgmstream->coding_type = coding_XBOX_IMA_int;
vgmstream->coding_type = coding_XBOX_IMA_mono;
vgmstream->num_samples = xbox_ima_bytes_to_samples(read_32bitBE(0x24,sf), vgmstream->channels);
vgmstream->layout_type = channels == 1 ? layout_none : layout_interleave;
vgmstream->interleave_block_size = 0x24;

View File

@ -1397,7 +1397,7 @@ static VGMSTREAM* init_vgmstream_ea_variable_header(STREAMFILE* sf, ea_header* e
break;
case EA_CODEC2_XBOXADPCM: /* XBOX IMA (split mono) */
vgmstream->coding_type = coding_XBOX_IMA_int;
vgmstream->coding_type = coding_XBOX_IMA_mono;
break;
case EA_CODEC2_GCADPCM: /* DSP */

View File

@ -236,7 +236,7 @@ VGMSTREAM* init_vgmstream_genh(STREAMFILE *sf) {
case coding_XBOX_IMA:
if (genh.codec_mode == 1) { /* mono interleave */
coding = coding_XBOX_IMA_int;
coding = coding_XBOX_IMA_mono;
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_last_block_size = genh.interleave_last;
vgmstream->interleave_block_size = genh.interleave;

View File

@ -181,7 +181,7 @@ static VGMSTREAM* init_vgmstream_ktsr_internal(STREAMFILE* sf, bool is_srsa) {
switch(ktsr.codec) {
case MSADPCM:
vgmstream->coding_type = coding_MSADPCM_int;
vgmstream->coding_type = coding_MSADPCM_mono;
vgmstream->layout_type = layout_none;
separate_offsets = 1;

View File

@ -869,7 +869,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(sf, &fmt, fact_sample_count, start_offset, data_size)) {
vgmstream->coding_type = coding_MSADPCM_int;
vgmstream->coding_type = coding_MSADPCM_mono;
vgmstream->codec_config = 1; /* mark as UE4 MSADPCM */
vgmstream->frame_size = fmt.block_size;
vgmstream->layout_type = layout_interleave;

View File

@ -53,7 +53,7 @@ VGMSTREAM* init_vgmstream_sthd(STREAMFILE* sf) {
vgmstream->coding_type = build_date >= 0x20170000 ? /* no apparent flags [Phantom Dust Remaster (PC)] */
coding_PCM16LE :
coding_XBOX_IMA_int;
coding_XBOX_IMA_mono;
vgmstream->layout_type = layout_blocked_sthd;
if (!vgmstream_open_stream(vgmstream,sf,start_offset))
@ -78,7 +78,7 @@ VGMSTREAM* init_vgmstream_sthd(STREAMFILE* sf) {
int block_samples = 0;
switch(vgmstream->coding_type) {
case coding_PCM16LE: block_samples = pcm16_bytes_to_samples(vgmstream->current_block_size, 1); break;
case coding_XBOX_IMA_int: block_samples = xbox_ima_bytes_to_samples(vgmstream->current_block_size, 1); break;
case coding_XBOX_IMA_mono: block_samples = xbox_ima_bytes_to_samples(vgmstream->current_block_size, 1); break;
default: goto fail;
}

View File

@ -480,7 +480,7 @@ VGMSTREAM* init_vgmstream_txth(STREAMFILE* sf) {
case coding_MSADPCM:
if (vgmstream->channels > 2) goto fail; //can't handle (to-do: only non-mono?)
if (txth.interleave && txth.frame_size) {
coding = coding_MSADPCM_int;
coding = coding_MSADPCM_mono;
vgmstream->frame_size = txth.frame_size;
vgmstream->interleave_block_size = txth.interleave;
vgmstream->layout_type = layout_interleave;
@ -493,7 +493,7 @@ VGMSTREAM* init_vgmstream_txth(STREAMFILE* sf) {
case coding_XBOX_IMA:
if (txth.codec_mode == 1) { /* mono interleave */
coding = coding_XBOX_IMA_int;
coding = coding_XBOX_IMA_mono;
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = txth.interleave;
vgmstream->interleave_last_block_size = txth.interleave_last;

View File

@ -1211,7 +1211,7 @@ int vgmstream_open_stream_bf(VGMSTREAM* vgmstream, STREAMFILE* sf, off_t start_o
}
if ((vgmstream->coding_type == coding_MSADPCM || vgmstream->coding_type == coding_MSADPCM_ck ||
vgmstream->coding_type == coding_MSADPCM_int ||
vgmstream->coding_type == coding_MSADPCM_mono ||
vgmstream->coding_type == coding_MS_IMA || vgmstream->coding_type == coding_MS_IMA_mono ||
vgmstream->coding_type == coding_PSX_cfg || vgmstream->coding_type == coding_PSX_pivotal
) &&
@ -1228,7 +1228,7 @@ int vgmstream_open_stream_bf(VGMSTREAM* vgmstream, STREAMFILE* sf, off_t start_o
if ((vgmstream->coding_type == coding_MSADPCM ||
vgmstream->coding_type == coding_MSADPCM_ck ||
vgmstream->coding_type == coding_MSADPCM_int) &&
vgmstream->coding_type == coding_MSADPCM_mono) &&
(vgmstream->frame_size == 0 || vgmstream->frame_size > MSADPCM_MAX_BLOCK_SIZE)) {
VGM_LOG("VGMSTREAM: MSADPCM decoder with wrong frame size %x\n", vgmstream->frame_size);
goto fail;

View File

@ -72,14 +72,14 @@ typedef enum {
coding_BLITZ_IMA, /* Blitz Games 4-bit IMA ADPCM */
coding_MS_IMA, /* Microsoft IMA ADPCM */
coding_MS_IMA_mono, /* Microsoft IMA ADPCM (mono/interleave) */
coding_MS_IMA_mono, /* Microsoft IMA ADPCM (mono) */
coding_XBOX_IMA, /* XBOX IMA ADPCM */
coding_XBOX_IMA_mch, /* XBOX IMA ADPCM (multichannel) */
coding_XBOX_IMA_int, /* XBOX IMA ADPCM (mono/interleave) */
coding_XBOX_IMA_mono, /* XBOX IMA ADPCM (mono) */
coding_NDS_IMA, /* IMA ADPCM w/ NDS layout */
coding_DAT4_IMA, /* Eurocom 'DAT4' IMA ADPCM */
coding_RAD_IMA, /* Radical IMA ADPCM */
coding_RAD_IMA_mono, /* Radical IMA ADPCM (mono/interleave) */
coding_RAD_IMA_mono, /* Radical IMA ADPCM (mono) */
coding_APPLE_IMA4, /* Apple Quicktime IMA4 */
coding_FSB_IMA, /* FMOD's FSB multichannel IMA ADPCM */
coding_WWISE_IMA, /* Audiokinetic Wwise IMA ADPCM */
@ -93,7 +93,7 @@ typedef enum {
coding_CRANKCASE_IMA, /* CrankcaseAudio REV IMA ADPCM */
coding_MSADPCM, /* Microsoft ADPCM (stereo/mono) */
coding_MSADPCM_int, /* Microsoft ADPCM (mono) */
coding_MSADPCM_mono, /* Microsoft ADPCM (mono) */
coding_MSADPCM_ck, /* Microsoft ADPCM (Cricket Audio variation) */
coding_WS, /* Westwood Studios VBR ADPCM */