summaryrefslogtreecommitdiff
path: root/apps/codecs/lib/mdct2.c
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2009-12-13 15:00:20 +0000
committerNils Wallménius <nils@rockbox.org>2009-12-13 15:00:20 +0000
commitb2a27b42803ae4ba64f35d95bb289c773dbcfbef (patch)
tree9d990e294f9ce3b29e67098eea4ec39d3bd96a53 /apps/codecs/lib/mdct2.c
parent66776bc47922e039f43e2dd5dee15d05745e99c6 (diff)
Improved bitrev12, using a larger LUT to save one lookup, speeds up vorbis about 2% on beast, about 0.5% on h300
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23973 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/lib/mdct2.c')
-rw-r--r--apps/codecs/lib/mdct2.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/apps/codecs/lib/mdct2.c b/apps/codecs/lib/mdct2.c
index 5382a5b5e0..ba8b5ca6be 100644
--- a/apps/codecs/lib/mdct2.c
+++ b/apps/codecs/lib/mdct2.c
@@ -243,12 +243,16 @@ static inline void mdct_butterflies(int32_t *x,int points,int shift) {
mdct_butterfly_32(x+j);
}
-
-static const unsigned char bitrev[16] ICONST_ATTR =
- {0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15};
+static const unsigned char bitrev[] ICONST_ATTR =
+{
+ 0, 32, 16, 48, 8, 40, 24, 56, 4, 36, 20, 52, 12, 44, 28, 60,
+ 2, 34, 18, 50, 10, 42, 26, 58, 6, 38, 22, 54, 14, 46, 30, 62,
+ 1, 33, 17, 49, 9, 41, 25, 57, 5, 37, 21, 53, 13, 45, 29, 61,
+ 3, 35, 19, 51, 11, 43, 27, 59, 7, 39, 23, 55, 15, 47, 31, 63
+};
static inline int bitrev12(int x){
- return bitrev[x>>8]|(bitrev[(x&0x0f0)>>4]<<4)|(((int)bitrev[x&0x00f])<<8);
+ return bitrev[x>>6]|((bitrev[x&0x03f])<<6);
}
static inline void mdct_bitreverse(int32_t *x,int n,int step,int shift) {