summaryrefslogtreecommitdiff
path: root/apps/codecs/libtremor
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libtremor')
-rw-r--r--apps/codecs/libtremor/codebook.c10
-rw-r--r--apps/codecs/libtremor/misc.h12
2 files changed, 5 insertions, 17 deletions
diff --git a/apps/codecs/libtremor/codebook.c b/apps/codecs/libtremor/codebook.c
index 8c319ab49e..5ffd0e308b 100644
--- a/apps/codecs/libtremor/codebook.c
+++ b/apps/codecs/libtremor/codebook.c
@@ -154,9 +154,9 @@ STIN long decode_packed_entry_number(codebook *book,
long lo,hi;
long lok = oggpack_look(b,book->dec_firsttablen);
- if (EXPECT(lok >= 0, 1)) {
+ if (likely(lok >= 0)) {
long entry = book->dec_firsttable[lok];
- if(EXPECT(entry&0x80000000UL, 0)){
+ if(unlikely(entry&0x80000000UL)){
lo=(entry>>15)&0x7fff;
hi=book->used_entries-(entry&0x7fff);
}else{
@@ -218,7 +218,7 @@ static long decode_packed_block(codebook *book, oggpack_buffer *b,
bitend = ((adr&3)+b->headend)*8;
while (bufptr<bufend){
long entry, lo, hi;
- if (EXPECT(cachesize<book->dec_maxlength, 0)) {
+ if (unlikely(cachesize<book->dec_maxlength)) {
if (bit-cachesize+32>=bitend)
break;
bit-=cachesize;
@@ -230,13 +230,13 @@ static long decode_packed_block(codebook *book, oggpack_buffer *b,
}
entry=book->dec_firsttable[cache&((1<<book->dec_firsttablen)-1)];
- if(EXPECT(entry&0x80000000UL, 0)){
+ if(unlikely(entry&0x80000000UL)){
lo=(entry>>15)&0x7fff;
hi=book->used_entries-(entry&0x7fff);
{
ogg_uint32_t testword=bitreverse((ogg_uint32_t)cache);
- while(EXPECT(hi-lo>1, 1)){
+ while(likely(hi-lo>1)){
long p=(hi-lo)>>1;
if (book->codelist[lo+p]>testword)
hi-=p;
diff --git a/apps/codecs/libtremor/misc.h b/apps/codecs/libtremor/misc.h
index 7d8b846381..e94236c2a8 100644
--- a/apps/codecs/libtremor/misc.h
+++ b/apps/codecs/libtremor/misc.h
@@ -275,17 +275,5 @@ static inline ogg_int32_t VFLOAT_ADD(ogg_int32_t a,ogg_int32_t ap,
return(a);
}
-#ifdef __GNUC__
-#if __GNUC__ >= 3
-#define EXPECT(a, b) __builtin_expect((a), (b))
-#else
-#define EXPECT(a, b) (a)
-#endif
-#else
-#define EXPECT(a, b) (a)
#endif
-#endif
-
-
-