diff --git a/src/coding/acm_decoder.c b/src/coding/acm_decoder.c index 9aa4e6ba..2261aa3f 100644 --- a/src/coding/acm_decoder.c +++ b/src/coding/acm_decoder.c @@ -1,5 +1,5 @@ #include "coding.h" -#include "acm_decoder_libacm.h" +#include "libs/libacm.h" #include /* libacm 1.2 (despite what libacm.h says) from: https://github.com/markokr/libacm */ diff --git a/src/coding/circus_decoder.c b/src/coding/circus_decoder.c index c32e32e9..44919724 100644 --- a/src/coding/circus_decoder.c +++ b/src/coding/circus_decoder.c @@ -1,5 +1,5 @@ #include "coding.h" -#include "circus_decoder_lib.h" +#include "libs/circus_vq_lib.h" diff --git a/src/coding/coding.h b/src/coding/coding.h index 0cbd1691..a2d47108 100644 --- a/src/coding/coding.h +++ b/src/coding/coding.h @@ -5,7 +5,7 @@ #include "../util/reader_sf.h" #include "../util/reader_get_nibbles.h" //todo remove -#include "hca_decoder_clhca.h" +#include "libs/clhca.h" /* adx_decoder */ void decode_adx(VGMSTREAMCHANNEL* stream, sample_t* outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do, int32_t frame_bytes, coding_t coding_type, uint32_t codec_config); diff --git a/src/coding/compresswave_decoder.c b/src/coding/compresswave_decoder.c index ecd78fcf..f61e8ab2 100644 --- a/src/coding/compresswave_decoder.c +++ b/src/coding/compresswave_decoder.c @@ -1,6 +1,6 @@ #include "coding.h" #include "coding_utils_samples.h" -#include "compresswave_decoder_lib.h" +#include "libs/compresswave_lib.h" #define COMPRESSWAVE_MAX_FRAME_SAMPLES 0x1000 /* arbitrary but should be multiple of 2 for 22050 mode */ diff --git a/src/coding/g7221_decoder.c b/src/coding/g7221_decoder.c index fa822edc..2646304d 100644 --- a/src/coding/g7221_decoder.c +++ b/src/coding/g7221_decoder.c @@ -1,7 +1,7 @@ #include "coding.h" #ifdef VGM_USE_G7221 -#include "g7221_decoder_lib.h" +#include "libs/g7221_lib.h" #define G7221_MAX_FRAME_SIZE 0x78 /* 960/8 */ #define G7221_MAX_FRAME_SAMPLES 640 /* 32000/50 */ diff --git a/src/coding/hca_decoder.c b/src/coding/hca_decoder.c index bd4a995c..b7586891 100644 --- a/src/coding/hca_decoder.c +++ b/src/coding/hca_decoder.c @@ -1,5 +1,5 @@ #include "coding.h" -#include "hca_decoder_clhca.h" +#include "libs/clhca.h" struct hca_codec_data { diff --git a/src/coding/ice_decoder.c b/src/coding/ice_decoder.c index 3dd77e89..cfe5478a 100644 --- a/src/coding/ice_decoder.c +++ b/src/coding/ice_decoder.c @@ -1,5 +1,5 @@ #include "coding.h" -#include "ice_decoder_icelib.h" +#include "libs/icelib.h" typedef struct { diff --git a/src/coding/circus_decoder_lib_data.h b/src/coding/libs/circus_vq_data.h similarity index 99% rename from src/coding/circus_decoder_lib_data.h rename to src/coding/libs/circus_vq_data.h index 6893d145..2fe547f4 100644 --- a/src/coding/circus_decoder_lib_data.h +++ b/src/coding/libs/circus_vq_data.h @@ -1,5 +1,5 @@ -#ifndef _CIRCUS_DECODER_LIB_DATA_H_ -#define _CIRCUS_DECODER_LIB_DATA_H_ +#ifndef _CIRCUS_VQ_DATA_H_ +#define _CIRCUS_VQ_DATA_H_ #include diff --git a/src/coding/circus_decoder_lib.c b/src/coding/libs/circus_vq_lib.c similarity index 99% rename from src/coding/circus_decoder_lib.c rename to src/coding/libs/circus_vq_lib.c index a9e108f8..dc7331cc 100644 --- a/src/coding/circus_decoder_lib.c +++ b/src/coding/libs/circus_vq_lib.c @@ -14,14 +14,14 @@ * https://bitbucket.org/losnoco/foo_adpcm/src/master/foo_oki/source/libpcm/libpcm.cpp */ -#include "circus_decoder_lib.h" -#include "circus_decoder_lib_data.h" +#include "circus_vq_lib.h" +#include "circus_vq_data.h" -#include "circus_decoder_lzxpcm.h" +#include "circus_vq_lzxpcm.h" /* use miniz (API-compatible) to avoid adding external zlib just for this codec * - https://github.com/richgel999/miniz */ -#include "../util/miniz.h" +#include "../../util/miniz.h" //#include "zlib.h" diff --git a/src/coding/circus_decoder_lib.h b/src/coding/libs/circus_vq_lib.h similarity index 78% rename from src/coding/circus_decoder_lib.h rename to src/coding/libs/circus_vq_lib.h index bc02d839..d5162724 100644 --- a/src/coding/circus_decoder_lib.h +++ b/src/coding/libs/circus_vq_lib.h @@ -1,7 +1,7 @@ -#ifndef _CIRCUS_DECODER_LIB_H_ -#define _CIRCUS_DECODER_LIB_H_ +#ifndef _CIRCUS_VQ_LIB_H_ +#define _CIRCUS_VQ_LIB_H_ -#include "../streamfile.h" +#include "../../streamfile.h" typedef struct circus_handle_t circus_handle_t; diff --git a/src/coding/circus_decoder_lzxpcm.h b/src/coding/libs/circus_vq_lzxpcm.h similarity index 99% rename from src/coding/circus_decoder_lzxpcm.h rename to src/coding/libs/circus_vq_lzxpcm.h index c4d60f24..d6543872 100644 --- a/src/coding/circus_decoder_lzxpcm.h +++ b/src/coding/libs/circus_vq_lzxpcm.h @@ -1,3 +1,6 @@ +#ifndef _CIRCUS_VQ_LZXPCM_H_ +#define _CIRCUS_VQ_LZXPCM_H_ + #include #include #include @@ -295,3 +298,5 @@ static int lzxpcm_decompress_full(uint8_t* dst, size_t dst_size, const uint8_t* return 0; } #endif + +#endif diff --git a/src/coding/hca_decoder_clhca.c b/src/coding/libs/clhca.c similarity index 99% rename from src/coding/hca_decoder_clhca.c rename to src/coding/libs/clhca.c index 2b0dd179..ea8438aa 100644 --- a/src/coding/hca_decoder_clhca.c +++ b/src/coding/libs/clhca.c @@ -25,7 +25,7 @@ //-------------------------------------------------- // Includes //-------------------------------------------------- -#include "hca_decoder_clhca.h" +#include "clhca.h" #include #include #include diff --git a/src/coding/hca_decoder_clhca.h b/src/coding/libs/clhca.h similarity index 97% rename from src/coding/hca_decoder_clhca.h rename to src/coding/libs/clhca.h index 16089ce4..60cba319 100644 --- a/src/coding/hca_decoder_clhca.h +++ b/src/coding/libs/clhca.h @@ -1,9 +1,5 @@ -#ifndef _clHCA_H -#define _clHCA_H - -#ifdef __cplusplus -extern "C" { -#endif +#ifndef _CLHCA_H_ +#define _CLHCA_H_ /* Must pass at least 8 bytes of data to this function. @@ -86,8 +82,4 @@ int clHCA_TestBlock(clHCA *hca, void *data, unsigned int size); * Without it there are minor differences, mainly useful when testing a new key. */ void clHCA_DecodeReset(clHCA * hca); -#ifdef __cplusplus -} -#endif - #endif diff --git a/src/coding/compresswave_decoder_lib.c b/src/coding/libs/compresswave_lib.c similarity index 99% rename from src/coding/compresswave_decoder_lib.c rename to src/coding/libs/compresswave_lib.c index 770efc39..1e87106a 100644 --- a/src/coding/compresswave_decoder_lib.c +++ b/src/coding/libs/compresswave_lib.c @@ -1,4 +1,4 @@ -#include "compresswave_decoder_lib.h" +#include "compresswave_lib.h" #include #include #include diff --git a/src/coding/compresswave_decoder_lib.h b/src/coding/libs/compresswave_lib.h similarity index 89% rename from src/coding/compresswave_decoder_lib.h rename to src/coding/libs/compresswave_lib.h index ae53e2cc..f97ffd85 100644 --- a/src/coding/compresswave_decoder_lib.h +++ b/src/coding/libs/compresswave_lib.h @@ -1,6 +1,6 @@ -#ifndef _COMPRESSWAVE_DECODER_LIB_H -#define _COMPRESSWAVE_DECODER_LIB_H -#include "../streamfile.h" +#ifndef _COMPRESSWAVE_LIB_H +#define _COMPRESSWAVE_LIB_H +#include "../../streamfile.h" typedef struct TCompressWaveData TCompressWaveData; @@ -24,4 +24,4 @@ float TCompressWaveData_GetFade(TCompressWaveData* this); float TCompressWaveData_GetPlayTime(TCompressWaveData* this); float TCompressWaveData_GetTotalTime(TCompressWaveData* this); -#endif /*_COMPRESSWAVE_DECODER_LIB_H */ +#endif /*_COMPRESSWAVE_LIB_H */ diff --git a/src/coding/g7221_decoder_aes.c b/src/coding/libs/g7221_aes.c similarity index 99% rename from src/coding/g7221_decoder_aes.c rename to src/coding/libs/g7221_aes.c index 7d3560c1..6f6e169e 100644 --- a/src/coding/g7221_decoder_aes.c +++ b/src/coding/libs/g7221_aes.c @@ -1,5 +1,5 @@ #include -#include "g7221_decoder_aes.h" +#include "g7221_aes.h" /* Namco's NUS AES is just standard AES-192 in ECB mode, so this can be swapped with another lib, * if more code needs AES. Most implementations out there either use pre-calculated look-up tables, diff --git a/src/coding/g7221_decoder_aes.h b/src/coding/libs/g7221_aes.h similarity index 100% rename from src/coding/g7221_decoder_aes.h rename to src/coding/libs/g7221_aes.h diff --git a/src/coding/g7221_decoder_lib_data.h b/src/coding/libs/g7221_data.h similarity index 99% rename from src/coding/g7221_decoder_lib_data.h rename to src/coding/libs/g7221_data.h index eace8184..2cf34d7b 100644 --- a/src/coding/g7221_decoder_lib_data.h +++ b/src/coding/libs/g7221_data.h @@ -1,5 +1,5 @@ -#ifndef _DATA_H_ -#define _DATA_H_ +#ifndef _G7221_DATA_H_ +#define _G7221_DATA_H_ #include diff --git a/src/coding/g7221_decoder_lib.c b/src/coding/libs/g7221_lib.c similarity index 99% rename from src/coding/g7221_decoder_lib.c rename to src/coding/libs/g7221_lib.c index 976737ee..5550090a 100644 --- a/src/coding/g7221_decoder_lib.c +++ b/src/coding/libs/g7221_lib.c @@ -2,9 +2,9 @@ #include #include -#include "g7221_decoder_lib.h" -#include "g7221_decoder_aes.h" - +#include "g7221_lib.h" +#include "g7221_aes.h" +#include "g7221_data.h" /* Decodes Siren14 from Namco's BNSF, a mono MLT/DCT-based codec for speech/sound (low bandwidth). * Reverse engineered for various exes with info from Polycom's reference int decoder. @@ -46,8 +46,6 @@ * access indexes with (idx & max) and clamp buffer reads */ -#include "g7221_decoder_lib_data.h" - /***************************************************************************** * IMLT *****************************************************************************/ diff --git a/src/coding/g7221_decoder_lib.h b/src/coding/libs/g7221_lib.h similarity index 94% rename from src/coding/g7221_decoder_lib.h rename to src/coding/libs/g7221_lib.h index 4e404081..741b735a 100644 --- a/src/coding/g7221_decoder_lib.h +++ b/src/coding/libs/g7221_lib.h @@ -1,8 +1,8 @@ /* Interface to Namco G.722.1 decoder */ -#ifndef _G7221_DECODER_LIB_H -#define _G7221_DECODER_LIB_H +#ifndef _G7221_LIB_H +#define _G7221_LIB_H #include diff --git a/src/coding/ice_decoder_icelib.c b/src/coding/libs/icelib.c similarity index 99% rename from src/coding/ice_decoder_icelib.c rename to src/coding/libs/icelib.c index 1b6508aa..88c4c33c 100644 --- a/src/coding/ice_decoder_icelib.c +++ b/src/coding/libs/icelib.c @@ -26,11 +26,11 @@ #include #include -#include "ice_decoder_icelib.h" +#include "icelib.h" /* use miniz (API-compatible) to avoid adding external zlib just for this codec * - https://github.com/richgel999/miniz */ -#include "../util/miniz.h" +#include "../../util/miniz.h" //#include "zlib.h" #define ICESND_MAX_CHANNELS 2 diff --git a/src/coding/ice_decoder_icelib.h b/src/coding/libs/icelib.h similarity index 100% rename from src/coding/ice_decoder_icelib.h rename to src/coding/libs/icelib.h diff --git a/src/coding/acm_decoder_libacm.h b/src/coding/libs/libacm.h similarity index 100% rename from src/coding/acm_decoder_libacm.h rename to src/coding/libs/libacm.h diff --git a/src/coding/acm_decoder_decode.c b/src/coding/libs/libacm_decode.c similarity index 99% rename from src/coding/acm_decoder_decode.c rename to src/coding/libs/libacm_decode.c index 0ee8447a..e3421563 100644 --- a/src/coding/acm_decoder_decode.c +++ b/src/coding/libs/libacm_decode.c @@ -24,7 +24,7 @@ #include #include -#include "acm_decoder_libacm.h" //"libacm.h"//vgmstream mod +#include "libacm.h" #define ACM_BUFLEN (64*1024) diff --git a/src/coding/acm_decoder_util.c b/src/coding/libs/libacm_util.c similarity index 98% rename from src/coding/acm_decoder_util.c rename to src/coding/libs/libacm_util.c index bdc423ea..57e91743 100644 --- a/src/coding/acm_decoder_util.c +++ b/src/coding/libs/libacm_util.c @@ -23,7 +23,7 @@ #include #include -#include "acm_decoder_libacm.h" //"libacm.h"//vgmstream mod +#include "libacm.h" #define WAVC_HEADER_LEN 28 #define ACM_HEADER_LEN 14 diff --git a/src/coding/libs/nwa_lib.c b/src/coding/libs/nwa_lib.c new file mode 100644 index 00000000..d794c172 --- /dev/null +++ b/src/coding/libs/nwa_lib.c @@ -0,0 +1,357 @@ +/* Originally from nwatowav.cc (2007.7.28 version) by jagarl. + * - http://www.creator.club.ne.jp/~jagarl/ + * + * Converted to .c by hcs (redone as a lib without RIFF/main handling), some cleanup by bnnm. + * + * nwa format (abridged from the original docs) + * NWA Header + * data offset index + * data block<0> + * data block<1> + * ... + * data block + * + * - NWA header: 0x2c with nwa info (channels, compression level, etc), no magic number + * - data offset index: pointers to data blocks + * - data block: variable sized DPCM blocks to fixed size PCM (a,b,c compresses to (a),b-a,c-b), + * DPCM codes use variable bits. Usually for 16-bit PCM ends ups using 6-8 bits. + * - Block format: + * - mono: initial PCM (8 or 16-bit) then bitstream + * - stereo: initial PCM for left + right channel then bitstream + * Differential accuracy isn't high so initial PCM is used to correct data in each block (?) + * - bitstream: Roughly each code has an 'exponent' (2 bits) + 'mantissa' (variable bits). + * Depending on compression level + type it configures final shift value and matissa bits. + * There is a run length encoding mode in some cases (Tomoyo After voice files). + * Bitstream bytes follow little endian. + * (some examples here in the original, see decoder). + */ + +/* Original copyright: */ +/* + * Copyright 2001-2007 jagarl / Kazunori Ueno + * All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted. + * + * このプログラムの作者は jagarl です。 + * + * このプログラム、及びコンパイルによって生成したバイナリは + * プログラムを変更する、しないにかかわらず再配布可能です。 + * その際、上記 Copyright 表示を保持するなどの条件は課しま + * せん。対応が面倒なのでバグ報告を除き、メールで連絡をする + * などの必要もありません。ソースの一部を流用することを含め、 + * ご自由にお使いください。 + * + * THIS SOFTWARE IS PROVIDED BY KAZUNORI 'jagarl' UENO ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KAZUNORI UENO BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + */ + +#include +#include "nwa_lib.h" +#include "../../util/reader_sf.h" + +//NWAInfo::UseRunLength +static int is_use_runlength(NWAData* nwa) { + if (nwa->channels == 2 && nwa->bps == 16 && nwa->complevel == 2) { + return 0; /* sw2 */ + } + + if (nwa->complevel == 5) { + if (nwa->channels == 2) + return 0; // BGM*.nwa in Little Busters! + return 1; // Tomoyo After (.nwk koe file) + } + + return 0; +} + +NWAData* nwalib_open(STREAMFILE* sf) { + uint8_t header[0x2c] = {0}; + int i; + NWAData* const nwa = malloc(sizeof(NWAData)); + if (!nwa) goto fail; + + //NWAData::ReadHeader + + read_streamfile(header, 0x00, sizeof(header), sf); + nwa->channels = get_s16le(header+0x00); + nwa->bps = get_s16le(header+0x02); + nwa->freq = get_s32le(header+0x04); + nwa->complevel = get_s32le(header+0x08); + nwa->dummy = get_s32le(header+0x0c); + nwa->blocks = get_s32le(header+0x10); + nwa->datasize = get_s32le(header+0x14); + nwa->compdatasize = get_s32le(header+0x18); + nwa->samplecount = get_s32le(header+0x1c); + nwa->blocksize = get_s32le(header+0x20); + nwa->restsize = get_s32le(header+0x24); + nwa->dummy2 = get_s32le(header+0x28); + + nwa->offsets = NULL; + nwa->outdata = NULL; + nwa->outdata_readpos = NULL; + nwa->tmpdata = NULL; + nwa->filesize = get_streamfile_size(sf); + + + if (nwa->blocks <= 0 || nwa->blocks > 1000000) + /* 1時間を超える曲ってのはないでしょ*/ //surely there won't be songs over 1 hour + goto fail; + + // NWAData::CheckHeader: + + if (nwa->channels != 1 && nwa->channels != 2) + goto fail; + + if (nwa->bps != 8 && nwa->bps != 16) + goto fail; + + // (PCM not handled) + + if (nwa->complevel < 0 || nwa->complevel > 5) + goto fail; + + if (nwa->filesize != nwa->compdatasize) + goto fail; + + + if (nwa->datasize != nwa->samplecount * (nwa->bps / 8)) + goto fail; + + if (nwa->samplecount != (nwa->blocks - 1) * nwa->blocksize + nwa->restsize) + goto fail; + + /* offset index 読み込み */ //read offset index + nwa->offsets = malloc(sizeof(off_t) * nwa->blocks); + if (!nwa->offsets) goto fail; + + for (i = 0; i < nwa->blocks; i++) { + int32_t o = read_s32le(0x2c + i*4, sf); + if (o < 0) goto fail; + nwa->offsets[i] = o; + } + + if (nwa->offsets[nwa->blocks-1] >= nwa->compdatasize) + goto fail; + + nwa->use_runlength = is_use_runlength(nwa); + nwa->curblock = 0; + + + //extra + if (nwa->restsize > nwa->blocksize) { + nwa->outdata = malloc(sizeof(int16_t) * nwa->restsize); + } + else { + nwa->outdata = malloc(sizeof(int16_t) * nwa->blocksize); + } + if (!nwa->outdata) + goto fail; + + /* これ以上の大きさはないだろう、、、 */ //probably not over this size + nwa->tmpdata = malloc(sizeof(uint8_t) * nwa->blocksize * (nwa->bps / 8) * 2); + if (!nwa->tmpdata) + goto fail; + + nwa->outdata_readpos = nwa->outdata; + nwa->samples_in_buffer = 0; + + return nwa; +fail: + nwalib_close(nwa); + return NULL; +} + +void nwalib_close(NWAData * nwa) { + if (!nwa) return; + + free(nwa->offsets); + free(nwa->outdata); + free(nwa->tmpdata); + free(nwa); +} + +//NWAData::Rewind +void nwalib_reset(NWAData* nwa) { + nwa->curblock = 0; + nwa->outdata_readpos = nwa->outdata; + nwa->samples_in_buffer = 0; +} + +// can serve up 8 bits at a time +static int getbits(const uint8_t** p_data, int* shift, int bits) { + int ret; + if (*shift > 8) { + (*p_data)++; + *shift -= 8; + } + + ret = get_s16le(*p_data) >> *shift; + *shift += bits; + return ret & ((1 << bits) - 1); /* mask */ +} + +// NWADecode +static void decode_block(NWAData* nwa, const uint8_t* data, int outdatasize) { + sample d[2]; + int i; + int shift = 0; + + int dsize = outdatasize / (nwa->bps / 8); + int flip_flag = 0; /* stereo 用 */ //for stereo + int runlength = 0; + + /* 最初のデータを読み込む */ //read initial data + for (i = 0; i < nwa->channels; i++) { + if (nwa->bps == 8) { + d[i] = get_s8(data); + data += 1; + } + else { /* nwa->bps == 16 */ + d[i] = get_s16le(data); + data += 2; + } + } + + for (i = 0; i < dsize; i++) { + if (runlength == 0) { /* コピーループ中でないならデータ読み込み */ //read data if not in the copy loop + int type = getbits(&data, &shift, 3); + + /* type により分岐:0, 1-6, 7 */ //fork depending on type + if (type == 7) { + /* 7 : 大きな差分 */ //big diff + /* RunLength() 有効時(CompLevel==5, 音声ファイル) では無効 */ //invalid when using RLE (comp=5, voice file) + if (getbits(&data, &shift, 1) == 1) { + d[flip_flag] = 0; /* 未使用 */ //unused + } + else { + int BITS, SHIFT; + if (nwa->complevel >= 3) { + BITS = 8; + SHIFT = 9; + } + else { + BITS = 8 - nwa->complevel; + SHIFT = 2 + 7 + nwa->complevel; + } + + { + const int MASK1 = (1 << (BITS - 1)); + const int MASK2 = (1 << (BITS - 1)) - 1; + int b = getbits(&data, &shift, BITS); + if (b & MASK1) + d[flip_flag] -= (b & MASK2) << SHIFT; + else + d[flip_flag] += (b & MASK2) << SHIFT; + } + } + } + else if (type != 0) { + /* 1-6 : 通常の差分 */ //normal diff + int BITS, SHIFT; + if (nwa->complevel >= 3) { + BITS = nwa->complevel + 3; + SHIFT = 1 + type; + } + else { + BITS = 5 - nwa->complevel; + SHIFT = 2 + type + nwa->complevel; + } + { + const int MASK1 = (1 << (BITS - 1)); + const int MASK2 = (1 << (BITS - 1)) - 1; + int b = getbits(&data, &shift, BITS); + if (b & MASK1) + d[flip_flag] -= (b & MASK2) << SHIFT; + else + d[flip_flag] += (b & MASK2) << SHIFT; + } + } + else { /* type == 0 */ + /* ランレングス圧縮なしの場合はなにもしない */ //does nothing in case of no RLE compression + if (nwa->use_runlength) { + /* ランレングス圧縮ありの場合 */ //in case of RLE compression + runlength = getbits(&data, &shift, 1); + if (runlength == 1) { + runlength = getbits(&data, &shift, 2); + if (runlength == 3) { + runlength = getbits(&data, &shift, 8); + } + } + } + } + } + else { + runlength--; + } + + if (nwa->bps == 8) { + nwa->outdata[i] = d[flip_flag] * 256; //extra (original outputs 8-bit) + } + else { + nwa->outdata[i] = d[flip_flag]; + } + + if (nwa->channels == 2) + flip_flag ^= 1; /* channel 切り替え */ //channel swap + } + + nwa->samples_in_buffer = dsize; +} + +//NWAData::Decode +int nwalib_decode(STREAMFILE* sf, NWAData* nwa) { + /* some wav/pcm handling skipped here */ + + /* 今回読み込む/デコードするデータの大きさを得る */ //get current read/decode data size + int curblocksize, curcompsize; + if (nwa->curblock != nwa->blocks - 1) { + curblocksize = nwa->blocksize * (nwa->bps / 8); + curcompsize = nwa->offsets[nwa->curblock + 1] - nwa->offsets[nwa->curblock]; + if (curblocksize >= nwa->blocksize * (nwa->bps / 8) * 2) { + return -1; // Fatal error + } + } + else { //last block + curblocksize = nwa->restsize * (nwa->bps / 8); + curcompsize = nwa->blocksize * (nwa->bps / 8) * 2; + } + // (in practice compsize is ~200-400 and blocksize ~0x800, but last block can be different) + + /* データ読み込み */ //data read (may read less on last block?) + read_streamfile(nwa->tmpdata, nwa->offsets[nwa->curblock], curcompsize, sf); + + nwa->samples_in_buffer = 0; + nwa->outdata_readpos = nwa->outdata; + + decode_block(nwa, nwa->tmpdata, curblocksize); + + nwa->curblock++; //todo check not over max blocks? + + return 0; +} + +//NWAFILE::Seek (not too similar) +void nwalib_seek(STREAMFILE* sf, NWAData* nwa, int32_t seekpos) { + int dest_block = seekpos / (nwa->blocksize / nwa->channels); + int32_t remainder = seekpos % (nwa->blocksize / nwa->channels); + + nwa->curblock = dest_block; + + nwalib_decode(sf, nwa); + + nwa->outdata_readpos = nwa->outdata + remainder * nwa->channels; + nwa->samples_in_buffer -= remainder*nwa->channels; +} diff --git a/src/coding/nwa_decoder.h b/src/coding/libs/nwa_lib.h similarity index 97% rename from src/coding/nwa_decoder.h rename to src/coding/libs/nwa_lib.h index 613927de..843785ff 100644 --- a/src/coding/nwa_decoder.h +++ b/src/coding/libs/nwa_lib.h @@ -30,10 +30,10 @@ * */ -#ifndef _NWA_DECODER_H -#define _NWA_DECODER_H +#ifndef _NWA_LIB_H +#define _NWA_LIB_H -#include "../streamfile.h" +#include "../../streamfile.h" typedef struct NWAData_s { int channels; diff --git a/src/coding/relic_decoder_lib.c b/src/coding/libs/relic_lib.c similarity index 98% rename from src/coding/relic_decoder_lib.c rename to src/coding/libs/relic_lib.c index 9aa6552b..9da438fc 100644 --- a/src/coding/relic_decoder_lib.c +++ b/src/coding/libs/relic_lib.c @@ -1,7 +1,7 @@ #include #include #include -#include "relic_decoder_lib.h" +#include "relic_lib.h" /* Relic Codec decoder, a fairly simple mono-interleave DCT-based codec. * @@ -11,7 +11,7 @@ */ /* mixfft.c */ -extern void fft(int n, float* xRe, float* xIm, float* yRe, float* yIm); +extern void relic_mixfft_fft(int n, float* xRe, float* xIm, float* yRe, float* yIm); #define RELIC_MAX_CHANNELS 2 @@ -92,7 +92,7 @@ static int apply_idct(const float* freq, float* wave, const float* dct, int dct_ } /* main FFT */ - fft(dct_quarter, in_re, in_im, out_re, out_im); + relic_mixfft_fft(dct_quarter, in_re, in_im, out_re, out_im); /* postrotation, window and reorder? */ factor = 8.0 / sqrt(dct_size); diff --git a/src/coding/relic_decoder_lib.h b/src/coding/libs/relic_lib.h similarity index 84% rename from src/coding/relic_decoder_lib.h rename to src/coding/libs/relic_lib.h index b9fae8e4..763798e0 100644 --- a/src/coding/relic_decoder_lib.h +++ b/src/coding/libs/relic_lib.h @@ -1,5 +1,5 @@ -#ifndef _RELIC_DECODER_LIB_H_ -#define _RELIC_DECODER_LIB_H_ +#ifndef _RELIC_LIB_H_ +#define _RELIC_LIB_H_ #include @@ -20,4 +20,4 @@ int relic_decode_frame(relic_handle_t* handle, uint8_t* buf, int channel); void relic_get_pcm16(relic_handle_t* handle, int16_t* outbuf, int32_t samples, int32_t skip); -#endif/*_RELIC_DECODER_LIB_H_ */ +#endif diff --git a/src/coding/relic_decoder_mixfft.c b/src/coding/libs/relic_mixfft.c similarity index 99% rename from src/coding/relic_decoder_mixfft.c rename to src/coding/libs/relic_mixfft.c index 0e977e73..3fb6f93a 100644 --- a/src/coding/relic_decoder_mixfft.c +++ b/src/coding/libs/relic_mixfft.c @@ -594,7 +594,7 @@ static void twiddleTransf(int sofarRadix, int radix, int remainRadix, } } /* twiddleTransf */ -/*static*/ void fft(int n, float *xRe, float *xIm, +/*static void fft*/ void relic_mixfft_fft(int n, float *xRe, float *xIm, float *yRe, float *yIm) { int sofarRadix[maxFactorCount], diff --git a/src/coding/tac_decoder_lib_data.h b/src/coding/libs/tac_data.h similarity index 99% rename from src/coding/tac_decoder_lib_data.h rename to src/coding/libs/tac_data.h index 434a485d..d9550c0b 100644 --- a/src/coding/tac_decoder_lib_data.h +++ b/src/coding/libs/tac_data.h @@ -1,5 +1,7 @@ -#ifndef _TAC_DECODER_LIB_DATA_H_ -#define _TAC_DECODER_LIB_DATA_H_ +#ifndef _TAC_DATA_H_ +#define _TAC_DATA_H_ + +#include /* VU1 register simulation, needs type conversion at times (should be optimized out by compiler). */ typedef union { diff --git a/src/coding/tac_decoder_lib.c b/src/coding/libs/tac_lib.c similarity index 99% rename from src/coding/tac_decoder_lib.c rename to src/coding/libs/tac_lib.c index 1061055a..bed3fd1c 100644 --- a/src/coding/tac_decoder_lib.c +++ b/src/coding/libs/tac_lib.c @@ -38,9 +38,9 @@ /**********************************************************************************/ /* DEFINITIONS */ /**********************************************************************************/ -#include "tac_decoder_lib_data.h" -#include "tac_decoder_lib_ops.h" -#include "tac_decoder_lib.h" +#include "tac_data.h" +#include "tac_ops.h" +#include "tac_lib.h" //#define TAC_MAX_FRAME_SIZE 0x300 /* typically around ~0x1d0, observed max is ~0x2e2 */ #define TAC_CODED_BANDS 27 diff --git a/src/coding/tac_decoder_lib.h b/src/coding/libs/tac_lib.h similarity index 97% rename from src/coding/tac_decoder_lib.h rename to src/coding/libs/tac_lib.h index 5389aead..fde5a40e 100644 --- a/src/coding/tac_decoder_lib.h +++ b/src/coding/libs/tac_lib.h @@ -1,5 +1,5 @@ -#ifndef _TAC_DECODER_LIB_H_ -#define _TAC_DECODER_LIB_H_ +#ifndef _TAC_LIB_H_ +#define _TAC_LIB_H_ /* tri-Ace Codec (TAC) lib, found in PS2 games */ diff --git a/src/coding/tac_decoder_lib_ops.h b/src/coding/libs/tac_ops.h similarity index 99% rename from src/coding/tac_decoder_lib_ops.h rename to src/coding/libs/tac_ops.h index 6a265a5c..9e923136 100644 --- a/src/coding/tac_decoder_lib_ops.h +++ b/src/coding/libs/tac_ops.h @@ -1,8 +1,6 @@ -#ifndef _TAC_DECODER_LIB_OPS_H_ -#define _TAC_DECODER_LIB_OPS_H_ - +#ifndef _TAC_OPS_H_ +#define _TAC_OPS_H_ #include -#include "tac_decoder_lib_ops.h" /* The following ops are similar to VU1's ops, but not quite the same. For example VU1 has special op * registers like the ACC, and updates zero/neg/etc flags per op (plus added here a few helper ops). diff --git a/src/coding/nwa_decoder.c b/src/coding/nwa_decoder.c index 859f2f8c..636f6a60 100644 --- a/src/coding/nwa_decoder.c +++ b/src/coding/nwa_decoder.c @@ -1,364 +1,4 @@ -/* Originally from nwatowav.cc (2007.7.28 version) by jagarl. - * - http://www.creator.club.ne.jp/~jagarl/ - * - * Converted to .c by hcs (redone as a lib without RIFF/main handling), some cleanup by bnnm. - * - * nwa format (abridged from the original) - * NWA Header - * data offset index - * data block<0> - * data block<1> - * ... - * data block - * - * - NWA header: 0x2c with nwa info (channels, compression level, etc), no magic number - * - data offset index: pointers to data blocks - * - data block: variable sized DPCM blocks to fixed size PCM (a,b,c compresses to (a),b-a,c-b), - * DPCM codes use variable bits. Usually for 16-bit PCM ends ups using 6-8 bits. - * - Block format: - * - mono: initial PCM (8 or 16-bit) then bitstream - * - stereo: initial PCM for left + right channel then bitstream - * Differential accuracy isn't high so initial PCM is used to correct data in each block (?) - * - bitstream: Roughly each code has an 'exponent' (2 bits) + 'mantissa' (variable bits). - * Depending on compression level + type it configures final shift value and matissa bits. - * There is a run length encoding mode in some cases (Tomoyo After voice files). - * Bitstream bytes follow little endian. - * (some examples here in the original, see decoder). - * - * Original copyright: - */ - -/* - * Copyright 2001-2007 jagarl / Kazunori Ueno - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted. - * - * このプログラムの作者は jagarl です。 - * - * このプログラム、及びコンパイルによって生成したバイナリは - * プログラムを変更する、しないにかかわらず再配布可能です。 - * その際、上記 Copyright 表示を保持するなどの条件は課しま - * せん。対応が面倒なのでバグ報告を除き、メールで連絡をする - * などの必要もありません。ソースの一部を流用することを含め、 - * ご自由にお使いください。 - * - * THIS SOFTWARE IS PROVIDED BY KAZUNORI 'jagarl' UENO ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KAZUNORI UENO BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE - * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - * - */ - -#include -#include "nwa_decoder.h" -#include "../util/reader_sf.h" - -//NWAInfo::UseRunLength -static int is_use_runlength(NWAData* nwa) { - if (nwa->channels == 2 && nwa->bps == 16 && nwa->complevel == 2) { - return 0; /* sw2 */ - } - - if (nwa->complevel == 5) { - if (nwa->channels == 2) - return 0; // BGM*.nwa in Little Busters! - return 1; // Tomoyo After (.nwk koe file) - } - - return 0; -} - -NWAData* nwalib_open(STREAMFILE* sf) { - uint8_t header[0x2c] = {0}; - int i; - NWAData* const nwa = malloc(sizeof(NWAData)); - if (!nwa) goto fail; - - //NWAData::ReadHeader - - read_streamfile(header, 0x00, sizeof(header), sf); - nwa->channels = get_s16le(header+0x00); - nwa->bps = get_s16le(header+0x02); - nwa->freq = get_s32le(header+0x04); - nwa->complevel = get_s32le(header+0x08); - nwa->dummy = get_s32le(header+0x0c); - nwa->blocks = get_s32le(header+0x10); - nwa->datasize = get_s32le(header+0x14); - nwa->compdatasize = get_s32le(header+0x18); - nwa->samplecount = get_s32le(header+0x1c); - nwa->blocksize = get_s32le(header+0x20); - nwa->restsize = get_s32le(header+0x24); - nwa->dummy2 = get_s32le(header+0x28); - - nwa->offsets = NULL; - nwa->outdata = NULL; - nwa->outdata_readpos = NULL; - nwa->tmpdata = NULL; - nwa->filesize = get_streamfile_size(sf); - - - if (nwa->blocks <= 0 || nwa->blocks > 1000000) - /* 1時間を超える曲ってのはないでしょ*/ //surely there won't be songs over 1 hour - goto fail; - - // NWAData::CheckHeader: - - if (nwa->channels != 1 && nwa->channels != 2) - goto fail; - - if (nwa->bps != 8 && nwa->bps != 16) - goto fail; - - // (PCM not handled) - - if (nwa->complevel < 0 || nwa->complevel > 5) - goto fail; - - if (nwa->filesize != nwa->compdatasize) - goto fail; - - - if (nwa->datasize != nwa->samplecount * (nwa->bps / 8)) - goto fail; - - if (nwa->samplecount != (nwa->blocks - 1) * nwa->blocksize + nwa->restsize) - goto fail; - - /* offset index 読み込み */ //read offset index - nwa->offsets = malloc(sizeof(off_t) * nwa->blocks); - if (!nwa->offsets) goto fail; - - for (i = 0; i < nwa->blocks; i++) { - int32_t o = read_s32le(0x2c + i*4, sf); - if (o < 0) goto fail; - nwa->offsets[i] = o; - } - - if (nwa->offsets[nwa->blocks-1] >= nwa->compdatasize) - goto fail; - - nwa->use_runlength = is_use_runlength(nwa); - nwa->curblock = 0; - - - //extra - if (nwa->restsize > nwa->blocksize) { - nwa->outdata = malloc(sizeof(int16_t) * nwa->restsize); - } - else { - nwa->outdata = malloc(sizeof(int16_t) * nwa->blocksize); - } - if (!nwa->outdata) - goto fail; - - /* これ以上の大きさはないだろう、、、 */ //probably not over this size - nwa->tmpdata = malloc(sizeof(uint8_t) * nwa->blocksize * (nwa->bps / 8) * 2); - if (!nwa->tmpdata) - goto fail; - - nwa->outdata_readpos = nwa->outdata; - nwa->samples_in_buffer = 0; - - return nwa; -fail: - nwalib_close(nwa); - return NULL; -} - -void nwalib_close(NWAData * nwa) { - if (!nwa) return; - - free(nwa->offsets); - free(nwa->outdata); - free(nwa->tmpdata); - free(nwa); -} - -//NWAData::Rewind -void nwalib_reset(NWAData* nwa) { - nwa->curblock = 0; - nwa->outdata_readpos = nwa->outdata; - nwa->samples_in_buffer = 0; -} - -// can serve up 8 bits at a time -static int getbits(const uint8_t** p_data, int* shift, int bits) { - int ret; - if (*shift > 8) { - (*p_data)++; - *shift -= 8; - } - - ret = get_s16le(*p_data) >> *shift; - *shift += bits; - return ret & ((1 << bits) - 1); /* mask */ -} - -// NWADecode -static void decode_block(NWAData* nwa, const uint8_t* data, int outdatasize) { - sample d[2]; - int i; - int shift = 0; - - int dsize = outdatasize / (nwa->bps / 8); - int flip_flag = 0; /* stereo 用 */ //for stereo - int runlength = 0; - - /* 最初のデータを読み込む */ //read initial data - for (i = 0; i < nwa->channels; i++) { - if (nwa->bps == 8) { - d[i] = get_s8(data); - data += 1; - } - else { /* nwa->bps == 16 */ - d[i] = get_s16le(data); - data += 2; - } - } - - for (i = 0; i < dsize; i++) { - if (runlength == 0) { /* コピーループ中でないならデータ読み込み */ //read data if not in the copy loop - int type = getbits(&data, &shift, 3); - - /* type により分岐:0, 1-6, 7 */ //fork depending on type - if (type == 7) { - /* 7 : 大きな差分 */ //big diff - /* RunLength() 有効時(CompLevel==5, 音声ファイル) では無効 */ //invalid when using RLE (comp=5, voice file) - if (getbits(&data, &shift, 1) == 1) { - d[flip_flag] = 0; /* 未使用 */ //unused - } - else { - int BITS, SHIFT; - if (nwa->complevel >= 3) { - BITS = 8; - SHIFT = 9; - } - else { - BITS = 8 - nwa->complevel; - SHIFT = 2 + 7 + nwa->complevel; - } - - { - const int MASK1 = (1 << (BITS - 1)); - const int MASK2 = (1 << (BITS - 1)) - 1; - int b = getbits(&data, &shift, BITS); - if (b & MASK1) - d[flip_flag] -= (b & MASK2) << SHIFT; - else - d[flip_flag] += (b & MASK2) << SHIFT; - } - } - } - else if (type != 0) { - /* 1-6 : 通常の差分 */ //normal diff - int BITS, SHIFT; - if (nwa->complevel >= 3) { - BITS = nwa->complevel + 3; - SHIFT = 1 + type; - } - else { - BITS = 5 - nwa->complevel; - SHIFT = 2 + type + nwa->complevel; - } - { - const int MASK1 = (1 << (BITS - 1)); - const int MASK2 = (1 << (BITS - 1)) - 1; - int b = getbits(&data, &shift, BITS); - if (b & MASK1) - d[flip_flag] -= (b & MASK2) << SHIFT; - else - d[flip_flag] += (b & MASK2) << SHIFT; - } - } - else { /* type == 0 */ - /* ランレングス圧縮なしの場合はなにもしない */ //does nothing in case of no RLE compression - if (nwa->use_runlength) { - /* ランレングス圧縮ありの場合 */ //in case of RLE compression - runlength = getbits(&data, &shift, 1); - if (runlength == 1) { - runlength = getbits(&data, &shift, 2); - if (runlength == 3) { - runlength = getbits(&data, &shift, 8); - } - } - } - } - } - else { - runlength--; - } - - if (nwa->bps == 8) { - nwa->outdata[i] = d[flip_flag] * 256; //extra (original outputs 8-bit) - } - else { - nwa->outdata[i] = d[flip_flag]; - } - - if (nwa->channels == 2) - flip_flag ^= 1; /* channel 切り替え */ //channel swap - } - - nwa->samples_in_buffer = dsize; -} - -//NWAData::Decode -int nwalib_decode(STREAMFILE* sf, NWAData* nwa) { - /* some wav/pcm handling skipped here */ - - /* 今回読み込む/デコードするデータの大きさを得る */ //get current read/decode data size - int curblocksize, curcompsize; - if (nwa->curblock != nwa->blocks - 1) { - curblocksize = nwa->blocksize * (nwa->bps / 8); - curcompsize = nwa->offsets[nwa->curblock + 1] - nwa->offsets[nwa->curblock]; - if (curblocksize >= nwa->blocksize * (nwa->bps / 8) * 2) { - return -1; // Fatal error - } - } - else { //last block - curblocksize = nwa->restsize * (nwa->bps / 8); - curcompsize = nwa->blocksize * (nwa->bps / 8) * 2; - } - // (in practice compsize is ~200-400 and blocksize ~0x800, but last block can be different) - - /* データ読み込み */ //data read (may read less on last block?) - read_streamfile(nwa->tmpdata, nwa->offsets[nwa->curblock], curcompsize, sf); - - nwa->samples_in_buffer = 0; - nwa->outdata_readpos = nwa->outdata; - - decode_block(nwa, nwa->tmpdata, curblocksize); - - nwa->curblock++; //todo check not over max blocks? - - return 0; -} - -//NWAFILE::Seek (not too similar) -void nwalib_seek(STREAMFILE* sf, NWAData* nwa, int32_t seekpos) { - int dest_block = seekpos / (nwa->blocksize / nwa->channels); - int32_t remainder = seekpos % (nwa->blocksize / nwa->channels); - - nwa->curblock = dest_block; - - nwalib_decode(sf, nwa); - - nwa->outdata_readpos = nwa->outdata + remainder * nwa->channels; - nwa->samples_in_buffer -= remainder*nwa->channels; -} - -/* ****************************************************************** */ - +#include "libs/nwa_lib.h" #include "coding.h" diff --git a/src/coding/relic_decoder.c b/src/coding/relic_decoder.c index 7b5968f1..319203a6 100644 --- a/src/coding/relic_decoder.c +++ b/src/coding/relic_decoder.c @@ -1,5 +1,5 @@ #include "coding.h" -#include "relic_decoder_lib.h" +#include "libs/relic_lib.h" //TODO: fix looping diff --git a/src/coding/tac_decoder.c b/src/coding/tac_decoder.c index 2cce8df6..fc4ed696 100644 --- a/src/coding/tac_decoder.c +++ b/src/coding/tac_decoder.c @@ -1,7 +1,7 @@ #include "coding.h" #include "coding_utils_samples.h" -#include "tac_decoder_lib.h" +#include "libs/tac_lib.h" /* opaque struct */ diff --git a/src/libvgmstream.vcxproj b/src/libvgmstream.vcxproj index 499c736e..3971b5ee 100644 --- a/src/libvgmstream.vcxproj +++ b/src/libvgmstream.vcxproj @@ -92,28 +92,28 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -212,17 +212,13 @@ - - - - @@ -237,12 +233,8 @@ - - - - @@ -269,13 +261,10 @@ - - - @@ -293,6 +282,18 @@ + + + + + + + + + + + + diff --git a/src/libvgmstream.vcxproj.filters b/src/libvgmstream.vcxproj.filters index 90f8367d..e1664074 100644 --- a/src/libvgmstream.vcxproj.filters +++ b/src/libvgmstream.vcxproj.filters @@ -101,63 +101,18 @@ base\Header Files - - coding\Header Files - - - coding\Header Files - - - coding\Header Files - - - coding\Header Files - coding\Header Files coding\Header Files - - coding\Header Files - - - coding\Header Files - - - coding\Header Files - - - coding\Header Files - coding\Header Files - - coding\Header Files - - - coding\Header Files - coding\Header Files - - coding\Header Files - - - coding\Header Files - - - coding\Header Files - - - coding\Header Files - - - coding\Header Files - coding\Header Files @@ -167,6 +122,51 @@ coding\Header Files + + coding\libs\Header Files + + + coding\libs\Header Files + + + coding\libs\Header Files + + + coding\libs\Header Files + + + coding\libs\Header Files + + + coding\libs\Header Files + + + coding\libs\Header Files + + + coding\libs\Header Files + + + coding\libs\Header Files + + + coding\libs\Header Files + + + coding\libs\Header Files + + + coding\libs\Header Files + + + coding\libs\Header Files + + + coding\libs\Header Files + + + coding\libs\Header Files + coding\libs\Header Files @@ -457,12 +457,6 @@ coding\Source Files - - coding\Source Files - - - coding\Source Files - coding\Source Files @@ -478,18 +472,12 @@ coding\Source Files - - coding\Source Files - coding\Source Files coding\Source Files - - coding\Source Files - coding\Source Files @@ -532,24 +520,12 @@ coding\Source Files - - coding\Source Files - - - coding\Source Files - coding\Source Files - - coding\Source Files - coding\Source Files - - coding\Source Files - coding\Source Files @@ -628,12 +604,6 @@ coding\Source Files - - coding\Source Files - - - coding\Source Files - coding\Source Files @@ -646,9 +616,6 @@ coding\Source Files - - coding\Source Files - coding\Source Files @@ -700,6 +667,42 @@ coding\Source Files + + coding\libs\Source Files + + + coding\libs\Source Files + + + coding\libs\Source Files + + + coding\libs\Source Files + + + coding\libs\Source Files + + + coding\libs\Source Files + + + coding\libs\Source Files + + + coding\libs\Source Files + + + coding\libs\Source Files + + + coding\libs\Source Files + + + coding\libs\Source Files + + + coding\libs\Source Files + coding\libs\Source Files diff --git a/src/meta/acm.c b/src/meta/acm.c index 5c1d81f8..ca985591 100644 --- a/src/meta/acm.c +++ b/src/meta/acm.c @@ -1,6 +1,6 @@ #include "meta.h" #include "../coding/coding.h" -#include "../coding/acm_decoder_libacm.h" +#include "../coding/libs/libacm.h" /* ACM - InterPlay infinity engine games [Planescape: Torment (PC), Baldur's Gate (PC)] */ VGMSTREAM* init_vgmstream_acm(STREAMFILE* sf) { diff --git a/src/meta/bigrp.c b/src/meta/bigrp.c index 38502044..52d212a4 100644 --- a/src/meta/bigrp.c +++ b/src/meta/bigrp.c @@ -1,6 +1,6 @@ #include "meta.h" #include "../coding/coding.h" -#include "../coding/ice_decoder_icelib.h" +#include "../coding/libs/icelib.h" /* .BIGRP - from Inti Creates "ICE"/"Imperial" engine [Blaster Master Zero 2 (SW), Gunvolt 3 (SW)] */ diff --git a/src/meta/hca.c b/src/meta/hca.c index 3ee83874..ee815ce7 100644 --- a/src/meta/hca.c +++ b/src/meta/hca.c @@ -1,7 +1,7 @@ #include "meta.h" #include "hca_keys.h" #include "../coding/coding.h" -#include "../coding/hca_decoder_clhca.h" +#include "../coding/libs/clhca.h" #include "../util/channel_mappings.h" #include "../util/companion_files.h" #include "../util/cri_keys.h"