1
0
Fork 0
forked from len0rd/rockbox

Submit FS#11445. Speed up of faad (aac) decoder via several optimizations like refactoring some requantization routines, moving several arrays and code tables to IRAM, using an optimized swap32() function and inlining several huffman decoder functions. Decoding is sped up by ~10% (PP5002, PP5022, MCF5249) and ~22% (MCF5250).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27225 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Andree Buschmann 2010-07-01 21:18:42 +00:00
parent b013fb76c4
commit 52f17dfe9d
19 changed files with 121 additions and 134 deletions

View file

@ -33,9 +33,10 @@
#include "bits.h"
/* Need to be large enough to fit the largest compressed sample in a file.
* Samples a little larger than 1 KB observed in a 256 kbps file.
* Samples were observed to need up to 1500 bytes (400 kbps nero aac).
*/
uint8_t static_buffer[2048];
#define BUFFER_SIZE 2048
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)
@ -47,7 +48,7 @@ void faad_initbits(bitfile *ld, const void *_buffer, const uint32_t buffer_size)
memset(ld, 0, sizeof(bitfile));
if (buffer_size == 0 || _buffer == NULL)
if (buffer_size == 0 || _buffer == NULL || (buffer_size+12)>BUFFER_SIZE)
{
ld->error = 1;
ld->no_more_reading = 1;