mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-28 00:20:47 +01:00
cleanup: move semi-external libs to subdir for clarity
This commit is contained in:
parent
fa68185746
commit
1091e8d1e7
@ -1,5 +1,5 @@
|
|||||||
#include "coding.h"
|
#include "coding.h"
|
||||||
#include "acm_decoder_libacm.h"
|
#include "libs/libacm.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
/* libacm 1.2 (despite what libacm.h says) from: https://github.com/markokr/libacm */
|
/* libacm 1.2 (despite what libacm.h says) from: https://github.com/markokr/libacm */
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "coding.h"
|
#include "coding.h"
|
||||||
#include "circus_decoder_lib.h"
|
#include "libs/circus_vq_lib.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "../util/reader_sf.h"
|
#include "../util/reader_sf.h"
|
||||||
#include "../util/reader_get_nibbles.h"
|
#include "../util/reader_get_nibbles.h"
|
||||||
//todo remove
|
//todo remove
|
||||||
#include "hca_decoder_clhca.h"
|
#include "libs/clhca.h"
|
||||||
|
|
||||||
/* adx_decoder */
|
/* 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);
|
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);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "coding.h"
|
#include "coding.h"
|
||||||
#include "coding_utils_samples.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 */
|
#define COMPRESSWAVE_MAX_FRAME_SAMPLES 0x1000 /* arbitrary but should be multiple of 2 for 22050 mode */
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "coding.h"
|
#include "coding.h"
|
||||||
|
|
||||||
#ifdef VGM_USE_G7221
|
#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_SIZE 0x78 /* 960/8 */
|
||||||
#define G7221_MAX_FRAME_SAMPLES 640 /* 32000/50 */
|
#define G7221_MAX_FRAME_SAMPLES 640 /* 32000/50 */
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "coding.h"
|
#include "coding.h"
|
||||||
#include "hca_decoder_clhca.h"
|
#include "libs/clhca.h"
|
||||||
|
|
||||||
|
|
||||||
struct hca_codec_data {
|
struct hca_codec_data {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "coding.h"
|
#include "coding.h"
|
||||||
#include "ice_decoder_icelib.h"
|
#include "libs/icelib.h"
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#ifndef _CIRCUS_DECODER_LIB_DATA_H_
|
#ifndef _CIRCUS_VQ_DATA_H_
|
||||||
#define _CIRCUS_DECODER_LIB_DATA_H_
|
#define _CIRCUS_VQ_DATA_H_
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
@ -14,14 +14,14 @@
|
|||||||
* https://bitbucket.org/losnoco/foo_adpcm/src/master/foo_oki/source/libpcm/libpcm.cpp
|
* https://bitbucket.org/losnoco/foo_adpcm/src/master/foo_oki/source/libpcm/libpcm.cpp
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "circus_decoder_lib.h"
|
#include "circus_vq_lib.h"
|
||||||
#include "circus_decoder_lib_data.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
|
/* use miniz (API-compatible) to avoid adding external zlib just for this codec
|
||||||
* - https://github.com/richgel999/miniz */
|
* - https://github.com/richgel999/miniz */
|
||||||
#include "../util/miniz.h"
|
#include "../../util/miniz.h"
|
||||||
//#include "zlib.h"
|
//#include "zlib.h"
|
||||||
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
#ifndef _CIRCUS_DECODER_LIB_H_
|
#ifndef _CIRCUS_VQ_LIB_H_
|
||||||
#define _CIRCUS_DECODER_LIB_H_
|
#define _CIRCUS_VQ_LIB_H_
|
||||||
|
|
||||||
#include "../streamfile.h"
|
#include "../../streamfile.h"
|
||||||
|
|
||||||
typedef struct circus_handle_t circus_handle_t;
|
typedef struct circus_handle_t circus_handle_t;
|
||||||
|
|
@ -1,3 +1,6 @@
|
|||||||
|
#ifndef _CIRCUS_VQ_LZXPCM_H_
|
||||||
|
#define _CIRCUS_VQ_LZXPCM_H_
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -295,3 +298,5 @@ static int lzxpcm_decompress_full(uint8_t* dst, size_t dst_size, const uint8_t*
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
@ -25,7 +25,7 @@
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// Includes
|
// Includes
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
#include "hca_decoder_clhca.h"
|
#include "clhca.h"
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <memory.h>
|
#include <memory.h>
|
@ -1,9 +1,5 @@
|
|||||||
#ifndef _clHCA_H
|
#ifndef _CLHCA_H_
|
||||||
#define _clHCA_H
|
#define _CLHCA_H_
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* Must pass at least 8 bytes of data to this function.
|
/* 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. */
|
* Without it there are minor differences, mainly useful when testing a new key. */
|
||||||
void clHCA_DecodeReset(clHCA * hca);
|
void clHCA_DecodeReset(clHCA * hca);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -1,4 +1,4 @@
|
|||||||
#include "compresswave_decoder_lib.h"
|
#include "compresswave_lib.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
@ -1,6 +1,6 @@
|
|||||||
#ifndef _COMPRESSWAVE_DECODER_LIB_H
|
#ifndef _COMPRESSWAVE_LIB_H
|
||||||
#define _COMPRESSWAVE_DECODER_LIB_H
|
#define _COMPRESSWAVE_LIB_H
|
||||||
#include "../streamfile.h"
|
#include "../../streamfile.h"
|
||||||
|
|
||||||
typedef struct TCompressWaveData TCompressWaveData;
|
typedef struct TCompressWaveData TCompressWaveData;
|
||||||
|
|
||||||
@ -24,4 +24,4 @@ float TCompressWaveData_GetFade(TCompressWaveData* this);
|
|||||||
float TCompressWaveData_GetPlayTime(TCompressWaveData* this);
|
float TCompressWaveData_GetPlayTime(TCompressWaveData* this);
|
||||||
float TCompressWaveData_GetTotalTime(TCompressWaveData* this);
|
float TCompressWaveData_GetTotalTime(TCompressWaveData* this);
|
||||||
|
|
||||||
#endif /*_COMPRESSWAVE_DECODER_LIB_H */
|
#endif /*_COMPRESSWAVE_LIB_H */
|
@ -1,5 +1,5 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#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,
|
/* 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,
|
* if more code needs AES. Most implementations out there either use pre-calculated look-up tables,
|
@ -1,5 +1,5 @@
|
|||||||
#ifndef _DATA_H_
|
#ifndef _G7221_DATA_H_
|
||||||
#define _DATA_H_
|
#define _G7221_DATA_H_
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
@ -2,9 +2,9 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "g7221_decoder_lib.h"
|
#include "g7221_lib.h"
|
||||||
#include "g7221_decoder_aes.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).
|
/* 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.
|
* 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
|
* access indexes with (idx & max) and clamp buffer reads
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "g7221_decoder_lib_data.h"
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* IMLT
|
* IMLT
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
Interface to Namco G.722.1 decoder
|
Interface to Namco G.722.1 decoder
|
||||||
*/
|
*/
|
||||||
#ifndef _G7221_DECODER_LIB_H
|
#ifndef _G7221_LIB_H
|
||||||
#define _G7221_DECODER_LIB_H
|
#define _G7221_LIB_H
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
@ -26,11 +26,11 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "ice_decoder_icelib.h"
|
#include "icelib.h"
|
||||||
|
|
||||||
/* use miniz (API-compatible) to avoid adding external zlib just for this codec
|
/* use miniz (API-compatible) to avoid adding external zlib just for this codec
|
||||||
* - https://github.com/richgel999/miniz */
|
* - https://github.com/richgel999/miniz */
|
||||||
#include "../util/miniz.h"
|
#include "../../util/miniz.h"
|
||||||
//#include "zlib.h"
|
//#include "zlib.h"
|
||||||
|
|
||||||
#define ICESND_MAX_CHANNELS 2
|
#define ICESND_MAX_CHANNELS 2
|
@ -24,7 +24,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "acm_decoder_libacm.h" //"libacm.h"//vgmstream mod
|
#include "libacm.h"
|
||||||
|
|
||||||
#define ACM_BUFLEN (64*1024)
|
#define ACM_BUFLEN (64*1024)
|
||||||
|
|
@ -23,7 +23,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "acm_decoder_libacm.h" //"libacm.h"//vgmstream mod
|
#include "libacm.h"
|
||||||
|
|
||||||
#define WAVC_HEADER_LEN 28
|
#define WAVC_HEADER_LEN 28
|
||||||
#define ACM_HEADER_LEN 14
|
#define ACM_HEADER_LEN 14
|
357
src/coding/libs/nwa_lib.c
Normal file
357
src/coding/libs/nwa_lib.c
Normal file
@ -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<N>
|
||||||
|
*
|
||||||
|
* - 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 <jagarl@creator.club.ne.jp>
|
||||||
|
* 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 <stdlib.h>
|
||||||
|
#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;
|
||||||
|
}
|
@ -30,10 +30,10 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _NWA_DECODER_H
|
#ifndef _NWA_LIB_H
|
||||||
#define _NWA_DECODER_H
|
#define _NWA_LIB_H
|
||||||
|
|
||||||
#include "../streamfile.h"
|
#include "../../streamfile.h"
|
||||||
|
|
||||||
typedef struct NWAData_s {
|
typedef struct NWAData_s {
|
||||||
int channels;
|
int channels;
|
@ -1,7 +1,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "relic_decoder_lib.h"
|
#include "relic_lib.h"
|
||||||
|
|
||||||
/* Relic Codec decoder, a fairly simple mono-interleave DCT-based codec.
|
/* Relic Codec decoder, a fairly simple mono-interleave DCT-based codec.
|
||||||
*
|
*
|
||||||
@ -11,7 +11,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* mixfft.c */
|
/* 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
|
#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 */
|
/* 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? */
|
/* postrotation, window and reorder? */
|
||||||
factor = 8.0 / sqrt(dct_size);
|
factor = 8.0 / sqrt(dct_size);
|
@ -1,5 +1,5 @@
|
|||||||
#ifndef _RELIC_DECODER_LIB_H_
|
#ifndef _RELIC_LIB_H_
|
||||||
#define _RELIC_DECODER_LIB_H_
|
#define _RELIC_LIB_H_
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
@ -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);
|
void relic_get_pcm16(relic_handle_t* handle, int16_t* outbuf, int32_t samples, int32_t skip);
|
||||||
|
|
||||||
#endif/*_RELIC_DECODER_LIB_H_ */
|
#endif
|
@ -594,7 +594,7 @@ static void twiddleTransf(int sofarRadix, int radix, int remainRadix,
|
|||||||
}
|
}
|
||||||
} /* twiddleTransf */
|
} /* 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)
|
float *yRe, float *yIm)
|
||||||
{
|
{
|
||||||
int sofarRadix[maxFactorCount],
|
int sofarRadix[maxFactorCount],
|
@ -1,5 +1,7 @@
|
|||||||
#ifndef _TAC_DECODER_LIB_DATA_H_
|
#ifndef _TAC_DATA_H_
|
||||||
#define _TAC_DECODER_LIB_DATA_H_
|
#define _TAC_DATA_H_
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
/* VU1 register simulation, needs type conversion at times (should be optimized out by compiler). */
|
/* VU1 register simulation, needs type conversion at times (should be optimized out by compiler). */
|
||||||
typedef union {
|
typedef union {
|
@ -38,9 +38,9 @@
|
|||||||
/**********************************************************************************/
|
/**********************************************************************************/
|
||||||
/* DEFINITIONS */
|
/* DEFINITIONS */
|
||||||
/**********************************************************************************/
|
/**********************************************************************************/
|
||||||
#include "tac_decoder_lib_data.h"
|
#include "tac_data.h"
|
||||||
#include "tac_decoder_lib_ops.h"
|
#include "tac_ops.h"
|
||||||
#include "tac_decoder_lib.h"
|
#include "tac_lib.h"
|
||||||
|
|
||||||
//#define TAC_MAX_FRAME_SIZE 0x300 /* typically around ~0x1d0, observed max is ~0x2e2 */
|
//#define TAC_MAX_FRAME_SIZE 0x300 /* typically around ~0x1d0, observed max is ~0x2e2 */
|
||||||
#define TAC_CODED_BANDS 27
|
#define TAC_CODED_BANDS 27
|
@ -1,5 +1,5 @@
|
|||||||
#ifndef _TAC_DECODER_LIB_H_
|
#ifndef _TAC_LIB_H_
|
||||||
#define _TAC_DECODER_LIB_H_
|
#define _TAC_LIB_H_
|
||||||
|
|
||||||
/* tri-Ace Codec (TAC) lib, found in PS2 games */
|
/* tri-Ace Codec (TAC) lib, found in PS2 games */
|
||||||
|
|
@ -1,8 +1,6 @@
|
|||||||
#ifndef _TAC_DECODER_LIB_OPS_H_
|
#ifndef _TAC_OPS_H_
|
||||||
#define _TAC_DECODER_LIB_OPS_H_
|
#define _TAC_OPS_H_
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#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
|
/* 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).
|
* registers like the ACC, and updates zero/neg/etc flags per op (plus added here a few helper ops).
|
@ -1,364 +1,4 @@
|
|||||||
/* Originally from nwatowav.cc (2007.7.28 version) by jagarl.
|
#include "libs/nwa_lib.h"
|
||||||
* - 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<N>
|
|
||||||
*
|
|
||||||
* - 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 <jagarl@creator.club.ne.jp>
|
|
||||||
* 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 <stdlib.h>
|
|
||||||
#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 "coding.h"
|
#include "coding.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "coding.h"
|
#include "coding.h"
|
||||||
#include "relic_decoder_lib.h"
|
#include "libs/relic_lib.h"
|
||||||
|
|
||||||
//TODO: fix looping
|
//TODO: fix looping
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "coding.h"
|
#include "coding.h"
|
||||||
#include "coding_utils_samples.h"
|
#include "coding_utils_samples.h"
|
||||||
|
|
||||||
#include "tac_decoder_lib.h"
|
#include "libs/tac_lib.h"
|
||||||
|
|
||||||
|
|
||||||
/* opaque struct */
|
/* opaque struct */
|
||||||
|
@ -92,28 +92,28 @@
|
|||||||
<ClInclude Include="base\mixing_priv.h" />
|
<ClInclude Include="base\mixing_priv.h" />
|
||||||
<ClInclude Include="base\plugins.h" />
|
<ClInclude Include="base\plugins.h" />
|
||||||
<ClInclude Include="base\render.h" />
|
<ClInclude Include="base\render.h" />
|
||||||
<ClInclude Include="coding\acm_decoder_libacm.h" />
|
|
||||||
<ClInclude Include="coding\circus_decoder_lib.h" />
|
|
||||||
<ClInclude Include="coding\circus_decoder_lib_data.h" />
|
|
||||||
<ClInclude Include="coding\circus_decoder_lzxpcm.h" />
|
|
||||||
<ClInclude Include="coding\coding.h" />
|
<ClInclude Include="coding\coding.h" />
|
||||||
<ClInclude Include="coding\coding_utils_samples.h" />
|
<ClInclude Include="coding\coding_utils_samples.h" />
|
||||||
<ClInclude Include="coding\compresswave_decoder_lib.h" />
|
|
||||||
<ClInclude Include="coding\g7221_decoder_aes.h" />
|
|
||||||
<ClInclude Include="coding\g7221_decoder_lib.h" />
|
|
||||||
<ClInclude Include="coding\g7221_decoder_lib_data.h" />
|
|
||||||
<ClInclude Include="coding\g72x_state.h" />
|
<ClInclude Include="coding\g72x_state.h" />
|
||||||
<ClInclude Include="coding\hca_decoder_clhca.h" />
|
|
||||||
<ClInclude Include="coding\ice_decoder_icelib.h" />
|
|
||||||
<ClInclude Include="coding\mpeg_decoder.h" />
|
<ClInclude Include="coding\mpeg_decoder.h" />
|
||||||
<ClInclude Include="coding\nwa_decoder.h" />
|
|
||||||
<ClInclude Include="coding\relic_decoder_lib.h" />
|
|
||||||
<ClInclude Include="coding\tac_decoder_lib.h" />
|
|
||||||
<ClInclude Include="coding\tac_decoder_lib_data.h" />
|
|
||||||
<ClInclude Include="coding\tac_decoder_lib_ops.h" />
|
|
||||||
<ClInclude Include="coding\vorbis_custom_data_fsb.h" />
|
<ClInclude Include="coding\vorbis_custom_data_fsb.h" />
|
||||||
<ClInclude Include="coding\vorbis_custom_data_wwise.h" />
|
<ClInclude Include="coding\vorbis_custom_data_wwise.h" />
|
||||||
<ClInclude Include="coding\vorbis_custom_decoder.h" />
|
<ClInclude Include="coding\vorbis_custom_decoder.h" />
|
||||||
|
<ClInclude Include="coding\libs\circus_vq_data.h" />
|
||||||
|
<ClInclude Include="coding\libs\circus_vq_lib.h" />
|
||||||
|
<ClInclude Include="coding\libs\circus_vq_lzxpcm.h" />
|
||||||
|
<ClInclude Include="coding\libs\clhca.h" />
|
||||||
|
<ClInclude Include="coding\libs\compresswave_lib.h" />
|
||||||
|
<ClInclude Include="coding\libs\g7221_aes.h" />
|
||||||
|
<ClInclude Include="coding\libs\g7221_data.h" />
|
||||||
|
<ClInclude Include="coding\libs\g7221_lib.h" />
|
||||||
|
<ClInclude Include="coding\libs\icelib.h" />
|
||||||
|
<ClInclude Include="coding\libs\libacm.h" />
|
||||||
|
<ClInclude Include="coding\libs\nwa_lib.h" />
|
||||||
|
<ClInclude Include="coding\libs\relic_lib.h" />
|
||||||
|
<ClInclude Include="coding\libs\tac_data.h" />
|
||||||
|
<ClInclude Include="coding\libs\tac_lib.h" />
|
||||||
|
<ClInclude Include="coding\libs\tac_ops.h" />
|
||||||
<ClInclude Include="coding\libs\utkdec.h" />
|
<ClInclude Include="coding\libs\utkdec.h" />
|
||||||
<ClInclude Include="layout\layout.h" />
|
<ClInclude Include="layout\layout.h" />
|
||||||
<ClInclude Include="meta\9tav_streamfile.h" />
|
<ClInclude Include="meta\9tav_streamfile.h" />
|
||||||
@ -212,17 +212,13 @@
|
|||||||
<ClCompile Include="base\render.c" />
|
<ClCompile Include="base\render.c" />
|
||||||
<ClCompile Include="base\seek.c" />
|
<ClCompile Include="base\seek.c" />
|
||||||
<ClCompile Include="coding\acm_decoder.c" />
|
<ClCompile Include="coding\acm_decoder.c" />
|
||||||
<ClCompile Include="coding\acm_decoder_decode.c" />
|
|
||||||
<ClCompile Include="coding\acm_decoder_util.c" />
|
|
||||||
<ClCompile Include="coding\adx_decoder.c" />
|
<ClCompile Include="coding\adx_decoder.c" />
|
||||||
<ClCompile Include="coding\asf_decoder.c" />
|
<ClCompile Include="coding\asf_decoder.c" />
|
||||||
<ClCompile Include="coding\atrac9_decoder.c" />
|
<ClCompile Include="coding\atrac9_decoder.c" />
|
||||||
<ClCompile Include="coding\celt_fsb_decoder.c" />
|
<ClCompile Include="coding\celt_fsb_decoder.c" />
|
||||||
<ClCompile Include="coding\circus_decoder.c" />
|
<ClCompile Include="coding\circus_decoder.c" />
|
||||||
<ClCompile Include="coding\circus_decoder_lib.c" />
|
|
||||||
<ClCompile Include="coding\coding_utils.c" />
|
<ClCompile Include="coding\coding_utils.c" />
|
||||||
<ClCompile Include="coding\compresswave_decoder.c" />
|
<ClCompile Include="coding\compresswave_decoder.c" />
|
||||||
<ClCompile Include="coding\compresswave_decoder_lib.c" />
|
|
||||||
<ClCompile Include="coding\derf_decoder.c" />
|
<ClCompile Include="coding\derf_decoder.c" />
|
||||||
<ClCompile Include="coding\dpcm_kcej_decoder.c" />
|
<ClCompile Include="coding\dpcm_kcej_decoder.c" />
|
||||||
<ClCompile Include="coding\dsa_decoder.c" />
|
<ClCompile Include="coding\dsa_decoder.c" />
|
||||||
@ -237,12 +233,8 @@
|
|||||||
<ClCompile Include="coding\g719_decoder.c" />
|
<ClCompile Include="coding\g719_decoder.c" />
|
||||||
<ClCompile Include="coding\g721_decoder.c" />
|
<ClCompile Include="coding\g721_decoder.c" />
|
||||||
<ClCompile Include="coding\g7221_decoder.c" />
|
<ClCompile Include="coding\g7221_decoder.c" />
|
||||||
<ClCompile Include="coding\g7221_decoder_aes.c" />
|
|
||||||
<ClCompile Include="coding\g7221_decoder_lib.c" />
|
|
||||||
<ClCompile Include="coding\hca_decoder.c" />
|
<ClCompile Include="coding\hca_decoder.c" />
|
||||||
<ClCompile Include="coding\hca_decoder_clhca.c" />
|
|
||||||
<ClCompile Include="coding\ice_decoder.c" />
|
<ClCompile Include="coding\ice_decoder.c" />
|
||||||
<ClCompile Include="coding\ice_decoder_icelib.c" />
|
|
||||||
<ClCompile Include="coding\ima_decoder.c" />
|
<ClCompile Include="coding\ima_decoder.c" />
|
||||||
<ClCompile Include="coding\imuse_decoder.c" />
|
<ClCompile Include="coding\imuse_decoder.c" />
|
||||||
<ClCompile Include="coding\l5_555_decoder.c" />
|
<ClCompile Include="coding\l5_555_decoder.c" />
|
||||||
@ -269,13 +261,10 @@
|
|||||||
<ClCompile Include="coding\psx_decoder.c" />
|
<ClCompile Include="coding\psx_decoder.c" />
|
||||||
<ClCompile Include="coding\ptadpcm_decoder.c" />
|
<ClCompile Include="coding\ptadpcm_decoder.c" />
|
||||||
<ClCompile Include="coding\relic_decoder.c" />
|
<ClCompile Include="coding\relic_decoder.c" />
|
||||||
<ClCompile Include="coding\relic_decoder_lib.c" />
|
|
||||||
<ClCompile Include="coding\relic_decoder_mixfft.c" />
|
|
||||||
<ClCompile Include="coding\sassc_decoder.c" />
|
<ClCompile Include="coding\sassc_decoder.c" />
|
||||||
<ClCompile Include="coding\sdx2_decoder.c" />
|
<ClCompile Include="coding\sdx2_decoder.c" />
|
||||||
<ClCompile Include="coding\speex_decoder.c" />
|
<ClCompile Include="coding\speex_decoder.c" />
|
||||||
<ClCompile Include="coding\tac_decoder.c" />
|
<ClCompile Include="coding\tac_decoder.c" />
|
||||||
<ClCompile Include="coding\tac_decoder_lib.c" />
|
|
||||||
<ClCompile Include="coding\tantalus_decoder.c" />
|
<ClCompile Include="coding\tantalus_decoder.c" />
|
||||||
<ClCompile Include="coding\tgcadpcm_decoder.c" />
|
<ClCompile Include="coding\tgcadpcm_decoder.c" />
|
||||||
<ClCompile Include="coding\ubi_adpcm_decoder.c" />
|
<ClCompile Include="coding\ubi_adpcm_decoder.c" />
|
||||||
@ -293,6 +282,18 @@
|
|||||||
<ClCompile Include="coding\xa_decoder.c" />
|
<ClCompile Include="coding\xa_decoder.c" />
|
||||||
<ClCompile Include="coding\xmd_decoder.c" />
|
<ClCompile Include="coding\xmd_decoder.c" />
|
||||||
<ClCompile Include="coding\yamaha_decoder.c" />
|
<ClCompile Include="coding\yamaha_decoder.c" />
|
||||||
|
<ClCompile Include="coding\libs\circus_vq_lib.c" />
|
||||||
|
<ClCompile Include="coding\libs\clhca.c" />
|
||||||
|
<ClCompile Include="coding\libs\compresswave_lib.c" />
|
||||||
|
<ClCompile Include="coding\libs\g7221_aes.c" />
|
||||||
|
<ClCompile Include="coding\libs\g7221_lib.c" />
|
||||||
|
<ClCompile Include="coding\libs\icelib.c" />
|
||||||
|
<ClCompile Include="coding\libs\libacm_decode.c" />
|
||||||
|
<ClCompile Include="coding\libs\libacm_util.c" />
|
||||||
|
<ClCompile Include="coding\libs\nwa_lib.c" />
|
||||||
|
<ClCompile Include="coding\libs\relic_lib.c" />
|
||||||
|
<ClCompile Include="coding\libs\relic_mixfft.c" />
|
||||||
|
<ClCompile Include="coding\libs\tac_lib.c" />
|
||||||
<ClCompile Include="coding\libs\utkdec.c" />
|
<ClCompile Include="coding\libs\utkdec.c" />
|
||||||
<ClCompile Include="layout\blocked.c" />
|
<ClCompile Include="layout\blocked.c" />
|
||||||
<ClCompile Include="layout\blocked_adm.c" />
|
<ClCompile Include="layout\blocked_adm.c" />
|
||||||
|
@ -101,63 +101,18 @@
|
|||||||
<ClInclude Include="base\render.h">
|
<ClInclude Include="base\render.h">
|
||||||
<Filter>base\Header Files</Filter>
|
<Filter>base\Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="coding\acm_decoder_libacm.h">
|
|
||||||
<Filter>coding\Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="coding\circus_decoder_lib.h">
|
|
||||||
<Filter>coding\Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="coding\circus_decoder_lib_data.h">
|
|
||||||
<Filter>coding\Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="coding\circus_decoder_lzxpcm.h">
|
|
||||||
<Filter>coding\Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="coding\coding.h">
|
<ClInclude Include="coding\coding.h">
|
||||||
<Filter>coding\Header Files</Filter>
|
<Filter>coding\Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="coding\coding_utils_samples.h">
|
<ClInclude Include="coding\coding_utils_samples.h">
|
||||||
<Filter>coding\Header Files</Filter>
|
<Filter>coding\Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="coding\compresswave_decoder_lib.h">
|
|
||||||
<Filter>coding\Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="coding\g7221_decoder_aes.h">
|
|
||||||
<Filter>coding\Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="coding\g7221_decoder_lib.h">
|
|
||||||
<Filter>coding\Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="coding\g7221_decoder_lib_data.h">
|
|
||||||
<Filter>coding\Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="coding\g72x_state.h">
|
<ClInclude Include="coding\g72x_state.h">
|
||||||
<Filter>coding\Header Files</Filter>
|
<Filter>coding\Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="coding\hca_decoder_clhca.h">
|
|
||||||
<Filter>coding\Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="coding\ice_decoder_icelib.h">
|
|
||||||
<Filter>coding\Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="coding\mpeg_decoder.h">
|
<ClInclude Include="coding\mpeg_decoder.h">
|
||||||
<Filter>coding\Header Files</Filter>
|
<Filter>coding\Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="coding\nwa_decoder.h">
|
|
||||||
<Filter>coding\Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="coding\relic_decoder_lib.h">
|
|
||||||
<Filter>coding\Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="coding\tac_decoder_lib.h">
|
|
||||||
<Filter>coding\Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="coding\tac_decoder_lib_data.h">
|
|
||||||
<Filter>coding\Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="coding\tac_decoder_lib_ops.h">
|
|
||||||
<Filter>coding\Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="coding\vorbis_custom_data_fsb.h">
|
<ClInclude Include="coding\vorbis_custom_data_fsb.h">
|
||||||
<Filter>coding\Header Files</Filter>
|
<Filter>coding\Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
@ -167,6 +122,51 @@
|
|||||||
<ClInclude Include="coding\vorbis_custom_decoder.h">
|
<ClInclude Include="coding\vorbis_custom_decoder.h">
|
||||||
<Filter>coding\Header Files</Filter>
|
<Filter>coding\Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="coding\libs\circus_vq_data.h">
|
||||||
|
<Filter>coding\libs\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="coding\libs\circus_vq_lib.h">
|
||||||
|
<Filter>coding\libs\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="coding\libs\circus_vq_lzxpcm.h">
|
||||||
|
<Filter>coding\libs\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="coding\libs\clhca.h">
|
||||||
|
<Filter>coding\libs\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="coding\libs\compresswave_lib.h">
|
||||||
|
<Filter>coding\libs\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="coding\libs\g7221_aes.h">
|
||||||
|
<Filter>coding\libs\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="coding\libs\g7221_data.h">
|
||||||
|
<Filter>coding\libs\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="coding\libs\g7221_lib.h">
|
||||||
|
<Filter>coding\libs\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="coding\libs\icelib.h">
|
||||||
|
<Filter>coding\libs\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="coding\libs\libacm.h">
|
||||||
|
<Filter>coding\libs\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="coding\libs\nwa_lib.h">
|
||||||
|
<Filter>coding\libs\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="coding\libs\relic_lib.h">
|
||||||
|
<Filter>coding\libs\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="coding\libs\tac_data.h">
|
||||||
|
<Filter>coding\libs\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="coding\libs\tac_lib.h">
|
||||||
|
<Filter>coding\libs\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="coding\libs\tac_ops.h">
|
||||||
|
<Filter>coding\libs\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
<ClInclude Include="coding\libs\utkdec.h">
|
<ClInclude Include="coding\libs\utkdec.h">
|
||||||
<Filter>coding\libs\Header Files</Filter>
|
<Filter>coding\libs\Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
@ -457,12 +457,6 @@
|
|||||||
<ClCompile Include="coding\acm_decoder.c">
|
<ClCompile Include="coding\acm_decoder.c">
|
||||||
<Filter>coding\Source Files</Filter>
|
<Filter>coding\Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="coding\acm_decoder_decode.c">
|
|
||||||
<Filter>coding\Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="coding\acm_decoder_util.c">
|
|
||||||
<Filter>coding\Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="coding\adx_decoder.c">
|
<ClCompile Include="coding\adx_decoder.c">
|
||||||
<Filter>coding\Source Files</Filter>
|
<Filter>coding\Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
@ -478,18 +472,12 @@
|
|||||||
<ClCompile Include="coding\circus_decoder.c">
|
<ClCompile Include="coding\circus_decoder.c">
|
||||||
<Filter>coding\Source Files</Filter>
|
<Filter>coding\Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="coding\circus_decoder_lib.c">
|
|
||||||
<Filter>coding\Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="coding\coding_utils.c">
|
<ClCompile Include="coding\coding_utils.c">
|
||||||
<Filter>coding\Source Files</Filter>
|
<Filter>coding\Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="coding\compresswave_decoder.c">
|
<ClCompile Include="coding\compresswave_decoder.c">
|
||||||
<Filter>coding\Source Files</Filter>
|
<Filter>coding\Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="coding\compresswave_decoder_lib.c">
|
|
||||||
<Filter>coding\Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="coding\derf_decoder.c">
|
<ClCompile Include="coding\derf_decoder.c">
|
||||||
<Filter>coding\Source Files</Filter>
|
<Filter>coding\Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
@ -532,24 +520,12 @@
|
|||||||
<ClCompile Include="coding\g7221_decoder.c">
|
<ClCompile Include="coding\g7221_decoder.c">
|
||||||
<Filter>coding\Source Files</Filter>
|
<Filter>coding\Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="coding\g7221_decoder_aes.c">
|
|
||||||
<Filter>coding\Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="coding\g7221_decoder_lib.c">
|
|
||||||
<Filter>coding\Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="coding\hca_decoder.c">
|
<ClCompile Include="coding\hca_decoder.c">
|
||||||
<Filter>coding\Source Files</Filter>
|
<Filter>coding\Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="coding\hca_decoder_clhca.c">
|
|
||||||
<Filter>coding\Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="coding\ice_decoder.c">
|
<ClCompile Include="coding\ice_decoder.c">
|
||||||
<Filter>coding\Source Files</Filter>
|
<Filter>coding\Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="coding\ice_decoder_icelib.c">
|
|
||||||
<Filter>coding\Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="coding\ima_decoder.c">
|
<ClCompile Include="coding\ima_decoder.c">
|
||||||
<Filter>coding\Source Files</Filter>
|
<Filter>coding\Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
@ -628,12 +604,6 @@
|
|||||||
<ClCompile Include="coding\relic_decoder.c">
|
<ClCompile Include="coding\relic_decoder.c">
|
||||||
<Filter>coding\Source Files</Filter>
|
<Filter>coding\Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="coding\relic_decoder_lib.c">
|
|
||||||
<Filter>coding\Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="coding\relic_decoder_mixfft.c">
|
|
||||||
<Filter>coding\Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="coding\sassc_decoder.c">
|
<ClCompile Include="coding\sassc_decoder.c">
|
||||||
<Filter>coding\Source Files</Filter>
|
<Filter>coding\Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
@ -646,9 +616,6 @@
|
|||||||
<ClCompile Include="coding\tac_decoder.c">
|
<ClCompile Include="coding\tac_decoder.c">
|
||||||
<Filter>coding\Source Files</Filter>
|
<Filter>coding\Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="coding\tac_decoder_lib.c">
|
|
||||||
<Filter>coding\Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="coding\tantalus_decoder.c">
|
<ClCompile Include="coding\tantalus_decoder.c">
|
||||||
<Filter>coding\Source Files</Filter>
|
<Filter>coding\Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
@ -700,6 +667,42 @@
|
|||||||
<ClCompile Include="coding\yamaha_decoder.c">
|
<ClCompile Include="coding\yamaha_decoder.c">
|
||||||
<Filter>coding\Source Files</Filter>
|
<Filter>coding\Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="coding\libs\circus_vq_lib.c">
|
||||||
|
<Filter>coding\libs\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="coding\libs\clhca.c">
|
||||||
|
<Filter>coding\libs\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="coding\libs\compresswave_lib.c">
|
||||||
|
<Filter>coding\libs\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="coding\libs\g7221_aes.c">
|
||||||
|
<Filter>coding\libs\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="coding\libs\g7221_lib.c">
|
||||||
|
<Filter>coding\libs\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="coding\libs\icelib.c">
|
||||||
|
<Filter>coding\libs\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="coding\libs\libacm_decode.c">
|
||||||
|
<Filter>coding\libs\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="coding\libs\libacm_util.c">
|
||||||
|
<Filter>coding\libs\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="coding\libs\nwa_lib.c">
|
||||||
|
<Filter>coding\libs\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="coding\libs\relic_lib.c">
|
||||||
|
<Filter>coding\libs\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="coding\libs\relic_mixfft.c">
|
||||||
|
<Filter>coding\libs\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="coding\libs\tac_lib.c">
|
||||||
|
<Filter>coding\libs\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
<ClCompile Include="coding\libs\utkdec.c">
|
<ClCompile Include="coding\libs\utkdec.c">
|
||||||
<Filter>coding\libs\Source Files</Filter>
|
<Filter>coding\libs\Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "meta.h"
|
#include "meta.h"
|
||||||
#include "../coding/coding.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)] */
|
/* ACM - InterPlay infinity engine games [Planescape: Torment (PC), Baldur's Gate (PC)] */
|
||||||
VGMSTREAM* init_vgmstream_acm(STREAMFILE* sf) {
|
VGMSTREAM* init_vgmstream_acm(STREAMFILE* sf) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "meta.h"
|
#include "meta.h"
|
||||||
#include "../coding/coding.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)] */
|
/* .BIGRP - from Inti Creates "ICE"/"Imperial" engine [Blaster Master Zero 2 (SW), Gunvolt 3 (SW)] */
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "meta.h"
|
#include "meta.h"
|
||||||
#include "hca_keys.h"
|
#include "hca_keys.h"
|
||||||
#include "../coding/coding.h"
|
#include "../coding/coding.h"
|
||||||
#include "../coding/hca_decoder_clhca.h"
|
#include "../coding/libs/clhca.h"
|
||||||
#include "../util/channel_mappings.h"
|
#include "../util/channel_mappings.h"
|
||||||
#include "../util/companion_files.h"
|
#include "../util/companion_files.h"
|
||||||
#include "../util/cri_keys.h"
|
#include "../util/cri_keys.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user