[vorbis-dev] Re: use of 'long' in vorbis structures

David Etherton etherton at rockstarsandiego.com
Wed May 21 17:31:04 PDT 2003



Looking into it a little more, it looks like the codebooks are the cause -- they have lots of longs as internal structures and codebook.c and sharedbook.c both trigger several "software math library call" warning messages.

Looking in books/* header files, I see that most of the numbers in the static tables aren't even eight bits, much less 32 or 64.  Perhaps we could clean up the codebook code to use narrower types like ogg_int32_t?  Seems like that might save some memory too unless I'm totally misunderstanding things.

Rolling back my "long" changes, mdct_backward is 11% of my cpu time, vorbis_book_decodevv_add is 3%, and __divdi3 is 3%.

Applying the following minor patch to codebook.c totally eliminates __divdi3 from my profile:

C:\xiph\vorbis\lib>cvs diff -u codebook.c
Index: codebook.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/codebook.c,v
retrieving revision 1.39
diff -u -r1.39 codebook.c
--- codebook.c  28 Jun 2002 22:19:35 -0000      1.39
+++ codebook.c  22 May 2003 00:28:48 -0000
@@ -451,9 +451,10 @@
   return(0);
 }

-long vorbis_book_decodevv_add(codebook *book,float **a,long offset,int ch,
+long vorbis_book_decodevv_add(codebook *book,float **a,long _offset,int ch,
                              oggpack_buffer *b,int n){
-  long i,j,entry;
+  int offset = (int)_offset;
+  int i,j,entry;
   int chptr=0;

   for(i=offset/ch;i<(offset+n)/ch;){

-Dave

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list