From b2a27b42803ae4ba64f35d95bb289c773dbcfbef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Wallm=C3=A9nius?= Date: Sun, 13 Dec 2009 15:00:20 +0000 Subject: 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 --- apps/codecs/lib/mdct2.c | 12 ++++++++---- 1 file 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) { -- cgit v1.2.3