diff options
author | Thom Johansen <thomj@rockbox.org> | 2005-06-11 14:45:48 +0000 |
---|---|---|
committer | Thom Johansen <thomj@rockbox.org> | 2005-06-11 14:45:48 +0000 |
commit | 5f12af28fb46d3d14e3168a55a34f3267543b312 (patch) | |
tree | cb5fa7829bba484deb095f4aa453caab5acdc298 /apps/codecs/liba52/parse.c | |
parent | c0f9ad61fbf4ea4e774b42a95a8f567a1fb1db1b (diff) |
Big performance improvement for liba52. A couple of small ASM opts, and lots IRAM usage.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6676 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/liba52/parse.c')
-rw-r--r-- | apps/codecs/liba52/parse.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/codecs/liba52/parse.c b/apps/codecs/liba52/parse.c index 9575397a95..3025fb54b6 100644 --- a/apps/codecs/liba52/parse.c +++ b/apps/codecs/liba52/parse.c @@ -48,6 +48,9 @@ typedef struct { int q4_ptr; } quantizer_set_t; +static a52_state_t istate IDATA_ATTR; +static sample_t isamples[256*12] IDATA_ATTR; + static uint8_t halfrate[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3}; a52_state_t * a52_init (uint32_t mm_accel) @@ -55,6 +58,12 @@ a52_state_t * a52_init (uint32_t mm_accel) a52_state_t * state; int i; + #if CONFIG_CPU==MCF5249 && !defined(SIMULATOR) + asm volatile ("move.l #0x30, %macsr"); /* frac. mode with rounding */ + #endif + /* + this needs to come back if we ever want two decoder instances + simultenously. NOTE, you also need to remove comments in a52_free. state = (a52_state_t *) malloc (sizeof (a52_state_t)); if (state == NULL) return NULL; @@ -65,6 +74,9 @@ a52_state_t * a52_init (uint32_t mm_accel) return NULL; } + */ + state = &istate; + state->samples = isamples; for (i = 0; i < 256 * 12; i++) state->samples[i] = 0; @@ -940,6 +952,9 @@ int a52_block (a52_state_t * state) void a52_free (a52_state_t * state) { + (void)state; + /* free (state->samples); free (state); + */ } |