[vorbis-dev] vorbis on playstation 2

David Etherton etherton at rockstarsandiego.com
Wed Feb 5 12:58:44 PST 2003


I'm interested in getting vorbis up and running on the PlayStation 2.  I'm
an official developer, not a ps2 linux developer, but the issues should be
roughly the same.  I've gotten the code to compile but our setup
(intentionally) doesn't have libm so I'm seeing references to several
double-precision math functions.

Some of the issues I'm seeing:

- As reported on this list a few years ago(!), longs are 64 bits.  That's
really not a big deal as long as it's not part of a binary file.  Perhaps
the lingering references to "longs" in the code could be changed to
ogg_int32_t instead for clarify?  It looks like it's mostly in ogg.h.

- I added the following clause to os_types.h before the final config clause
(we're using PC-hosted tools and don't have autoconf)

#elif defined(R5900)

   /* PS2 EE */
   typedef long ogg_int64_t;
   typedef int ogg_int32_t;
   typedef unsigned ogg_uint32_t;
   typedef short ogg_int16_t;


- There are a lot of double-precision constants in the source code, which by
default would cause the expression to promote to double-precision
arithmetic.  Unfortunately doubles are done entirely with software emulation
on the PS2, so are a performance no-no.  I can turn on a compiler option to
treat all constants as single-precision, but the code already uses a mix of
single- and double-precision constants so it would seem possible to fix it
in the source.  M_PI is used in several places, and it's a double-precision
constant; perhaps we could use an ogg_pi #define to isolate this dependency?

- Several initialization functions use double-precision arithmetic just to
set up lookup tables.  Are things stabilized enough now that we could add
the option of making them statically tabled in the code?  Also, in my
experience LUT's on the PS2 are often slower than a quick taylor series
because of the high cost of D$ misses on that platform.

I know I'm showing up out of nowhere with a lot of questions, and I
apologize for that.  I am interested in contributing improvements back into
the code base if that makes sense; ultimately, I would like it if other PS2
developers could grab the "standard" cut of vorbis and have it run optimally
"out of the box".

I took a brief look at Tremor, but the PS2 has more floating-point
performance than integer performance, and it has a separate vector unit that
could run tasks in parallel with the main CPU.  The IOP on the PS2 is a MIPS
3000 at 36 Mhz, and I've been told that there's just not enough horsepower
there so I'm sticking with floating-point for now.


-David Etherton
 Rockstar San Diego

--- >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