diff --git a/src/formats.c b/src/formats.c index 3c44b450..d6b58b01 100644 --- a/src/formats.c +++ b/src/formats.c @@ -700,7 +700,6 @@ static const layout_info layout_info_list[] = { {layout_segmented, "segmented"}, {layout_layered, "layered"}, - {layout_aix, "AIX"}, {layout_blocked_mxch, "blocked (MxCh)"}, {layout_blocked_ast, "blocked (AST)"}, diff --git a/src/layout/aix_layout.c b/src/layout/aix_layout.c deleted file mode 100644 index be6be3a7..00000000 --- a/src/layout/aix_layout.c +++ /dev/null @@ -1,92 +0,0 @@ -#include "layout.h" -#include "../vgmstream.h" -#include "../coding/coding.h" - -void render_vgmstream_aix(sample_t * buffer, int32_t sample_count, VGMSTREAM * vgmstream) { - int samples_written=0; - aix_codec_data *data = vgmstream->codec_data; - - while (samples_writtensample_counts[data->current_segment]; - int current_stream; - int channels_sofar = 0; - - if (vgmstream->loop_flag && vgmstream_do_loop(vgmstream)) { - data->current_segment = 1; - for (current_stream = 0; current_stream < data->stream_count; current_stream++) - { - int i; - reset_vgmstream(data->adxs[data->current_segment*data->stream_count+current_stream]); - - /* carry over the history from the loop point */ - for (i=0;iadxs[data->stream_count+current_stream]->channels;i++) - { - data->adxs[1*data->stream_count+current_stream]->ch[i].adpcm_history1_32 = - data->adxs[0+current_stream]->ch[i].adpcm_history1_32; - data->adxs[1*data->stream_count+current_stream]->ch[i].adpcm_history2_32 = - data->adxs[0+current_stream]->ch[i].adpcm_history2_32; - } - } - vgmstream->samples_into_block = 0; - continue; - } - - samples_to_do = vgmstream_samples_to_do(samples_this_block, 1, vgmstream); - - /*printf("samples_to_do=%d,samples_this_block=%d,samples_written=%d,sample_count=%d\n",samples_to_do,samples_this_block,samples_written,sample_count);*/ - - if (samples_written+samples_to_do > sample_count) - samples_to_do=sample_count-samples_written; - - if (samples_to_do == 0) - { - int i; - data->current_segment++; - /*printf("next %d, %d samples\n",data->current_file,data->files[data->current_file]->total_values/data->files[data->current_file]->info.channels);*/ - for (current_stream = 0; current_stream < data->stream_count; current_stream++) - { - reset_vgmstream(data->adxs[data->current_segment*data->stream_count+current_stream]); - - /* carry over the history from the previous segment */ - for (i=0;iadxs[data->current_segment*data->stream_count+current_stream]->channels;i++) - { - data->adxs[data->current_segment*data->stream_count+current_stream]->ch[i].adpcm_history1_32 = - data->adxs[(data->current_segment-1)*data->stream_count+current_stream]->ch[i].adpcm_history1_32; - data->adxs[data->current_segment*data->stream_count+current_stream]->ch[i].adpcm_history2_32 = - data->adxs[(data->current_segment-1)*data->stream_count+current_stream]->ch[i].adpcm_history2_32; - } - } - vgmstream->samples_into_block = 0; - continue; - } - - /*printf("decode %d samples file %d\n",samples_to_do,data->current_file);*/ - if (samples_to_do > AIX_BUFFER_SIZE/2) - { - samples_to_do = AIX_BUFFER_SIZE/2; - } - - for (current_stream = 0; current_stream < data->stream_count; current_stream++) - { - int i,j; - VGMSTREAM *adx = data->adxs[data->current_segment*data->stream_count+current_stream]; - - render_vgmstream(data->buffer,samples_to_do,adx); - - for (i = 0; i < samples_to_do; i++) - { - for (j = 0; j < adx->channels; j++) - { - buffer[(i+samples_written)*vgmstream->channels+channels_sofar+j] = data->buffer[i*adx->channels+j]; - } - } - - channels_sofar += adx->channels; - } - - samples_written += samples_to_do; - vgmstream->current_sample += samples_to_do; - vgmstream->samples_into_block+=samples_to_do; - } -} diff --git a/src/layout/layout.h b/src/layout/layout.h index 258e47aa..e9003c8f 100644 --- a/src/layout/layout.h +++ b/src/layout/layout.h @@ -52,8 +52,6 @@ void render_vgmstream_interleave(sample_t * buffer, int32_t sample_count, VGMSTR void render_vgmstream_flat(sample_t * buffer, int32_t sample_count, VGMSTREAM * vgmstream); -void render_vgmstream_aix(sample_t * buffer, int32_t sample_count, VGMSTREAM * vgmstream); - void render_vgmstream_segmented(sample_t * buffer, int32_t sample_count, VGMSTREAM * vgmstream); segmented_layout_data* init_layout_segmented(int segment_count); int setup_layout_segmented(segmented_layout_data* data); diff --git a/src/libvgmstream.vcproj b/src/libvgmstream.vcproj index ed34b53a..924fc438 100644 --- a/src/libvgmstream.vcproj +++ b/src/libvgmstream.vcproj @@ -1990,10 +1990,6 @@ RelativePath=".\layout\segmented.c" > - - diff --git a/src/libvgmstream.vcxproj b/src/libvgmstream.vcxproj index 4200592f..02eaadda 100644 --- a/src/libvgmstream.vcxproj +++ b/src/libvgmstream.vcxproj @@ -547,7 +547,6 @@ - diff --git a/src/libvgmstream.vcxproj.filters b/src/libvgmstream.vcxproj.filters index e2c8e194..0390da1d 100644 --- a/src/libvgmstream.vcxproj.filters +++ b/src/libvgmstream.vcxproj.filters @@ -1180,9 +1180,6 @@ layout\Source Files - - layout\Source Files - layout\Source Files diff --git a/src/vgmstream.c b/src/vgmstream.c index 699f0f91..0bc74af1 100644 --- a/src/vgmstream.c +++ b/src/vgmstream.c @@ -602,7 +602,7 @@ void reset_vgmstream(VGMSTREAM * vgmstream) { * Otherwise hit_loop will be 0 and it will be copied over anyway when we * really hit the loop start. */ - /* reset custom codec and layout data */ + /* reset custom codec */ #ifdef VGM_USE_VORBIS if (vgmstream->coding_type == coding_OGG_VORBIS) { reset_ogg_vorbis(vgmstream); @@ -679,21 +679,10 @@ void reset_vgmstream(VGMSTREAM * vgmstream) { if (vgmstream->coding_type == coding_NWA) { nwa_codec_data *data = vgmstream->codec_data; - if (data) - reset_nwa(data->nwa); - } - - - if (vgmstream->layout_type == layout_aix) { - aix_codec_data *data = vgmstream->codec_data; - int i; - - data->current_segment = 0; - for (i = 0; i < data->segment_count*data->stream_count; i++) { - reset_vgmstream(data->adxs[i]); - } + if (data) reset_nwa(data->nwa); } + /* reset custom layouts */ if (vgmstream->layout_type == layout_segmented) { reset_layout_segmented(vgmstream->layout_data); } @@ -703,7 +692,7 @@ void reset_vgmstream(VGMSTREAM * vgmstream) { } /* note that this does not reset the constituent STREAMFILES - * (ch's streamfiles init in metas, nor their internal state) */ + * (vgmstream->ch[N].streamfiles' internal state, though shouldn't matter) */ } /* Allocate memory and setup a VGMSTREAM */ @@ -875,28 +864,6 @@ void close_vgmstream(VGMSTREAM * vgmstream) { /* free custom layouts */ - if (vgmstream->layout_type == layout_aix) { - aix_codec_data *data = (aix_codec_data *) vgmstream->codec_data; - - if (data) { - if (data->adxs) { - int i; - for (i = 0; i < data->segment_count*data->stream_count; i++) { - /* note that the close_streamfile won't do anything but deallocate itself, - * there is only one open file in vgmstream->ch[0].streamfile */ - close_vgmstream(data->adxs[i]); - } - free(data->adxs); - } - if (data->sample_counts) { - free(data->sample_counts); - } - - free(data); - } - vgmstream->codec_data = NULL; - } - if (vgmstream->layout_type == layout_segmented) { free_layout_segmented(vgmstream->layout_data); vgmstream->layout_data = NULL; @@ -1063,9 +1030,6 @@ void render_vgmstream(sample * buffer, int32_t sample_count, VGMSTREAM * vgmstre case layout_blocked_vs_square: render_vgmstream_blocked(buffer,sample_count,vgmstream); break; - case layout_aix: - render_vgmstream_aix(buffer,sample_count,vgmstream); - break; case layout_segmented: render_vgmstream_segmented(buffer,sample_count,vgmstream); break; @@ -2781,8 +2745,7 @@ int vgmstream_open_stream(VGMSTREAM * vgmstream, STREAMFILE *streamFile, off_t s /* stream/offsets not needed, managed by layout */ - if (vgmstream->layout_type == layout_aix || - vgmstream->layout_type == layout_segmented || + if (vgmstream->layout_type == layout_segmented || vgmstream->layout_type == layout_layered) return 1; diff --git a/src/vgmstream.h b/src/vgmstream.h index bb5eb763..b020300c 100644 --- a/src/vgmstream.h +++ b/src/vgmstream.h @@ -265,7 +265,6 @@ typedef enum { layout_blocked_vs_square, /* otherwise odd */ - layout_aix, /* CRI AIX's wheels within wheels */ layout_segmented, /* song divided in segments (song sections) */ layout_layered, /* song divided in layers (song channels) */ @@ -1109,20 +1108,6 @@ typedef struct { void *io_config; } acm_codec_data; -#define AIX_BUFFER_SIZE 0x1000 -/* AIXery */ -typedef struct { - sample_t buffer[AIX_BUFFER_SIZE]; - int segment_count; - int stream_count; - int current_segment; - /* one per segment */ - int32_t *sample_counts; - /* organized like: - * segment1_stream1, segment1_stream2, segment2_stream1, segment2_stream2*/ - VGMSTREAM **adxs; -} aix_codec_data; - /* for files made of "continuous" segments, one per section of a song (using a complete sub-VGMSTREAM) */ typedef struct { int segment_count;