summaryrefslogtreecommitdiff
path: root/apps/codecs/libfaad/bits.c
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2011-04-24 20:19:05 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2011-04-24 20:19:05 +0000
commita602f46d69d9d18756b7f317470f654f695faa80 (patch)
treef111cc29197def94d5404d15c7febfd06efed9f7 /apps/codecs/libfaad/bits.c
parent69580a96eb816d9b811c542d38181126243d8563 (diff)
downloadrockbox-a602f46d69d9d18756b7f317470f654f695faa80.zip
rockbox-a602f46d69d9d18756b7f317470f654f695faa80.tar.gz
rockbox-a602f46d69d9d18756b7f317470f654f695faa80.tar.bz2
rockbox-a602f46d69d9d18756b7f317470f654f695faa80.tar.xz
Rework of libfaad in several areas. Allow removal of malloc with a new define FAAD_STATIC_ALLOC (in common.h). For now malloc is not fully removed but used by a few arrays needed for AAC-HE SBR+PS only. Reason to keep malloc is to have this amount of memory available for AAC-LC files which might require large m4a tables. The changes make the allocation routines much smaller, better centralized and allow to move duplicated code from aac.c/raa.c to libfaad. The rework includes removal of (now and former) unused code as well.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29778 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libfaad/bits.c')
-rw-r--r--apps/codecs/libfaad/bits.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/codecs/libfaad/bits.c b/apps/codecs/libfaad/bits.c
index 781eb4f..a364007 100644
--- a/apps/codecs/libfaad/bits.c
+++ b/apps/codecs/libfaad/bits.c
@@ -36,7 +36,7 @@
* Samples were observed to need up to 1500 bytes (400 kbps nero aac).
*/
#define BUFFER_SIZE 2048
-uint8_t static_buffer[BUFFER_SIZE] IBSS_ATTR;
+static uint8_t static_buffer[BUFFER_SIZE] IBSS_ATTR;
/* initialize buffer, call once before first getbits or showbits */
void faad_initbits(bitfile *ld, const void *_buffer, const uint32_t buffer_size)
@@ -111,6 +111,7 @@ uint8_t faad_byte_align(bitfile *ld)
}
/* rewind to beginning */
+/* not used
void faad_rewindbits(bitfile *ld)
{
uint32_t tmp;
@@ -131,7 +132,9 @@ void faad_rewindbits(bitfile *ld)
ld->bytes_used = 0;
ld->no_more_reading = 0;
}
+*/
+#ifdef ERROR_RESILIENCE
uint8_t *faad_getbitbuffer(bitfile *ld, uint32_t bits
DEBUGDEC)
{
@@ -139,7 +142,7 @@ uint8_t *faad_getbitbuffer(bitfile *ld, uint32_t bits
uint8_t temp;
uint16_t bytes = (uint16_t)bits / 8;
uint8_t remainder = (uint8_t)bits % 8;
-
+
uint8_t *buffer = (uint8_t*)faad_malloc((bytes+1)*sizeof(uint8_t));
for (i = 0; i < bytes; i++)
@@ -156,6 +159,7 @@ uint8_t *faad_getbitbuffer(bitfile *ld, uint32_t bits
return buffer;
}
+#endif
#ifdef DRM
/* return the original data buffer */
@@ -172,6 +176,7 @@ uint32_t faad_origbitbuffer_size(bitfile *ld)
#endif
/* reversed bit reading routines, used for RVLC and HCR */
+/* not used
void faad_initbits_rev(bitfile *ld, void *buffer,
uint32_t bits_in_buffer)
{
@@ -200,3 +205,4 @@ void faad_initbits_rev(bitfile *ld, void *buffer,
ld->no_more_reading = 0;
ld->error = 0;
}
+*/