Skip to content
This repository has been archived by the owner on Jan 14, 2022. It is now read-only.

Commit

Permalink
Added gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
Spritetm committed May 14, 2015
1 parent 67195c7 commit b5352ba
Show file tree
Hide file tree
Showing 12 changed files with 112 additions and 109 deletions.
9 changes: 9 additions & 0 deletions .gitignore
@@ -0,0 +1,9 @@
bin/eagle.*
mp3/driver/.output
mp3/mad/.output
mp3/user/.output
mp3/.output
mp3/mapfile



2 changes: 1 addition & 1 deletion include/espressif/c_types.h
Expand Up @@ -74,7 +74,7 @@ typedef enum {

#ifdef ICACHE_FLASH
#define ICACHE_FLASH_ATTR __attribute__((section(".irom0.text")))
#define ICACHE_RODATA_ATTR __attribute__((section(".irom.text")))
#define ICACHE_RODATA_ATTR __attribute__((section(".irom.text"),aligned(4)))
#else
#define ICACHE_FLASH_ATTR
#endif /* ICACHE_FLASH */
Expand Down
Binary file removed mp3/driver/.output/eagle/debug/lib/libdriver.a
Binary file not shown.
Binary file removed mp3/mad/.output/eagle/debug/lib/libmad.a
Binary file not shown.
Binary file removed mp3/mad/.output/eagle/debug/obj/decoder.o
Binary file not shown.
Binary file removed mp3/mad/.output/eagle/debug/obj/huffman.o
Binary file not shown.
30 changes: 0 additions & 30 deletions mp3/mad/.output/eagle/debug/obj/layer3.d

This file was deleted.

Binary file removed mp3/mad/.output/eagle/debug/obj/layer3.o
Binary file not shown.
27 changes: 19 additions & 8 deletions mp3/mad/decoder.c
Expand Up @@ -322,7 +322,9 @@ int ICACHE_FLASH_ATTR run_sync(struct mad_decoder *decoder)
struct mad_frame *frame;
struct mad_synth *synth;
int result = 0;
int r;

printf("run_sync\n");
if (decoder->input_func == 0)
return 0;

Expand All @@ -346,7 +348,9 @@ int ICACHE_FLASH_ATTR run_sync(struct mad_decoder *decoder)
mad_stream_options(stream, decoder->options);

do {
switch (decoder->input_func(decoder->cb_data, stream)) {
r=decoder->input_func(decoder->cb_data, stream);
printf("Input fn: %d\n", r);
switch (r) {
case MAD_FLOW_STOP:
goto done;
case MAD_FLOW_BREAK:
Expand All @@ -373,9 +377,11 @@ int ICACHE_FLASH_ATTR run_sync(struct mad_decoder *decoder)
# endif

if (decoder->header_func) {
if (mad_header_decode(&frame->header, stream) == -1) {
if (!MAD_RECOVERABLE(stream->error))
break;
r=mad_header_decode(&frame->header, stream);
printf("mad_header_decode_func: %d\n", r);
if (r!=-1) {
// if (!MAD_RECOVERABLE(stream->error))
// break;

switch (error_func(error_data, stream, frame)) {
case MAD_FLOW_STOP:
Expand All @@ -401,9 +407,11 @@ int ICACHE_FLASH_ATTR run_sync(struct mad_decoder *decoder)
}
}

if (mad_frame_decode(frame, stream) == -1) {
if (!MAD_RECOVERABLE(stream->error))
break;
r=mad_frame_decode(frame, stream);
printf("mad_frame_decode: %d\n", r);
if (r == -1) {
// if (!MAD_RECOVERABLE(stream->error))
// break;

switch (error_func(error_data, stream, frame)) {
case MAD_FLOW_STOP:
Expand Down Expand Up @@ -435,6 +443,7 @@ int ICACHE_FLASH_ATTR run_sync(struct mad_decoder *decoder)

mad_synth_frame(synth, frame);

printf("Calling output fn\n");
if (decoder->output_func) {
switch (decoder->output_func(decoder->cb_data,
&frame->header, &synth->pcm)) {
Expand Down Expand Up @@ -534,6 +543,7 @@ int ICACHE_FLASH_ATTR mad_decoder_run(struct mad_decoder *decoder, enum mad_deco
{
int result;
int (*run)(struct mad_decoder *) = 0;
static char *decsync[sizeof(*decoder->sync)];

switch (decoder->mode = mode) {
case MAD_DECODER_MODE_SYNC:
Expand All @@ -550,7 +560,8 @@ int ICACHE_FLASH_ATTR mad_decoder_run(struct mad_decoder *decoder, enum mad_deco
if (run == 0)
return -1;

decoder->sync = malloc(sizeof(*decoder->sync));
// decoder->sync = malloc(sizeof(*decoder->sync));
decoder->sync=(void*)decsync;
if (decoder->sync == 0)
return -1;

Expand Down
40 changes: 20 additions & 20 deletions mp3/mad/huffman.c
Expand Up @@ -50,7 +50,7 @@
# endif

static
union huffquad ICACHE_FLASH_ATTR const hufftabA[] = {
union huffquad ICACHE_RODATA_ATTR const hufftabA[] = {
/* 0000 */ PTR(16, 2),
/* 0001 */ PTR(20, 2),
/* 0010 */ PTR(24, 1),
Expand Down Expand Up @@ -90,7 +90,7 @@ union huffquad ICACHE_FLASH_ATTR const hufftabA[] = {
};

static
union huffquad ICACHE_FLASH_ATTR const hufftabB[] = {
union huffquad ICACHE_RODATA_ATTR const hufftabB[] = {
/* 0000 */ V(1, 1, 1, 1, 4),
/* 0001 */ V(1, 1, 1, 0, 4),
/* 0010 */ V(1, 1, 0, 1, 4),
Expand Down Expand Up @@ -126,12 +126,12 @@ union huffquad ICACHE_FLASH_ATTR const hufftabB[] = {
# endif

static
union huffpair ICACHE_FLASH_ATTR const hufftab0[] = {
union huffpair ICACHE_RODATA_ATTR const hufftab0[] = {
/* */ V(0, 0, 0)
};

static
union huffpair ICACHE_FLASH_ATTR const hufftab1[] = {
union huffpair ICACHE_RODATA_ATTR const hufftab1[] = {
/* 000 */ V(1, 1, 3),
/* 001 */ V(0, 1, 3),
/* 010 */ V(1, 0, 2),
Expand All @@ -143,7 +143,7 @@ union huffpair ICACHE_FLASH_ATTR const hufftab1[] = {
};

static
union huffpair ICACHE_FLASH_ATTR const hufftab2[] = {
union huffpair ICACHE_RODATA_ATTR const hufftab2[] = {
/* 000 */ PTR(8, 3),
/* 001 */ V(1, 1, 3),
/* 010 */ V(0, 1, 3),
Expand All @@ -165,7 +165,7 @@ union huffpair ICACHE_FLASH_ATTR const hufftab2[] = {
};

static
union huffpair ICACHE_FLASH_ATTR const hufftab3[] = {
union huffpair ICACHE_RODATA_ATTR const hufftab3[] = {
/* 000 */ PTR(8, 3),
/* 001 */ V(1, 0, 3),
/* 010 */ V(1, 1, 2),
Expand All @@ -187,7 +187,7 @@ union huffpair ICACHE_FLASH_ATTR const hufftab3[] = {
};

static
union huffpair ICACHE_FLASH_ATTR const hufftab5[] = {
union huffpair ICACHE_RODATA_ATTR const hufftab5[] = {
/* 000 */ PTR(8, 4),
/* 001 */ V(1, 1, 3),
/* 010 */ V(0, 1, 3),
Expand Down Expand Up @@ -221,7 +221,7 @@ union huffpair ICACHE_FLASH_ATTR const hufftab5[] = {
};

static
union huffpair ICACHE_FLASH_ATTR const hufftab6[] = {
union huffpair ICACHE_RODATA_ATTR const hufftab6[] = {
/* 0000 */ PTR(16, 3),
/* 0001 */ PTR(24, 1),
/* 0010 */ PTR(26, 1),
Expand Down Expand Up @@ -259,7 +259,7 @@ union huffpair ICACHE_FLASH_ATTR const hufftab6[] = {
};

static
union huffpair ICACHE_FLASH_ATTR const hufftab7[] = {
union huffpair ICACHE_RODATA_ATTR const hufftab7[] = {
/* 0000 */ PTR(16, 4),
/* 0001 */ PTR(32, 4),
/* 0010 */ PTR(48, 2),
Expand Down Expand Up @@ -346,7 +346,7 @@ union huffpair ICACHE_FLASH_ATTR const hufftab7[] = {
/* this version saves 8 entries (16 bytes) at the expense of
an extra lookup in 4 out of 36 cases */
static
union huffpair ICACHE_FLASH_ATTR const hufftab8[] = {
union huffpair ICACHE_RODATA_ATTR const hufftab8[] = {
/* 0000 */ PTR(16, 4),
/* 0001 */ PTR(32, 2),
/* 0010 */ V(1, 2, 4),
Expand Down Expand Up @@ -424,7 +424,7 @@ union huffpair ICACHE_FLASH_ATTR const hufftab8[] = {
};
# else
static
union huffpair ICACHE_FLASH_ATTR const hufftab8[] = {
union huffpair ICACHE_RODATA_ATTR const hufftab8[] = {
/* 0000 */ PTR(16, 4),
/* 0001 */ PTR(32, 4),
/* 0010 */ V(1, 2, 4),
Expand Down Expand Up @@ -509,7 +509,7 @@ union huffpair ICACHE_FLASH_ATTR const hufftab8[] = {
# endif

static
union huffpair ICACHE_FLASH_ATTR const hufftab9[] = {
union huffpair ICACHE_RODATA_ATTR const hufftab9[] = {
/* 0000 */ PTR(16, 4),
/* 0001 */ PTR(32, 3),
/* 0010 */ PTR(40, 2),
Expand Down Expand Up @@ -581,7 +581,7 @@ union huffpair ICACHE_FLASH_ATTR const hufftab9[] = {
};

static
union huffpair ICACHE_FLASH_ATTR const hufftab10[] = {
union huffpair ICACHE_RODATA_ATTR const hufftab10[] = {
/* 0000 */ PTR(16, 4),
/* 0001 */ PTR(32, 4),
/* 0010 */ PTR(48, 2),
Expand Down Expand Up @@ -719,7 +719,7 @@ union huffpair ICACHE_FLASH_ATTR const hufftab10[] = {
};

static
union huffpair ICACHE_FLASH_ATTR const hufftab11[] = {
union huffpair ICACHE_RODATA_ATTR const hufftab11[] = {
/* 0000 */ PTR(16, 4),
/* 0001 */ PTR(32, 4),
/* 0010 */ PTR(48, 4),
Expand Down Expand Up @@ -855,7 +855,7 @@ union huffpair ICACHE_FLASH_ATTR const hufftab11[] = {
};

static
union huffpair ICACHE_FLASH_ATTR const hufftab12[] = {
union huffpair ICACHE_RODATA_ATTR const hufftab12[] = {
/* 0000 */ PTR(16, 4),
/* 0001 */ PTR(32, 4),
/* 0010 */ PTR(48, 4),
Expand Down Expand Up @@ -983,7 +983,7 @@ union huffpair ICACHE_FLASH_ATTR const hufftab12[] = {
};

static
union huffpair ICACHE_FLASH_ATTR const hufftab13[] = {
union huffpair ICACHE_RODATA_ATTR const hufftab13[] = {
/* 0000 */ PTR(16, 4),
/* 0001 */ PTR(32, 4),
/* 0010 */ PTR(48, 4),
Expand Down Expand Up @@ -1509,7 +1509,7 @@ union huffpair ICACHE_FLASH_ATTR const hufftab13[] = {
};

static
union huffpair ICACHE_FLASH_ATTR const hufftab15[] = {
union huffpair ICACHE_RODATA_ATTR const hufftab15[] = {
/* 0000 */ PTR(16, 4),
/* 0001 */ PTR(32, 4),
/* 0010 */ PTR(48, 4),
Expand Down Expand Up @@ -2017,7 +2017,7 @@ union huffpair ICACHE_FLASH_ATTR const hufftab15[] = {
};

static
union huffpair ICACHE_FLASH_ATTR const hufftab16[] = {
union huffpair ICACHE_RODATA_ATTR const hufftab16[] = {
/* 0000 */ PTR(16, 4),
/* 0001 */ PTR(32, 4),
/* 0010 */ PTR(48, 4),
Expand Down Expand Up @@ -2551,7 +2551,7 @@ union huffpair ICACHE_FLASH_ATTR const hufftab16[] = {
};

static
union huffpair ICACHE_FLASH_ATTR const hufftab24[] = {
union huffpair ICACHE_RODATA_ATTR const hufftab24[] = {
/* 0000 */ PTR(16, 4),
/* 0001 */ PTR(32, 4),
/* 0010 */ PTR(48, 4),
Expand Down Expand Up @@ -3073,7 +3073,7 @@ union huffpair ICACHE_FLASH_ATTR const hufftab24[] = {

union huffquad const *const mad_huff_quad_table[2] = { hufftabA, hufftabB };

struct hufftable const ICACHE_FLASH_ATTR mad_huff_pair_table[32] = {
struct hufftable const ICACHE_RODATA_ATTR mad_huff_pair_table[32] = {
/* 0 */ { hufftab0, 0, 0 },
/* 1 */ { hufftab1, 0, 3 },
/* 2 */ { hufftab2, 0, 3 },
Expand Down

0 comments on commit b5352ba

Please sign in to comment.