[vorbis-dev] vorbis on playstation 2

David Etherton etherton at rockstarsandiego.com
Thu Feb 6 18:33:33 PST 2003

> Beware that the low accuracy uses unbalanced multiplications, like
> This was done to get the best audio quality after many listening tests.
> you change that bit ratio in either direction you're likely to increase
> the presence of artifacts a lot.

Hmm.  Bummer.  I wish there was a four-wide integer 32-by-anything multiply
on PS2 but there isn't.

How about this optimiziation I tried for MULT31:

ogg_int32_t MULT31(ogg_int32_t x, ogg_int32_t y) {
  return ((ogg_int32_t) (((ogg_int64_t)x * y) >> 31));

ogg_int32_t MULT31x(ogg_int32_t x, ogg_int32_t y) {
  return ((ogg_int32_t) (((ogg_int64_t)x * y) >> 32) << 1);

doing a shift right by 32 and a shift left by one allows the compiler to
avoid double-wide shift insns:

0000000000000020 <MULT31>:
  20:   00850018        mult    $a0,$a1
  24:   00001812        mflo    $v1
  28:   00001010        mfhi    $v0
  2c:   0003183c        dsll32  $v1,$v1,0x0
  30:   0002103c        dsll32  $v0,$v0,0x0
  34:   0003183e        dsrl32  $v1,$v1,0x0
  38:   00431025        or      $v0,$v0,$v1
  3c:   00021078        dsll    $v0,$v0,0x1
  40:   0002103f        dsra32  $v0,$v0,0x0
  44:   03e00008        jr      $ra
  48:   00000000        nop

0000000000000010 <MULT31x>:
  10:   00850018        mult    $a0,$a1
  14:   00001010        mfhi    $v0
  18:   03e00008        jr      $ra
  1c:   00021040        sll     $v0,$v0,0x1

Would the single bit make a big difference?


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