[vorbis-dev] mdct_backward with fused muladd?

David Etherton etherton at rockstarsandiego.com
Tue May 20 19:47:26 PDT 2003



> This was discussed on this list some time ago.

Okay, I'll search the archives, thanks.  I've only been on the lists since
the beginning of this year, and I'm trying to learn as little as possible to
get vorbis integrated and fast enough to use on our game engine :-)

> Well in fact you could start with the current Tremor code where the XPROD
> macros can easily be redefined specifically for your target.  You can look
> at the ARM version where the 32x32->64 MAC instruction is used for
example.

That's what I've been doing (I have a mips target, so 32x32->64 is free, and
I mfhi instead of shifting right 32) but I've hit a wall on getting it any
faster.

I also tried using the fused integer muladd on my platform for those
functions, but the resulting audio is distorted; by diffing against known
good output data it looks like I've got a wraparound problem.  In other
words

(((a * t) >> 32) << 1) + (((b * v) >> 32) << 1)   (standard XPROD31)

doesn't seem to work out the same as

((a * t) + (b * v)) >> 32) << 1

on the borderline cases (where the multiplies produce 64-bit results).

> No.  See the definition of MULT32() and MULT31() for the _LOW_ACCURACY_
> case.  I had to make the multiplication unbalanced (like 24x8) since a
16x16
> would not give acceptable audio quality.

Yeah, I was familiar with that restriction but this is for background music
during a video game, so I was hoping I could sqeak by.  Guess not.  Looking
at the lowmem-branch code (which unfortunately now has a structure member
named 'class' much to the annoyance of my C++ compiler) there have been some
optimizations made where the mdct spits out 16 bit pcm directly, which means
that at least the window overlap can presumably use 16-bit arithmetic.

> Yeah, that's the generic cookbook method.  This however sucks big time on
> ARM where immediate arguments can be used directly within opcodes only if
> they're not wider than 8 bits.  The current version was optimized for ARM.

Makes sense, since that's where most of the embedded consumer device market
is.  You guys obviously want ogg on your car stereo and your portable music
devices.  I want ogg on my PlayStation2 games :-)

Thanks again,

-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