From 67efbc13870ee87ce3df442f7c396c13481921ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Wallm=C3=A9nius?= Date: Mon, 6 Dec 2010 14:36:52 +0000 Subject: libtremor: Merge in upstream revision 17375. This removes tremor's internal ogg code and now uses libogg instead so a bunch of changes are just adjusting to the new api. Also brings in improvements to vorbisfile which fixes FS#10484. Disabled a lot of unused code in the libogg files and moved some small functions into the ogg.h header so they can be inlined. Some small tweaks to fix warnings. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28742 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libtremor/codebook.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'apps/codecs/libtremor/codebook.c') diff --git a/apps/codecs/libtremor/codebook.c b/apps/codecs/libtremor/codebook.c index 561b597..860cf07 100644 --- a/apps/codecs/libtremor/codebook.c +++ b/apps/codecs/libtremor/codebook.c @@ -279,7 +279,7 @@ static long decode_packed_block(codebook *book, oggpack_buffer *b, long *bufend = buf + n; while (bufptrheadend > 8) { + if(b->endbyte < b->storage - 8) { ogg_uint32_t *ptr; unsigned long bit, bitend; unsigned long adr; @@ -292,10 +292,10 @@ static long decode_packed_block(codebook *book, oggpack_buffer *b, const ogg_uint32_t *book_codelist = book->codelist; const char *book_dec_codelengths = book->dec_codelengths; - adr = (unsigned long)b->headptr; - bit = (adr&3)*8+b->headbit; + adr = (unsigned long)b->ptr; + bit = (adr&3)*8+b->endbit; ptr = (ogg_uint32_t*)(adr&~3); - bitend = ((adr&3)+b->headend)*8; + bitend = ((adr&3)+(b->storage-b->endbyte))*8; while (bufptr=bitend) @@ -323,11 +323,11 @@ static long decode_packed_block(codebook *book, oggpack_buffer *b, cache >>= l; } - adr=(unsigned long)b->headptr; + adr=(unsigned long)b->ptr; bit-=(adr&3)*8+cachesize; - b->headend-=(bit/8); - b->headptr+=bit/8; - b->headbit=bit%8; + b->endbyte+=bit/8; + b->ptr+=bit/8; + b->endbit=bit&7; } else { long r = decode_packed_entry_number(book, b); if (r == -1) return bufptr-buf; @@ -337,7 +337,6 @@ static long decode_packed_block(codebook *book, oggpack_buffer *b, return n; } - /* Decode side is specced and easier, because we don't need to find matches using different criteria; we simply read and map. There are two things we need to do 'depending': @@ -570,3 +569,4 @@ long vorbis_book_decodevv_add(codebook *book,ogg_int32_t **a, } return(0); } + -- cgit v1.1