Added HCA support to vgmstream.

CQTexperiment
Chris Moeller 2016-06-28 00:33:58 -07:00
parent 78ccb5d2bf
commit 21b67c92ac
9 changed files with 1946 additions and 7 deletions

View File

@ -12,6 +12,10 @@
830F885C19C9124C00420FB0 /* Vorbis.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 830F883919C9101900420FB0 /* Vorbis.framework */; };
8313E3E61902020400B4B6F1 /* mpg123.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8313E3431901FBDD00B4B6F1 /* mpg123.framework */; };
8313E3E71902021800B4B6F1 /* mpg123.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8313E3431901FBDD00B4B6F1 /* mpg123.framework */; };
8323894A1D22419B00482226 /* clHCA.c in Sources */ = {isa = PBXBuildFile; fileRef = 832389481D22419B00482226 /* clHCA.c */; };
8323894B1D22419B00482226 /* clHCA.h in Headers */ = {isa = PBXBuildFile; fileRef = 832389491D22419B00482226 /* clHCA.h */; settings = {ATTRIBUTES = (Public, ); }; };
832389501D2246C300482226 /* hca.c in Sources */ = {isa = PBXBuildFile; fileRef = 8323894F1D2246C300482226 /* hca.c */; };
832389521D224C0800482226 /* hca_decoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 832389511D224C0800482226 /* hca_decoder.c */; };
834D3A6E19F47C98001C54F6 /* g1l.c in Sources */ = {isa = PBXBuildFile; fileRef = 834D3A6D19F47C98001C54F6 /* g1l.c */; };
836F6B4718BDB8880095E648 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 836F6B4518BDB8880095E648 /* InfoPlist.strings */; };
836F6F1E18BDC2190095E648 /* acm_decoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 836F6DE018BDC2180095E648 /* acm_decoder.c */; };
@ -448,6 +452,10 @@
48C2650E1A5D420800A0A3D6 /* vorbisfile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = vorbisfile.h; path = ../Vorbis/include/vorbis/vorbisfile.h; sourceTree = "<group>"; };
8313E33D1901FBDC00B4B6F1 /* mpg123.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = mpg123.xcodeproj; path = ../mpg123/mpg123.xcodeproj; sourceTree = "<group>"; };
8315231718BDECA1009AE289 /* VorbisNoDot.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = VorbisNoDot.xcodeproj; path = ../Vorbis/macosx/VorbisNoDot.xcodeproj; sourceTree = "<group>"; };
832389481D22419B00482226 /* clHCA.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = clHCA.c; sourceTree = "<group>"; };
832389491D22419B00482226 /* clHCA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = clHCA.h; sourceTree = "<group>"; };
8323894F1D2246C300482226 /* hca.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = hca.c; sourceTree = "<group>"; };
832389511D224C0800482226 /* hca_decoder.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = hca_decoder.c; sourceTree = "<group>"; };
834D3A6D19F47C98001C54F6 /* g1l.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = g1l.c; sourceTree = "<group>"; };
836F6B3918BDB8880095E648 /* vgmstream.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = vgmstream.framework; sourceTree = BUILT_PRODUCTS_DIR; };
836F6B4418BDB8880095E648 /* vgmstream-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "vgmstream-Info.plist"; sourceTree = "<group>"; };
@ -806,6 +814,15 @@
name = Products;
sourceTree = "<group>";
};
832389471D22419B00482226 /* ext_libs */ = {
isa = PBXGroup;
children = (
832389481D22419B00482226 /* clHCA.c */,
832389491D22419B00482226 /* clHCA.h */,
);
path = ext_libs;
sourceTree = "<group>";
};
836F6B2F18BDB8880095E648 = {
isa = PBXGroup;
children = (
@ -846,6 +863,7 @@
836F6B4218BDB8880095E648 /* vgmstream */ = {
isa = PBXGroup;
children = (
832389471D22419B00482226 /* ext_libs */,
836F6DDE18BDC2180095E648 /* src */,
836F6B4318BDB8880095E648 /* Supporting Files */,
);
@ -881,6 +899,7 @@
836F6DDF18BDC2180095E648 /* coding */ = {
isa = PBXGroup;
children = (
832389511D224C0800482226 /* hca_decoder.c */,
83D7318B1A749EEE00CA1366 /* g719_decoder.c */,
836F6DE018BDC2180095E648 /* acm_decoder.c */,
836F6DE118BDC2180095E648 /* acm_decoder.h */,
@ -961,6 +980,7 @@
836F6E2718BDC2180095E648 /* meta */ = {
isa = PBXGroup;
children = (
8323894F1D2246C300482226 /* hca.c */,
83EDE5D61A70951A005F5D84 /* mca.c */,
83EDE5D71A70951A005F5D84 /* btsnd.c */,
834D3A6D19F47C98001C54F6 /* g1l.c */,
@ -1237,6 +1257,7 @@
836F6F3518BDC2190095E648 /* nwa_decoder.h in Headers */,
836F6F2718BDC2190095E648 /* g72x_state.h in Headers */,
836F705418BDC2190095E648 /* streamfile.h in Headers */,
8323894B1D22419B00482226 /* clHCA.h in Headers */,
836F705918BDC2190095E648 /* vgmstream.h in Headers */,
48C2650F1A5D420800A0A3D6 /* vorbisfile.h in Headers */,
836F705718BDC2190095E648 /* util.h in Headers */,
@ -1426,6 +1447,7 @@
836F6F3318BDC2190095E648 /* ngc_dtk_decoder.c in Sources */,
836F6FBB18BDC2190095E648 /* ngca.c in Sources */,
836F6F5218BDC2190095E648 /* ps2_adm_blocked.c in Sources */,
832389521D224C0800482226 /* hca_decoder.c in Sources */,
836F6F9418BDC2190095E648 /* ivb.c in Sources */,
836F6FF118BDC2190095E648 /* ps2_psw.c in Sources */,
836F6F8D18BDC2190095E648 /* gsp_gsb.c in Sources */,
@ -1643,6 +1665,7 @@
836F6FBE18BDC2190095E648 /* ogg_vorbis_file.c in Sources */,
836F702618BDC2190095E648 /* s14_sss.c in Sources */,
836F6F4818BDC2190095E648 /* halpst_blocked.c in Sources */,
8323894A1D22419B00482226 /* clHCA.c in Sources */,
836F702E18BDC2190095E648 /* sli.c in Sources */,
836F701D18BDC2190095E648 /* raw.c in Sources */,
836F6FDE18BDC2190095E648 /* ps2_ild.c in Sources */,
@ -1688,6 +1711,7 @@
836F702718BDC2190095E648 /* sat_baka.c in Sources */,
836F6F8C18BDC2190095E648 /* gh3_bar.c in Sources */,
836F704B18BDC2190095E648 /* xbox_xmu.c in Sources */,
832389501D2246C300482226 /* hca.c in Sources */,
836F701B18BDC2190095E648 /* psx_gms.c in Sources */,
836F700518BDC2190095E648 /* ps2_vbk.c in Sources */,
836F6FDF18BDC2190095E648 /* ps2_int.c in Sources */,
@ -1766,6 +1790,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = "$(SRCROOT)/vgmstream/ext_libs";
INSTALL_PATH = "@loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.7;
ONLY_ACTIVE_ARCH = YES;
@ -1805,6 +1830,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = "$(SRCROOT)/vgmstream/ext_libs";
INSTALL_PATH = "@loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.7;
SDKROOT = macosx;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,66 @@
#ifndef _clHCA_H
#define _clHCA_H
#ifdef __cplusplus
extern "C" {
#endif
enum { clHCA_samplesPerBlock = 0x80 * 8 };
/* Must pass at least 8 bytes of data to this function. Returns -1 on non-match, or
* positive byte count on success. */
int clHCA_isOurFile0(const void *data);
/* Must pass a full header block for success. Returns 0 on success, -1 on failure. */
int clHCA_isOurFile1(const void *data, unsigned int size);
/* The opaque state structure. */
typedef struct clHCA clHCA;
/* In case you wish to allocate the structure on your own. */
int clHCA_sizeof();
void clHCA_clear(clHCA *, unsigned int ciphKey1, unsigned int ciphKey2);
/* Or you could let the library allocate it. */
clHCA * clHCA_new(unsigned int ciphKey1, unsigned int ciphKey2);
void clHCA_delete(clHCA *);
/* Requires a pre-allocated data structure.
* Before any decoding may be performed, the header block must be passed in.
* The recommended way of doing this is to detect the header length with
* clHCA_isOurFile0, validate the header with clHCA_isOurFile1, then pass
* it to this function, with the address of 0.
* Subsequent decodes with non-zero address are assumed to be sample blocks,
* and should be of the blockSize returned by the clHCA_getInfo function.
* Returns 0 on success, -1 on failure. */
int clHCA_Decode(clHCA *, void *data, unsigned int size, unsigned int address);
/* This is the simplest decode function, for signed and clipped 16 bit samples.
* May be called after clHCA_Decode, and will return the same data until the next
* block of sample data is passed to clHCA_Decode. */
void clHCA_DecodeSamples16(clHCA *, signed short * outSamples);
typedef struct clHCA_stInfo {
unsigned int version;
unsigned int dataOffset;
unsigned int samplingRate;
unsigned int channelCount;
unsigned int blockSize;
unsigned int blockCount;
unsigned int loopEnabled;
unsigned int loopStart;
unsigned int loopEnd;
} clHCA_stInfo;
/* Retrieve information relevant for decoding and playback with this function.
* Must be called after successfully decoding a header block with clHCA_Decode,
* or else it will fail.
* Returns 0 on success, -1 on failure. */
int clHCA_getInfo(clHCA *, clHCA_stInfo *out);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,82 @@
#include "../vgmstream.h"
void decode_hca(hca_codec_data * data, sample * outbuf, int32_t samples_to_do, int channels) {
int samples_done = 0;
int32_t samples_remain = clHCA_samplesPerBlock - data->sample_ptr;
void *hca_data = NULL;
clHCA *hca;
if ( data->samples_discard ) {
if ( samples_remain <= data->samples_discard ) {
data->samples_discard -= samples_remain;
samples_remain = 0;
}
else {
samples_remain -= data->samples_discard;
data->sample_ptr += data->samples_discard;
data->samples_discard = 0;
}
}
if ( samples_remain > samples_to_do ) samples_remain = samples_to_do;
memcpy( outbuf, data->sample_buffer + data->sample_ptr * data->info.channelCount, samples_remain * data->info.channelCount * sizeof(sample) );
outbuf += samples_remain * data->info.channelCount;
data->sample_ptr += samples_remain;
samples_done += samples_remain;
hca_data = malloc( data->info.blockSize );
if ( !hca_data ) return;
hca = (clHCA *)(data + 1);
while ( samples_done < samples_to_do ) {
const unsigned int blockSize = data->info.blockSize;
const unsigned int channelCount = data->info.channelCount;
const unsigned int address = data->info.dataOffset + data->curblock * blockSize;
if (data->curblock >= data->info.blockCount) {
memset(outbuf, 0, (samples_to_do - samples_done) * channelCount * sizeof(sample));
break;
}
if ( read_streamfile((uint8_t*) hca_data, data->start + address, blockSize, data->streamfile) != blockSize )
break;
if ( clHCA_Decode( hca, hca_data, blockSize, address ) < 0 )
break;
++data->curblock;
clHCA_DecodeSamples16( hca, data->sample_buffer );
samples_remain = clHCA_samplesPerBlock;
data->sample_ptr = 0;
if ( data->samples_discard ) {
if ( samples_remain <= data->samples_discard ) {
data->samples_discard -= samples_remain;
samples_remain = 0;
}
else {
samples_remain -= data->samples_discard;
data->sample_ptr = data->samples_discard;
data->samples_discard = 0;
}
}
if ( samples_remain > samples_to_do - samples_done ) samples_remain = samples_to_do - samples_done;
memcpy( outbuf, data->sample_buffer, samples_remain * channelCount * sizeof(sample) );
samples_done += samples_remain;
outbuf += samples_remain * channelCount;
data->sample_ptr = samples_remain;
}
free( hca_data );
}

View File

@ -0,0 +1,98 @@
#include "../vgmstream.h"
#include "meta.h"
#include "../util.h"
VGMSTREAM * init_vgmstream_hca_offset(STREAMFILE *streamFile, uint64_t start, uint64_t size);
VGMSTREAM * init_vgmstream_hca(STREAMFILE *streamFile) {
return init_vgmstream_hca_offset( streamFile, 0, streamFile->get_size(streamFile) );
}
VGMSTREAM * init_vgmstream_hca_offset(STREAMFILE *streamFile, uint64_t start, uint64_t size) {
/* These I don't know about... */
static const unsigned int ciphKey1=0x30DBE1AB;
static const unsigned int ciphKey2=0xCC554639;
VGMSTREAM * vgmstream = NULL;
char filename[PATH_LIMIT];
hca_codec_data * hca_file = ( hca_codec_data * ) calloc(1, sizeof(hca_codec_data) + clHCA_sizeof());
void * hca_data = NULL;
clHCA * hca;
uint8_t header[8];
int header_size;
if ( !hca_file ) goto fail;
if ( size < 8 ) goto fail;
hca_file->streamfile = streamFile;
hca_file->start = start;
hca_file->size = size;
if ( read_streamfile( header, start, 8, streamFile) != 8 ) goto fail;
header_size = clHCA_isOurFile0( header );
if ( header_size < 0 ) goto fail;
hca_data = malloc( header_size );
if ( !hca_data ) goto fail;
memcpy( hca_data, header, 8 );
if ( read_streamfile( ((uint8_t*)hca_data) + 8, start + 8, header_size - 8, streamFile ) != header_size - 8 ) goto fail;
if ( clHCA_isOurFile1( hca_data, header_size ) < 0 ) goto fail;
hca = (clHCA *)(hca_file + 1);
clHCA_clear(hca, ciphKey1, ciphKey2);
if (clHCA_Decode(hca, hca_data, header_size, 0) < 0) goto fail;
if (clHCA_getInfo(hca, &hca_file->info) < 0) goto fail;
hca_file->sample_ptr = clHCA_samplesPerBlock;
hca_file->samples_discard = 0;
streamFile->get_name( streamFile, filename, sizeof(filename) );
hca_file->streamfile = streamFile->open(streamFile, filename, STREAMFILE_DEFAULT_BUFFER_SIZE);
if (!hca_file->streamfile) goto fail;
vgmstream = allocate_vgmstream( hca_file->info.channelCount, 1 );
if (!vgmstream) goto fail;
free( hca_data );
vgmstream->loop_flag = hca_file->info.loopEnabled;
vgmstream->loop_start_sample = hca_file->info.loopStart * clHCA_samplesPerBlock;
vgmstream->loop_end_sample = hca_file->info.loopEnd * clHCA_samplesPerBlock;
vgmstream->codec_data = hca_file;
vgmstream->channels = hca_file->info.channelCount;
vgmstream->sample_rate = hca_file->info.samplingRate;
vgmstream->num_samples = hca_file->info.blockCount * clHCA_samplesPerBlock;
vgmstream->coding_type = coding_CRI_HCA;
vgmstream->layout_type = layout_none;
vgmstream->meta_type = meta_HCA;
return vgmstream;
fail:
if ( hca_data ) {
free( hca_data );
}
if ( hca_file ) {
free( hca_file );
}
return NULL;
}

View File

@ -111,6 +111,10 @@ VGMSTREAM * init_vgmstream_ogg_vorbis_callbacks(STREAMFILE *streamFile, const ch
VGMSTREAM * init_vgmstream_sli_ogg(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_hca(STREAMFILE *streamFile);
VGMSTREAM * init_vgmstream_hca_offset(STREAMFILE *streamFile, uint64_t start, uint64_t size);
#if defined(VGM_USE_MP4V2) && defined(VGM_USE_FDKAAC)
VGMSTREAM * init_vgmstream_mp4_aac(STREAMFILE * streamFile);

View File

@ -338,6 +338,7 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
init_vgmstream_bcstm,
init_vgmstream_3ds_idsp,
init_vgmstream_g1l,
init_vgmstream_hca,
};
#define INIT_VGMSTREAM_FCNS (sizeof(init_vgmstream_fcns)/sizeof(init_vgmstream_fcns[0]))
@ -432,6 +433,13 @@ void reset_vgmstream(VGMSTREAM * vgmstream) {
ov_pcm_seek(ogg_vorbis_file, 0);
}
#endif
if (vgmstream->coding_type==coding_CRI_HCA) {
hca_codec_data *data = vgmstream->codec_data;
clHCA *hca = (clHCA *)(data + 1);
data->curblock = 0;
data->sample_ptr = clHCA_samplesPerBlock;
data->samples_discard = 0;
}
#if defined(VGM_USE_MP4V2) && defined(VGM_USE_FDKAAC)
if (vgmstream->coding_type==coding_MP4_AAC) {
mp4_aac_codec_data *data = vgmstream->codec_data;
@ -623,6 +631,12 @@ void close_vgmstream(VGMSTREAM * vgmstream) {
}
}
#endif
if (vgmstream->coding_type==coding_CRI_HCA) {
if (vgmstream->codec_data) {
free(vgmstream->codec_data);
vgmstream->codec_data = NULL;
}
}
#if defined(VGM_USE_MP4V2) && defined(VGM_USE_FDKAAC)
if (vgmstream->coding_type==coding_MP4_AAC) {
@ -1018,6 +1032,8 @@ int get_vgmstream_samples_per_frame(VGMSTREAM * vgmstream) {
return 54;
case coding_MTAF:
return 0x80*2;
case coding_CRI_HCA:
return clHCA_samplesPerBlock;
#if defined(VGM_USE_MP4V2) && defined(VGM_USE_FDKAAC)
case coding_MP4_AAC:
return ((mp4_aac_codec_data*)vgmstream->codec_data)->samples_per_frame;
@ -1399,6 +1415,11 @@ void decode_vgmstream(VGMSTREAM * vgmstream, int samples_written, int samples_to
vgmstream->channels);
break;
#endif
case coding_CRI_HCA:
decode_hca(vgmstream->codec_data,
buffer+samples_written*vgmstream->channels,samples_to_do,
vgmstream->channels);
break;
#if defined(VGM_USE_MP4V2) && defined(VGM_USE_FDKAAC)
case coding_MP4_AAC:
decode_mp4_aac(vgmstream->codec_data,
@ -1685,6 +1706,12 @@ int vgmstream_do_loop(VGMSTREAM * vgmstream) {
ov_pcm_seek_lap(ogg_vorbis_file, vgmstream->loop_sample);
}
#endif
if (vgmstream->coding_type==coding_CRI_HCA) {
hca_codec_data *data = (hca_codec_data *)(vgmstream->codec_data);
data->curblock = data->info.loopStart;
data->sample_ptr = clHCA_samplesPerBlock;
data->samples_discard = 0;
}
#if defined(VGM_USE_MP4V2) && defined(VGM_USE_FDKAAC)
if (vgmstream->coding_type==coding_MP4_AAC) {
mp4_aac_codec_data *data = (mp4_aac_codec_data *)(vgmstream->codec_data);
@ -3314,7 +3341,7 @@ fail:
static int get_vgmstream_channel_count(VGMSTREAM * vgmstream)
{
if (vgmstream->layout_type==layout_scd_int) {
scd_int_codec_data *data = vgmstream->codec_data;
scd_int_codec_data *data = (scd_int_codec_data *) vgmstream->codec_data;
if (data) {
return data->substream_count;
}
@ -3324,7 +3351,7 @@ static int get_vgmstream_channel_count(VGMSTREAM * vgmstream)
}
#ifdef VGM_USE_VORBIS
if (vgmstream->coding_type==coding_ogg_vorbis) {
ogg_vorbis_codec_data *data = vgmstream->codec_data;
ogg_vorbis_codec_data *data = (ogg_vorbis_codec_data *) vgmstream->codec_data;
if (data) {
return 1;
@ -3334,9 +3361,19 @@ static int get_vgmstream_channel_count(VGMSTREAM * vgmstream)
}
}
#endif
if (vgmstream->coding_type==coding_CRI_HCA) {
hca_codec_data *data = (hca_codec_data *) vgmstream->codec_data;
if (data) {
return 1;
}
else {
return 0;
}
}
#if defined(VGM_USE_MP4V2) && defined(VGM_USE_FDKAAC)
if (vgmstream->coding_type==coding_MP4_AAC) {
mp4_aac_codec_data *data = vgmstream->codec_data;
mp4_aac_codec_data *data = (mp4_aac_codec_data *) vgmstream->codec_data;
if (data) {
return 1;
}
@ -3351,19 +3388,24 @@ static int get_vgmstream_channel_count(VGMSTREAM * vgmstream)
static STREAMFILE * get_vgmstream_streamfile(VGMSTREAM * vgmstream, int channel)
{
if (vgmstream->layout_type==layout_scd_int) {
scd_int_codec_data *data = vgmstream->codec_data;
scd_int_codec_data *data = (scd_int_codec_data *) vgmstream->codec_data;
return data->intfiles[channel];
}
#ifdef VGM_USE_VORBIS
if (vgmstream->coding_type==coding_ogg_vorbis) {
ogg_vorbis_codec_data *data = vgmstream->codec_data;
ogg_vorbis_codec_data *data = (ogg_vorbis_codec_data *) vgmstream->codec_data;
return data->ov_streamfile.streamfile;
}
#endif
if (vgmstream->coding_type==coding_CRI_HCA) {
hca_codec_data *data = (hca_codec_data *) vgmstream->codec_data;
return data->streamfile;
}
#if defined(VGM_USE_MP4V2) && defined(VGM_USE_FDKAAC)
if (vgmstream->coding_type==coding_MP4_AAC) {
mp4_aac_codec_data *data = vgmstream->codec_data;
mp4_aac_codec_data *data = (mp4_aac_codec_data *) vgmstream->codec_data;
return data->if_file.streamfile;
}
#endif

View File

@ -53,6 +53,8 @@ enum { PATH_LIMIT = 32768 };
#include "maiatrac3plus.h"
#endif
#include "clHCA.h"
#ifdef BUILD_VGMSTREAM
#include "coding/acm_decoder.h"
#include "coding/nwa_decoder.h"
@ -162,6 +164,8 @@ typedef enum {
coding_LSF, /* lsf ADPCM */
coding_MTAF, /* Konami IMA-derived MTAF ADPCM */
coding_CRI_HCA, /* CRI High Compression Audio */
#if defined(VGM_USE_MP4V2) && defined(VGM_USE_FDKAAC)
coding_MP4_AAC,
#endif
@ -593,6 +597,7 @@ typedef enum {
meta_G1L, // Tecmo Koei G1L
meta_MCA, // Capcom MCA "MADP"
meta_XB3D_ADX, // Xenoblade Chronicles 3D ADX
meta_HCA,
#ifdef VGM_USE_MP4V2
meta_MP4,
#endif
@ -826,6 +831,17 @@ typedef struct {
STREAMFILE **intfiles;
} scd_int_codec_data;
typedef struct {
STREAMFILE *streamfile;
uint64_t start;
uint64_t size;
clHCA_stInfo info;
unsigned int curblock;
unsigned int sample_ptr, samples_discard;
signed short sample_buffer[clHCA_samplesPerBlock * 16];
// clHCA exists here
} hca_codec_data;
#ifdef VGM_USE_MP4V2
typedef struct {
STREAMFILE *streamfile;

View File

@ -226,7 +226,7 @@ err1:
+ (NSArray *)fileTypes
{
return [NSArray arrayWithObjects:@"2dx9", @"aaap", @"aax", @"acm", @"adp", @"adpcm", @"ads", @"adx", @"afc", @"agsc", @"ahx",@"aifc", @"aiff", @"aix", @"amts", @"as4", @"asd", @"asf", @"asr", @"ass", @"ast", @"aud", @"aus", @"baf", @"baka", @"bar", @"bcstm", @"bcwav", @"bfstm", @"bfwav", @"bfwavnsmbu", @"bg00", @"bgw", @"bh2pcm", @"bmdx", @"bns", @"bnsf", @"bo2", @"brstm", @"caf", @"capdsp", @"ccc", @"cfn", @"cnk", @"dcs", @"dcsw", @"ddsp", @"de2", @"dmsg", @"dsp", @"dvi", @"dxh", @"eam", @"emff", @"enth", @"fag", @"filp", @"fsb", @"fwav", @"gca", @"gcm", @"gcsw", @"gcw", @"genh", @"gms", @"gsp", @"hgc1", @"his", @"hps", @"hwas", @"idsp", @"idvi", @"ikm", @"ild", @"int", @"isd", @"ish", @"ivaud", @"ivb", @"joe", @"kces", @"kcey", @"khv", @"kraw", @"leg", @"logg", @"lps", @"lsf", @"lwav", @"matx", @"mcg", @"mi4", @"mib", @"mic", @"mihb", @"mpdsp", @"msa", @"mss", @"msvp", @"mus", @"musc", @"musx", @"mwv", @"myspd", @"ndp", @"npsf", @"nus3bank", @"nwa", @"omu", @"otm", @"p3d", @"pcm", @"pdt", @"pnb", @"pos", @"psh", @"psw", @"raw", @"rkv", @"rnd", @"rrds", @"rsd", @"rsf", @"rstm", @"rwar", @"rwav", @"rws", @"rwsd", @"rwx", @"rxw", @"s14", @"sab", @"sad", @"sap", @"sc", @"scd", @"sd9", @"sdt", @"seg", @"sfl", @"sfs", @"sl3", @"sli", @"smp", @"smpl", @"snd", @"sng", @"sns", @"spd", @"sps", @"spsd", @"spt", @"spw", @"ss2", @"ss7", @"ssm", @"sss", @"ster", @"sth", @"stm", @"stma", @"str", @"strm", @"sts", @"stx", @"svag", @"svs", @"swav", @"swd", @"tec", @"thp", @"tk5", @"tydsp", @"um3", @"vag", @"vas", @"vgs", @"vig", @"vjdsp", @"voi", @"vpk", @"vs", @"vsf", @"waa", @"wac", @"wad", @"wam", @"was", @"wavm", @"wb", @"wii", @"wp2", @"wsd", @"wsi", @"wvs", @"xa", @"xa2", @"xa30", @"xmu", @"xss", @"xvas", @"xwav", @"xwb", @"ydsp", @"ymf", @"zsd", @"zwdsp", nil];
return [NSArray arrayWithObjects:@"2dx9", @"aaap", @"aax", @"acm", @"adp", @"adpcm", @"ads", @"adx", @"afc", @"agsc", @"ahx",@"aifc", @"aiff", @"aix", @"amts", @"as4", @"asd", @"asf", @"asr", @"ass", @"ast", @"aud", @"aus", @"baf", @"baka", @"bar", @"bcstm", @"bcwav", @"bfstm", @"bfwav", @"bfwavnsmbu", @"bg00", @"bgw", @"bh2pcm", @"bmdx", @"bns", @"bnsf", @"bo2", @"brstm", @"caf", @"capdsp", @"ccc", @"cfn", @"cnk", @"dcs", @"dcsw", @"ddsp", @"de2", @"dmsg", @"dsp", @"dvi", @"dxh", @"eam", @"emff", @"enth", @"fag", @"filp", @"fsb", @"fwav", @"gca", @"gcm", @"gcsw", @"gcw", @"genh", @"gms", @"gsp", @"hca", @"hgc1", @"his", @"hps", @"hwas", @"idsp", @"idvi", @"ikm", @"ild", @"int", @"isd", @"ish", @"ivaud", @"ivb", @"joe", @"kces", @"kcey", @"khv", @"kraw", @"leg", @"logg", @"lps", @"lsf", @"lwav", @"matx", @"mcg", @"mi4", @"mib", @"mic", @"mihb", @"mpdsp", @"msa", @"mss", @"msvp", @"mus", @"musc", @"musx", @"mwv", @"myspd", @"ndp", @"npsf", @"nus3bank", @"nwa", @"omu", @"otm", @"p3d", @"pcm", @"pdt", @"pnb", @"pos", @"psh", @"psw", @"raw", @"rkv", @"rnd", @"rrds", @"rsd", @"rsf", @"rstm", @"rwar", @"rwav", @"rws", @"rwsd", @"rwx", @"rxw", @"s14", @"sab", @"sad", @"sap", @"sc", @"scd", @"sd9", @"sdt", @"seg", @"sfl", @"sfs", @"sl3", @"sli", @"smp", @"smpl", @"snd", @"sng", @"sns", @"spd", @"sps", @"spsd", @"spt", @"spw", @"ss2", @"ss7", @"ssm", @"sss", @"ster", @"sth", @"stm", @"stma", @"str", @"strm", @"sts", @"stx", @"svag", @"svs", @"swav", @"swd", @"tec", @"thp", @"tk5", @"tydsp", @"um3", @"vag", @"vas", @"vgs", @"vig", @"vjdsp", @"voi", @"vpk", @"vs", @"vsf", @"waa", @"wac", @"wad", @"wam", @"was", @"wavm", @"wb", @"wii", @"wp2", @"wsd", @"wsi", @"wvs", @"xa", @"xa2", @"xa30", @"xmu", @"xss", @"xvas", @"xwav", @"xwb", @"ydsp", @"ymf", @"zsd", @"zwdsp", nil];
}
+ (NSArray *)mimeTypes