1
0
Fork 0
forked from len0rd/rockbox

C optimisations to the predictor decoding - create a single function for decoding stereo streams, and reorganise to minimise the number of variables used. My -c1000 test track now decodes at 93% realtime on PortalPlayer (was 78%), 187% on Coldfire (was 170%) and 447% on Gigabeat (was 408%).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13608 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dave Chapman 2007-06-10 08:55:16 +00:00
parent 57440d5292
commit 601ede7f9c
4 changed files with 206 additions and 133 deletions

View file

@ -68,24 +68,28 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
#define HISTORY_SIZE 512
#define PREDICTOR_ORDER 8
/* Total size of all predictor histories - 50 * sizeof(int32_t) */
#define PREDICTOR_SIZE 50
struct predictor_t
{
/* Adaption co-efficients */
int32_t coeffsA[4];
int32_t coeffsB[5];
/* Filter histories */
int32_t historybuffer[HISTORY_SIZE + PREDICTOR_ORDER * 4];
int32_t* delayA;
int32_t* delayB;
int32_t* adaptcoeffsA;
int32_t* adaptcoeffsB;
int32_t* buf;
int32_t lastA;
int32_t YlastA;
int32_t XlastA;
int32_t filterA;
int32_t filterB;
int32_t YfilterA;
int32_t XfilterA;
int32_t YfilterB;
int32_t XfilterB;
/* Adaption co-efficients */
int32_t YcoeffsA[4];
int32_t XcoeffsA[4];
int32_t YcoeffsB[5];
int32_t XcoeffsB[5];
int32_t historybuffer[HISTORY_SIZE + PREDICTOR_SIZE];
};
struct ape_ctx_t
@ -129,8 +133,7 @@ struct ape_ctx_t
int frameflags;
int currentframeblocks;
int blocksdecoded;
struct predictor_t predictorY;
struct predictor_t predictorX;
struct predictor_t predictor;
};
int ape_parseheader(int fd, struct ape_ctx_t* ape_ctx);