From c1bfe4eb620afb2ac0d9a8baef706f8fc1a4b00f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Wallm=C3=A9nius?= Date: Sat, 16 Oct 2010 09:58:21 +0000 Subject: libtremor: tiny optimization 0.5%-1.5% on coldfire and PP git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28285 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libtremor/codebook.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/codecs/libtremor/codebook.c b/apps/codecs/libtremor/codebook.c index 772a81c7f9..b27c2e390f 100644 --- a/apps/codecs/libtremor/codebook.c +++ b/apps/codecs/libtremor/codebook.c @@ -277,6 +277,7 @@ static long decode_packed_block(codebook *book, oggpack_buffer *b, long *buf, int n){ long *bufptr = buf; long *bufend = buf + n; + const unsigned int cachemask = (1<dec_firsttablen)-1; while (bufptrheadend > 8) { @@ -302,7 +303,7 @@ static long decode_packed_block(codebook *book, oggpack_buffer *b, bit+=32; } - ogg_int32_t entry = book->dec_firsttable[cache&((1<dec_firsttablen)-1)]; + ogg_int32_t entry = book->dec_firsttable[cache&cachemask]; if(UNLIKELY(entry < 0)){ const long lo = (entry>>15)&0x7fff, hi = book->used_entries-(entry&0x7fff); entry = bisect_codelist(lo, hi, cache, book->codelist); -- cgit v1.2.3