diff options
author | Nils Wallménius <nils@rockbox.org> | 2010-10-16 09:58:21 +0000 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2010-10-16 09:58:21 +0000 |
commit | c1bfe4eb620afb2ac0d9a8baef706f8fc1a4b00f (patch) | |
tree | 3b4b5077329e2f4c958e4bc9ed2fd32f4cf9761f /apps/codecs/libtremor | |
parent | 055071195ccfd03dd673424f1e5d28a72cb4c464 (diff) | |
download | rockbox-c1bfe4eb620afb2ac0d9a8baef706f8fc1a4b00f.tar.gz rockbox-c1bfe4eb620afb2ac0d9a8baef706f8fc1a4b00f.zip |
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
Diffstat (limited to 'apps/codecs/libtremor')
-rw-r--r-- | apps/codecs/libtremor/codebook.c | 3 |
1 files changed, 2 insertions, 1 deletions
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, | |||
277 | long *buf, int n){ | 277 | long *buf, int n){ |
278 | long *bufptr = buf; | 278 | long *bufptr = buf; |
279 | long *bufend = buf + n; | 279 | long *bufend = buf + n; |
280 | const unsigned int cachemask = (1<<book->dec_firsttablen)-1; | ||
280 | 281 | ||
281 | while (bufptr<bufend) { | 282 | while (bufptr<bufend) { |
282 | if (b->headend > 8) { | 283 | if (b->headend > 8) { |
@@ -302,7 +303,7 @@ static long decode_packed_block(codebook *book, oggpack_buffer *b, | |||
302 | bit+=32; | 303 | bit+=32; |
303 | } | 304 | } |
304 | 305 | ||
305 | ogg_int32_t entry = book->dec_firsttable[cache&((1<<book->dec_firsttablen)-1)]; | 306 | ogg_int32_t entry = book->dec_firsttable[cache&cachemask]; |
306 | if(UNLIKELY(entry < 0)){ | 307 | if(UNLIKELY(entry < 0)){ |
307 | const long lo = (entry>>15)&0x7fff, hi = book->used_entries-(entry&0x7fff); | 308 | const long lo = (entry>>15)&0x7fff, hi = book->used_entries-(entry&0x7fff); |
308 | entry = bisect_codelist(lo, hi, cache, book->codelist); | 309 | entry = bisect_codelist(lo, hi, cache, book->codelist); |